Is it possible to pass the current class into another one as reference in php ? If yes, how
<p>Here's what I did:</p>

<p>Let's suppose two classes one event and the other one GoogleCalendar.</p>

<pre><code>class Event {
   private $googleCalendar;

   public function __construct() {
     $this-&gt;googleCalendar = new GoogleCalendar();
     $this-&gt;googleCalendar-&gt;set_event($this);
   }
}

class GoogleCalendar {
   private $event;

   public function set_event(&amp;$event) {
      $this-&gt;event = $event;
   }
}
</code></pre>

<p>So, when I access the event element of the GoogleCalendar class, it says the object do not exist. Where is the problem ?</p>

<p>Thanks in advance and let me know if anything is not clear !</p>

<p>Etienne NOEL</p>
