yii\behaviors\AttributeTypecastBehavior::attach PHP Method

attach() public method

public attach ( $owner )
    public function attach($owner)
    {
        parent::attach($owner);
        if ($this->attributeTypes === null) {
            $ownerClass = get_class($this->owner);
            if (!isset(self::$autoDetectedAttributeTypes[$ownerClass])) {
                self::$autoDetectedAttributeTypes[$ownerClass] = $this->detectAttributeTypes();
            }
            $this->attributeTypes = self::$autoDetectedAttributeTypes[$ownerClass];
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function attach($owner)
 {
     parent::attach($owner);
     if ($this->attributeTypes === null) {
         $this->reinitAutoDetectedAttributeTypes();
     }
 }