[SOLVED] Classes... again!
Posted: Fri Aug 17, 2007 8:50 am
i've got this situation:
classMinor has defined method getAlfa
classMaior contains an array of classMinor objects (arrMinor)
classSuper contains an array of classMaior objects (arrMaior)
from an instance of classMaior ($this) i'm trying to do:
but it doesn't work...
the first line should work, because if i try to echo it i have:
but the second one doesn't work correctly. The third line give back:
classMinor has defined method getAlfa
classMaior contains an array of classMinor objects (arrMinor)
classSuper contains an array of classMaior objects (arrMaior)
from an instance of classMaior ($this) i'm trying to do:
Code: Select all
$objMaior = $this->arrMaior[$i];
$objMinor = $objMaior->getMinor($j); //getMinor($index) returns arrMinor($index)
$result = $objMinor->getAlfa();the first line should work, because if i try to echo it i have:
Code: Select all
Catchable fatal error: Object of class classMaior could not be converted to stringCode: Select all
Fatal error: Call to a member function getAlfa() on a non-object