ProductToCategory::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( string $className = __CLASS__ ) : ProductToCategory
$className string active record class name.
return ProductToCategory the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

Example #1
0
 public function afterDelete()
 {
     // delete children
     $children = Category::model()->findAll("parent_id={$this->cacheId}");
     foreach ($children as $child) {
         $child->delete();
     }
     // delete dependencies
     CategoryPath::model()->deleteAll("category_id={$this->cacheId}");
     CategoryDescription::model()->deleteAll("category_id={$this->cacheId}");
     CategoryFilter::model()->deleteAll("category_id={$this->cacheId}");
     CategoryToStore::model()->deleteAll("category_id={$this->cacheId}");
     CategoryToLayout::model()->deleteAll("category_id={$this->cacheId}");
     ProductToCategory::model()->deleteAll("category_id={$this->cacheId}");
     UrlAlias::model()->deleteAll("query='category_id={$this->cacheId}'");
     parent::afterDelete();
 }
All Usage Examples Of ProductToCategory::model