/** * It gets the value of the field * * @see http://php.net/manual/en/language.oop5.overloading.php * @param string, field_name, the field name * @throws ActiveRecordException * @return field value */ public function __get($name) { if ($this->hasField($name)) { return $this->getField($name)->getValue(); } // if ( $this->inc && $this->inc->getClassName()==ucfirst($name) ) return $this->inc;//->getField( $name )->getValue(); try { return Association::resolve($this, $name)->execute(); } catch (AssociationNotFoundException $anfEx) { throw new ActiveRecordException('Cannot Get the value of field: `' . $name . '`. No such field!', $anfEx->getMessage()); } }