StoreCategory::behaviors PHP Method

behaviors() public method

public behaviors ( ) : array
return array
    public function behaviors()
    {
        $module = Yii::app()->getModule('store');
        return ['imageUpload' => ['class' => 'yupe\\components\\behaviors\\ImageUploadBehavior', 'attributeName' => 'image', 'minSize' => $module->minSize, 'maxSize' => $module->maxSize, 'types' => $module->allowedExtensions, 'uploadPath' => $module !== null ? $module->uploadPath . '/category' : null], 'tree' => ['class' => 'store\\components\\behaviors\\DCategoryTreeBehavior', 'aliasAttribute' => 'slug', 'requestPathAttribute' => 'path', 'parentAttribute' => 'parent_id', 'parentRelation' => 'parent', 'statAttribute' => 'productCount', 'defaultCriteria' => ['order' => 't.sort', 'with' => 'productCount'], 'titleAttribute' => 'name', 'iconAttribute' => function (StoreCategory $item) {
            return $item->getImageUrl(150, 150);
        }, 'iconAltAttribute' => function (StoreCategory $item) {
            return $item->getImageAlt();
        }, 'iconTitleAttribute' => function (StoreCategory $item) {
            return $item->getImageTitle();
        }, 'useCache' => true], 'sortable' => ['class' => 'yupe\\components\\behaviors\\SortableBehavior', 'attributeName' => 'sort']];
    }