PHP Класс RainLab\Blog\Models\Category

Наследование: extends Mode\Model, use trait October\Rain\Database\Traits\Validation, use trait October\Rain\Database\Traits\NestedTree
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$belongsToMany
$implement
$rules * Validation
$table
$translatable Attributes that support translation, if available.

Защищенные свойства (Protected)

Свойство Тип Описание
$guarded

Открытые методы

Метод Описание
afterDelete ( )
beforeValidate ( )
getMenuTypeInfo ( string $type ) : array Handler for the pages.menuitem.getTypeInfo event.
getPostCountAttribute ( )
resolveMenuItem ( RainLab\Pages\Classes\MenuItem $item, string $url, Cms\Classes\Theme $theme ) : mixed Handler for the pages.menuitem.resolveItem event.
setUrl ( string $pageName, Cms\Classes\Controller $controller ) Sets the "url" attribute with a URL to this object

Защищенные методы

Метод Описание
getCategoryPageUrl ( $pageCode, $category, $theme ) Returns URL of a category page.
listSubCategoryOptions ( )

Описание методов

afterDelete() публичный Метод

public afterDelete ( )

beforeValidate() публичный Метод

public beforeValidate ( )

getCategoryPageUrl() защищенный статический Метод

Returns URL of a category page.
protected static getCategoryPageUrl ( $pageCode, $category, $theme )

getMenuTypeInfo() публичный статический Метод

Returns a menu item type information. The type information is returned as array with the following elements: - references - a list of the item type reference options. The options are returned in the ["key"] => "title" format for options that don't have sub-options, and in the format ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, required only if the menu item type requires references. - nesting - Boolean value indicating whether the item type supports nested items. Optional, false if omitted. - dynamicItems - Boolean value indicating whether the item type could generate new menu items. Optional, false if omitted. - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to resolve the item URL.
public static getMenuTypeInfo ( string $type ) : array
$type string Specifies the menu item type
Результат array Returns an array

getPostCountAttribute() публичный Метод

listSubCategoryOptions() защищенный статический Метод

protected static listSubCategoryOptions ( )

resolveMenuItem() публичный статический Метод

Returns information about a menu item. The result is an array with the following keys: - url - the menu item URL. Not required for menu item types that return all available records. The URL should be returned relative to the website root and include the subdirectory, if any. Use the URL::to() helper to generate the URLs. - isActive - determines whether the menu item is active. Not required for menu item types that return all available records. - items - an array of arrays with the same keys (url, isActive, items) + the title key. The items array should be added only if the $item's $nesting property value is TRUE.
public static resolveMenuItem ( RainLab\Pages\Classes\MenuItem $item, string $url, Cms\Classes\Theme $theme ) : mixed
$item RainLab\Pages\Classes\MenuItem Specifies the menu item.
$url string Specifies the current page URL, normalized, in lower case The URL is specified relative to the website root, it includes the subdirectory name, if any.
$theme Cms\Classes\Theme Specifies the current theme.
Результат mixed Returns an array. Returns null if the item cannot be resolved.

setUrl() публичный Метод

Sets the "url" attribute with a URL to this object
public setUrl ( string $pageName, Cms\Classes\Controller $controller )
$pageName string
$controller Cms\Classes\Controller

Описание свойств

$belongsToMany публичное свойство

public $belongsToMany

$guarded защищенное свойство

protected $guarded

$implement публичное свойство

public $implement

$rules публичное свойство

* Validation
public $rules

$table публичное свойство

public $table

$translatable публичное свойство

Attributes that support translation, if available.
public $translatable