behaviors\AttributeTypecastBehavior typecastAttributes()

typecastAttributes() public method Typecast owner attributes according to $attributeTypes. public void typecastAttributes ( $attributeNames = null )$attributeNames array List of attribute names that should be type-casted. If this parameter is empty, it means any attribute listed in the $attributeTypes should be type-casted.

behaviors\AttributeTypecastBehavior 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\AttributeTypecastBehavior detectAttributeTypes()

detectAttributeTypes() protected method Composes default value for $attributeTypes from the owner validation rules. protected array detectAttributeTypes ( )return array Attribute type map.

behaviors\AttributeTypecastBehavior clearAutoDetectedAttributeTypes()

clearAutoDetectedAttributeTypes() public static method Clears internal static cache of auto detected $attributeTypes values over all affected owner classes. public static void clearAutoDetectedAttributeTypes ( )

behaviors\AttributeTypecastBehavior beforeSave()

beforeSave() public method Handles owner 'afterInsert' and 'afterUpdate' events, ensuring attribute typecasting. public void beforeSave ( $event )$event yii\base\Event Event instance.

behaviors\AttributeTypecastBehavior attach()

attach() public method Attaches the behavior object to the component. The default implementation will set the $owner property and attach event handlers as declared in events(). Make sure you call the parent implementation if you override this method. public void attach ( $owner )$owner yii\base\Component The component that this behavior is to be attached to.

behaviors\AttributeTypecastBehavior afterValidate()

afterValidate() public method Handles owner 'afterValidate' event, ensuring attribute typecasting. public void afterValidate ( $event )$event yii\base\Event Event instance.

behaviors\AttributeTypecastBehavior afterFind()

afterFind() public method Handles owner 'afterFind' event, ensuring attribute typecasting. public void afterFind ( $event )$event yii\base\Event Event instance.

behaviors\AttributeTypecastBehavior $typecastBeforeSave

$typecastBeforeSave public property Whether to perform typecasting before saving owner model (insert or update). This option may be disabled in order to achieve better performance. For example, in case of yii\db\ActiveRecord usage, typecasting before save will grant no benefit 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 $typecastBeforeSave = false

behaviors\AttributeTypecastBehavior $typecastAfterValidate

$typecastAfterValidate public property Whether to perform typecasting after owner model validation. Note that typecasting will be performed only if validation was successful, e.g. owner model has no errors. Note that changing this option value will have no effect after this behavior has been attached to the model. public boolean $typecastAfterValidate = true