title: PHP, Fatal error: Call to undefined method, why?
body: <p>I have a simple php structures.</p>
  
  <p>class Ingredient and class Ingredients, i have this code:</p>
  
  <pre><code>class Ingredient
  {   
     public function objectIsValid()
     {
        return $validate[0];
     }
  }
  
  
  
  class Ingredients
  {
     public $ingObject;
     function __construct(){   $ingObject = new Ingredient();   }
  
     public function validateData()
     {
        if($this-&gt;ingObject-&gt;objectIsValid()      /*** THE ERROR  ***/)
      {   echo "OK";}
        else
      {   echo "NOT";}
     } 
  }
  
  
  $Ingridients = new Ingredients();
  
  
  $Ingridients-&gt;validateData();
  </code></pre>
  
  <p>I just can't understand why do i get the error..</p>
  
  <p>any help will be appreciated.</p>
  
  <p>thanks!</p>