/**
  * Instantiate an object from a database record
  * @param array $record An associative array that maps to a database row
  * @return object
  */
 protected static function _instantiate($record)
 {
     if (!is_array($record)) {
         $record = array($record);
     }
     $object = new self();
     foreach ($record as $key => $value) {
         if ($object->_hasProperty($key)) {
             $object->{$key} = $value;
         }
     }
     return $object;
 }