yii2 advanced app - change blameable behaviour / value -
i created blameable values im model following options:
blameable behaviors created by:angelegt_von updated by:aktualisiert_von value:\yii::$app->user->id
this works fine now, need value \yii::$app->person->id.
instead of automatically fill specified attributes current user id,it should filled person id
person class(model) in application,created gii. however,following code throw out error:getting unknown property: yii\web\application::person
public function behaviors() { return [ 'timestamp' => [ 'class' => timestampbehavior::classname(), 'createdatattribute' => 'angelegt_am', 'updatedatattribute' => 'aktualisiert_am', 'value' => new \yii\db\expression('now()'), ], 'blameable' => [ 'class' => blameablebehavior::classname(), 'createdbyattribute' => 'angelegt_von', 'updatedbyattribute' => 'aktualisiert_von', 'value' => \yii::$app->person->id, ], 'uuid' => [ 'class' => uuidbehavior::classname(), 'column' => 'id', ], ]; }
any suggestions how achieve concept?
Comments
Post a Comment