TypeAttribute::model PHP Method

model() public static method

public static model ( null | string $className = __CLASS__ )
$className null | string
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

Exemplo n.º 1
0
 public function setTypeAttributes($attributes)
 {
     TypeAttribute::model()->deleteAllByAttributes(['type_id' => $this->id]);
     if (is_array($attributes)) {
         foreach ($attributes as $attribute_id) {
             $typeAttribute = new TypeAttribute();
             $typeAttribute->type_id = $this->id;
             $typeAttribute->attribute_id = $attribute_id;
             $typeAttribute->save();
         }
     }
 }
All Usage Examples Of TypeAttribute::model