public function beforeSave()
    {
        if ($this->owner->hasAttribute($this->attribute) && !$this->owner->{$this->attribute}) {
            $this->owner->setAttribute($this->attribute, Yii::$app->user->identity->{$this->attribute});
        }
    }
public function beforeSave()
    {
        if ($this->owner->hasAttribute($this->attribute) && !$this->owner->{$this->attribute}) {
            $this->owner->setAttribute($this->attribute, Yii::$app->user->identity->{$this->attribute});
        }
    }
public function beforeSave ( ) { if ( $ this -> owner -> hasAttribute ( $ this -> attribute ) && ! $ this -> owner -> { $ this -> attribute } ) { $ this -> owner -> setAttribute ( $ this -> attribute , Yii :: $ app -> user -> identity -> { $ this -> attribute } ) ; } }
Automatically sets owners 'owner_id' from current user owner_id
Automatically sets owners owner_id from current user owner_id