Understanding the concepts of OOP : <p>Apologies for the potentially super simple question. I am trying to understand OOP. I have gone through tutorials but many of them are hyper simplified and by giving myself a 'real' project I am hitting obstacles most tutorials don't seem to cover. Heres a scenario I kind of wish to understand:</p>

<p>If I was making a very basic sports game (think Fifa) I currently have 3 objects: </p>

<ul>
<li>Object of Pitch  </li>
<li>Object of Team</li>
<li>Object of Player</li>
</ul>

<p>I am hitting my first wall of understanding because I don't want player to simply be an extension of team. After all in real life we would all be objects of human with an attribute that tells us which team we belong to before we are a sub object of a team. </p>

<p>What is the best practise for this?</p>

<p>Should I be: </p>

<ol>
<li>Creating the objects of player and then adding each object to an array which is stored against the team object? This is how I would do it procedurally.  </li>
<li>Storing the team against the player. </li>
<li>Storing the player against the team. </li>
<li>Extending player by team (I want to avoid this unless its actually the done thing)  </li>
</ol>

<p>This is just a brain exercise right now so I don't really have code but</p>

<pre><code>$team1 = new teamObject('red');

$player1 = new players('John'); 
$team1-&gt;addToTeam($player1); 
</code></pre>

<p>This strikes me as it wouldn't work because in the teamObject Class I wouldn't be able to call any of the Player classes function on the passed player function? </p>
