behaviors\AttributeTypecastBehavior $typecastAfterFind

$typecastAfterFind public property Whether to perform typecasting after retrieving owner model data from the database (after find or refresh). This option may be disabled in order to achieve better performance. For example, in case of yii\db\ActiveRecord usage, typecasting after find will grant no benefit in most cases an thus can be disabled. Note that changing this option value will have no effect after this behavior has been attached to the model. public boolean $typecastAfterFind = fal

behaviors\AttributeTypecastBehavior $skipOnNull

$skipOnNull public property Whether to skip typecasting of null values. If enabled attribute value which equals to null will not be type-casted (e.g. null remains null), otherwise it will be converted according to the type configured at $attributeTypes. public boolean $skipOnNull = true

behaviors\AttributeTypecastBehavior $owner

$owner public property The owner of this behavior. public yii\base\Model|yii\db\BaseActiveRecord $owner = null

behaviors\AttributeTypecastBehavior $attributeTypes

$attributeTypes public property Attribute typecast map in format: attributeName => type. Type can be set via PHP callable, which accept raw value as an argument and should return typecast result. For example: [ 'amount' => 'integer', 'price' => 'float', 'is_active' => 'boolean', 'date' => function ($value) { return ($value instanceof \DateTime) ? $value->getTimestamp(): (int)$value; }, ] If not set, attribute type map will be composed automatic

behaviors\AttributeBehavior getValue()

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. protected mixed getValue ( $event )$event yii\base\Event The event that triggers the current attribute updating. return mixed The attribute value

behaviors\AttributeBehavior events()

events() public method Declares event handlers for the $owner's events. Child classes may override this method to declare what PHP callbacks should be attached to the events of the $owner component. The callbacks will be attached to the $owner's events when the behavior is attached to the owner; and they will be detached from the events when the behavior is detached from the component. The callbacks can be any of the following: method in this behavior: 'handleClick', equivalent to [$this, '

behaviors\AttributeBehavior evaluateAttributes()

evaluateAttributes() public method Evaluates the attribute value and assigns it to the current attributes. public void evaluateAttributes ( $event )$event yii\base\Event

behaviors\AttributeBehavior $value

$value public property The value that will be assigned to the current attributes. This can be an anonymous function, callable in array format (e.g. [$this, 'methodName']), an \yii\behaviors\Expression object representing a DB expression (e.g. new Expression('NOW()')), scalar, string or an arbitrary value. If the former, the return value of the function will be assigned to the attributes. The signature of the function should be as follows, function ($event) { // return value will be assi

behaviors\AttributeBehavior $skipUpdateOnClean

$skipUpdateOnClean public property (available since version 2.0.8) Whether to skip this behavior when the $owner has not been modified public boolean $skipUpdateOnClean = true

behaviors\AttributeBehavior $attributes

$attributes public property List of attributes that are to be automatically filled with the value specified via $value. The array keys are the ActiveRecord events upon which the attributes are to be updated, and the array values are the corresponding attribute(s) to be updated. You can use a string to represent a single attribute, or an array to represent a list of attributes. For example, [ ActiveRecord::EVENT_BEFORE_INSERT => ['attribute1', 'attribute2'], ActiveRecord::EVENT_BE