PropertyObject Class Help
<p>I am new to php and currently I am reading Wrox Professional PHP 5.</p>

<p>Can anyone explain me the following code ?</p>

<pre><code>&lt;? php

abstract class PropertyObject
{
//Stores name/value pairs that hook properties to database field names
protected $propertyTable=array();

//List of properties that have been modified.
protected $changedProperties=array();

//Actual data from the database.
protected $data;

//Any validation errors that might have occured.
protected $errors=array();

public function __construct($arData)
{
     $this-&gt;data=$arData;
}

function __get($propertyName)
{
     if(!array_key_exits($propertyName,$this-&gt;propertyTable))
     {
          throw new Exception("Invalid property \"$propertyName\" !");
     }

     if(method_exists($this,'get'.$propertyName))
     {
          return call_user_func(array($this,'get'.$propertyName));
     }
     else
     {
          return $this-&gt;data[$this-&gt;propertyTable[$propertyName]];
     }
}

function __set($propertyName,$value)
{
     if(!array_key_exits($propertyName,$this-&gt;propertyTable))
     {
          throw new Exception("Invalid property \"$propertyName\" !")
     }

     if(method_exits($this,'set'.$propertyName))
     {
     return call_user_func(array($this,'set'.$propertyName),$value);
     }
     else
     {
     //If the value of the property really has changed and it's not already in the changedProperties array, add it.

          if($this-&gt;propertyTable[$propertyName] !=$value &amp;&amp; !in_array($propertyName,$this-&gt;changedProperties))
          {
               $this-&gt;changedProperties[]=$propertyName;
          }

          //Now set the new value
          $this-&gt;data[$this-&gt;propertyTable[$propertyName]]=$value;

     }
}

}
?&gt;
</code></pre>

<p>I can't understand the code inside assessor get and set methods.</p>
