PHP, Erro fatal: Ligue para o método indefinido, por quê?
Eu tenho um simples estruturas php.
class Ingredient e class Ingredients, eu tenho este código:
class Ingredient
{
public function objectIsValid()
{
return $validate[0];
}
}
class Ingredients
{
public $ingObject;
function __construct(){ $ingObject = new Ingredient(); }
public function validateData()
{
if($this->ingObject->objectIsValid() /*** THE ERROR ***/)
{ echo "OK";}
else
{ echo "NOT";}
}
}
$Ingridients = new Ingredients();
$Ingridients->validateData();
Eu simplesmente não consigo entender por que recebo o erro ..
Qualquer ajuda será apreciada.
obrigado!