my looking at a new project that'll have lots of objects, people, classes, students, employees.
With this, I'll need to also pull 'people' into lists. remove them, add them etc.
Is it possible to have a class of objects which is generic?
Sometihng like this?
<?php
class listOf_Object{
public $obj;
public $mylist;
public function removeObj($obj){
unset($mylist[$obj]);
}
public function addObj($obj){
array_push($mylist, $obj);
}
public function showList(){
foreach ($mylist as $o){
echo $o . PHP_EOL;
}
}
}
$employeeList = new listOf_Object();
$employeeList->addObj($employee);