Exemplo n.º 1
0
 /**
  * save
  *
  * @param DataInterface $data
  *
  * @return  boolean
  */
 public function save(DataInterface $data)
 {
     $result = parent::save($data);
     // Reorder
     if ($result && $this->get('order.position') == static::ORDER_POSITION_FIRST) {
         $pk = $data->{$this->getKeyName()};
         $this->reorder(array($pk => 0));
         $this->state->set('order.position', null);
     }
     return $result;
 }