Ok, i've just finally gotten around to testing my PEBoD class and i get this error upon initialisation:
Fatal error: Call to a member function is_parented() on a non-object in C:\webpage\webpage\incl\PEBoD.php on line 232
[edit] when the comment marks in the code below are removed[/edit]
now i have figured out that the PEBoD_Cage class constructer is at fault:
class PEBoD_Cage extends Cage
{
public $parent;
private $crack;
public function __construct($input)
{
if (!is_object($input) && get_class($input) !== "pebod")
{
$this->sf("Input not a proper object!");
die("moo");
}
/*if (!$input->cage->is_parented()) */$this->parent = $input;
parent::__construct();
$this->crack = 10.25;
}
public function is_parented()
{
if (!isset($this->parent))
{
return 0;
}
if (!is_object($this->parent))
{
return -1;
}
if (get_class($this->parent !== "pebod"))
{
return -2;
}
return 1;
}
now some of the is_parented function is for debug, as that should be taken care of by the constructor. so anyways, ive found that the $input->cage variable is not an object....... so that would lead me to believe that the refereneds arent working.
but wait...... this code works absolutely fine...... which means that they must be:
$moo = new PEBoD();
echo $moo->cage->is_parented();
$moo->cage->close();
echo (int)$moo->cage->parent->cage->is_open();
returns "10" as it should.
im VERY confused right about now 😕