hope this works...
3rd time lucky... (sorry for messing up on wrong forum)
Hi, hope you can help...
is the follwoing posible...?
a good idea (or bad idea)?
to have a property of my class, be an aray of obj of another class?
Language: PHP
Class Fixture{
function __construct($ID,$Name,$Date,$Team){
$this->ID=$ID;
$this->Name=$Name;
$this->Date=$Date;
$this->Team=array(); //empty array, to later be filled with a method that will add player obj
$this->game_Pos="";}
}
Class Player{
function __construct($ID,$Name,$Surname){
$this->ID=$ID;
$this->Name=$Name;
$this->Surname=$Surname;}
}
so that when I create the fixture obj... I can have a method that adds player obj to the team Property?
am I overthinking it...
not sure if this is bad practice?