Xpressengine\Support\Entity::fill PHP Method

fill() public method

Fill the model with an array of attributes.
public fill ( array $attributes )
$attributes array attributes
    public function fill(array $attributes)
    {
        foreach ($attributes as $key => $val) {
            if ($this->isFillable($key)) {
                $this->attributes[$key] = $val;
            }
        }
        return $this;
    }

Usage Example

 /**
  * Fill all attributes
  *
  * @param array $attributes attributes in object
  * @return void
  */
 public function fill(array $attributes)
 {
     parent::fill($attributes);
     if (isset($attributes['vars'])) {
         $this->setValueObject($attributes);
     }
 }