Ejemplo n.º 1
0
 public function setAttribute($attribute, $value)
 {
     $this->lazyParseAttributes();
     if (array_key_exists($attribute, $this->_attributes)) {
         $value = Column::instance()->parseValue($value, static::columns()[$attribute]['type']);
         if ($this->_newRecord) {
             $this->_attributes[$attribute] = $value;
         } else {
             if ($this->_attributes[$attribute] === $value) {
                 unset($this->_changedAttributes[$attribute]);
             } else {
                 $this->_changedAttributes[$attribute] = $value;
             }
         }
         return $this;
     }
     if ($this->relationship->set($attribute, $value) !== false) {
         return $this;
     }
     if (array_key_exists($attribute, $this->_aliasAttributes)) {
         throw new PropertyReadOnlyException($attribute, get_called_class());
     }
     throw new UndefinedPropertyException($attribute, get_called_class());
 }
Ejemplo n.º 2
0
 public static function setUpBeforeClass()
 {
     self::$_column = Column::instance();
 }