framework/behaviors/AttributesBehavior.php
public function evaluateAttributes($event)
    {
        if ($this->skipUpdateOnClean
            && $event->name === ActiveRecord::EVENT_BEFORE_UPDATE
            && empty($this->owner->dirtyAttributes)
        ) {
            return;
        }
        $attributes = array_keys(array_filter($this->attributes, function ($carry) use ($event) {
            return array_key_exists($event->name, $carry);
        }));
        if (!empty($this->order[$event->name])) {
            $attributes = array_merge(
                array_intersect((array) $this->order[$event->name], $attributes),
                array_diff($attributes, (array) $this->order[$event->name]));
        }
        foreach ($attributes as $attribute) {
            if ($this->preserveNonEmptyValues && !empty($this->owner->$attribute)) {
                continue;
            }
            $this->owner->$attribute = $this->getValue($attribute, $event);
        }
    }
public function evaluateAttributes($event)
    {
        if ($this->skipUpdateOnClean
            && $event->name === ActiveRecord::EVENT_BEFORE_UPDATE
            && empty($this->owner->dirtyAttributes)
        ) {
            return;
        }
        $attributes = array_keys(array_filter($this->attributes, function ($carry) use ($event) {
            return array_key_exists($event->name, $carry);
        }));
        if (!empty($this->order[$event->name])) {
            $attributes = array_merge(
                array_intersect((array) $this->order[$event->name], $attributes),
                array_diff($attributes, (array) $this->order[$event->name]));
        }
        foreach ($attributes as $attribute) {
            if ($this->preserveNonEmptyValues && !empty($this->owner->$attribute)) {
                continue;
            }
            $this->owner->$attribute = $this->getValue($attribute, $event);
        }
    }
public function evaluateAttributes ( $ event ) { if ( $ this -> skipUpdateOnClean && $ event -> name === ActiveRecord :: EVENT_BEFORE_UPDATE && empty ( $ this -> owner -> dirtyAttributes ) ) { return ; } $ attributes = array_keys ( array_filter ( $ this -> attributes , function ( $ carry ) use ( $ event ) { return array_key_exists ( $ event -> name , $ carry ) ; } ) ) ; if ( ! empty ( $ this -> order [ $ event -> name ] ) ) { $ attributes = array_merge ( array_intersect ( ( array ) $ this -> order [ $ event -> name ] , $ attributes ) , array_diff ( $ attributes , ( array ) $ this -> order [ $ event -> name ] ) ) ; } foreach ( $ attributes as $ attribute ) { if ( $ this -> preserveNonEmptyValues && ! empty ( $ this -> owner -> $ attribute ) ) { continue ; } $ this -> owner -> $ attribute = $ this -> getValue ( $ attribute , $ event ) ; } }
Evaluates the attributes values and assigns it to the current attributes.
@param Event $event
Evaluates the attributes values and assigns it to the current attributes .