LMongo\Eloquent\Model::attributesToArray PHP 메소드

attributesToArray() 공개 메소드

Convert the model's attributes to an array.
public attributesToArray ( ) : array
리턴 array
    public function attributesToArray()
    {
        $attributes = $this->getArrayableAttributes();
        // We want to spin through all the mutated attributes for this model and call
        // the mutator for the attribute. We cache off every mutated attributes so
        // we don't have to constantly check on attributes that actually change.
        foreach ($this->getMutatedAttributes() as $key) {
            if (!array_key_exists($key, $attributes)) {
                continue;
            }
            $attributes[$key] = $this->mutateAttribute($key, $attributes[$key]);
        }
        return $attributes;
    }
Model