Example #1
0
 /**
  *
  * @param mixed $value
  * @return Yada_Mapper
  */
 public function set($value)
 {
     if (method_exists($this->_field, 'set')) {
         $value = $this->_field->set($value);
     }
     if ($this->_field instanceof Yada_Field_Interface_Related) {
         return $this->related('add', $value);
     } else {
         $values = $this->_values();
         $name = $this->_field->name;
         $values[$name] = $value;
     }
     $this->_state = 'changed';
     return $this;
 }
Example #2
0
 /**
  * @param callable $action
  *
  * @return $this
  */
 public function notFoundAction($action)
 {
     $this->actions->set(self::ACTION_NOT_FOUND, $action);
     return $this;
 }