setHidden() public method

Set the hidden attributes for the model.
public setHidden ( array $hidden )
$hidden array
コード例 #1
0
 /**
  * Applies processing to a single model
  *
  * @param Model $model
  * @return Model
  */
 public function process(Model $model)
 {
     $hiddenOnModel = $model->getHidden();
     foreach ($this->unhidden as $unhidden) {
         if (($key = array_search($unhidden, $hiddenOnModel)) !== false) {
             unset($hiddenOnModel[$key]);
         }
     }
     $hiddenOnModel = array_merge($hiddenOnModel, $this->hidden);
     $model->setHidden($hiddenOnModel);
     return $model;
 }
コード例 #2
0
 /**
  * Set hidden fields.
  *
  * @param array $fields
  *
  * @return $this
  */
 public function hidden(array $fields)
 {
     $this->model->setHidden($fields);
     return $this;
 }