Class lispa\amos\core\behaviors\BlameableBehavior

Inheritancelispa\amos\core\behaviors\BlameableBehavior » yii\behaviors\BlameableBehavior » yii\behaviors\AttributeBehavior » yii\base\Behavior » yii\base\Object
Implementsyii\base\Configurable

Class BlameableBehavior

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attributes array List of attributes that are to be automatically filled with the value specified via $value. yii\behaviors\AttributeBehavior
$createdByAttribute string The attribute that will receive current user ID value Set this property to false if you do not want to record the creator ID. yii\behaviors\BlameableBehavior
$owner yii\base\Component|null The owner of this behavior yii\base\Behavior
$skipUpdateOnClean boolean Whether to skip this behavior when the $owner has not been modified yii\behaviors\AttributeBehavior
$updatedByAttribute string The attribute that will receive current user ID value Set this property to false if you do not want to record the updater ID. yii\behaviors\BlameableBehavior
$value mixed The value that will be assigned to the current attributes. yii\behaviors\BlameableBehavior

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Object
__construct() Constructor. yii\base\Object
__get() Returns the value of an object property. yii\base\Object
__isset() Checks if a property is set, i.e. defined and not null. yii\base\Object
__set() Sets value of an object property. yii\base\Object
__unset() Sets an object property to null. yii\base\Object
attach() Attaches the behavior object to the component. yii\base\Behavior
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Object
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Object
className() Returns the fully qualified name of this class. yii\base\Object
detach() Detaches the behavior object from the component. yii\base\Behavior
evaluateAttributes() Evaluates the attribute value and assigns it to the current attributes. yii\behaviors\AttributeBehavior
events() Declares event handlers for the $owner's events. yii\behaviors\AttributeBehavior
hasMethod() Returns a value indicating whether a method is defined. yii\base\Object
hasProperty() Returns a value indicating whether a property is defined. yii\base\Object
init() Initializes the object. yii\behaviors\BlameableBehavior

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getValue() Returns the value for the current attributes. lispa\amos\core\behaviors\BlameableBehavior

Method Details

getValue() protected method

Returns the value for the current attributes.

This method is called by evaluateAttributes(). Its return value will be assigned to the attributes corresponding to the triggering event.

In case, when the $value property is null, the value of Yii::$app->user->id will be used as the value.

In case, when the $value property is null, the value of Yii::$app->user->id will be used as the value.

protected mixed getValue ( $event )
$event yii\base\Event

The event that triggers the current attribute updating.

return mixed

The attribute value