Exemplo n.º 1
0
 public function save($post, $auto_whitelist = true)
 {
     if ($this->isNewRecord($post)) {
         //Add new records at the end of the display order
         $segment_id = $this->segment ? $post[$this->segment] : null;
         $post[$this->order] = $this->maxDisplayOrder($segment_id) + 1;
     } else {
         if (empty($post[$this->order])) {
             //Remove the display order field from the fields list,
             // so existing value doesn't get null'ed by recordFromPost().
             $this->fields = array_diff($this->fields, array($this->order));
         }
     }
     return parent::save($post, $auto_whitelist);
 }
Exemplo n.º 2
0
 public function save($post)
 {
     $id = parent::save($post);
     $this->saveColors($id, $post);
     return $id;
 }