public function assign(array $data, $dataColumnMap = null, $whiteList = null)
 {
     return parent::assign($data, $dataColumnMap, $whiteList === null ? $this->whitelist() : $whiteList);
 }
Example #2
0
 /**
  * @param Model $item
  * @param $data
  *
  * @return Model Updated model
  */
 protected function updateItem(Model $item, $data)
 {
     $item->assign($data);
     $success = $item->update();
     return $success ? $item : null;
 }
Example #3
0
 public function assign(array $data, $dataColumnMap = null, $whiteList = null)
 {
     parent::assign($data, $dataColumnMap, $whiteList);
     if (method_exists(get_class($this), 'extraAttributes')) {
         if (count($this->extraAttributes()) > 0) {
             foreach ($this->extraAttributes() as $extra_attribute => $value) {
                 if (isset($data[$extra_attribute])) {
                     $this->{$extra_attribute} = $data[$extra_attribute];
                 }
             }
         }
     }
 }