示例#1
0
 /**
  * Returns Entity field value, or an extension field value
  *
  * @see Doctrine_Record
  */
 public function get($fieldName, $load = true)
 {
     //try Entity first
     $entityFields = array_merge(array_keys($this->_data), array_keys($this->_table->getRelations()));
     if (in_array($fieldName, $entityFields)) {
         return parent::get($fieldName, $load);
     }
     //then try the extensions
     $fields = $this->getExtensionFields(true);
     if (array_key_exists($fieldName, $fields)) {
         return $this->_extensionObjects[$fields[$fieldName][0]]->get($fieldName, $load);
     } else {
         //the field doesn't exist: do what the parent would do
         return parent::get($fieldName, $load);
     }
 }