Utils
Table of Contents
Constants
- TYPE_CATALOG = 'catalog'
- Entity type catalog.
- TYPE_CATALOG_ALL = 'all'
- Entity type any.
- TYPE_CATALOG_ELEMENT = 'element'
- Entity type catalog element.
- TYPE_CATALOG_SECTION = 'section'
- Entity type section.
Methods
- catalogSearch() : PublicActionResult|CIBlockResult|int
- Search in the catalog.
- checkMultiFeature() : PublicActionResult
- Check feature enabling by codes.
- getCatalogElement() : PublicActionResult
- Gets catalog element by id.
- getCatalogSection() : PublicActionResult
- Gets catalog section by id.
- getIblockURL() : string
- Build element/section url.
- getUrlPreview() : PublicActionResult
- Get meta-data by URL.
- getUserOption() : PublicActionResult|null
- isTrue() : bool
- Check if it is boolean and true.
- saveSettings() : PublicActionResult
- Save some internal settings.
Constants
TYPE_CATALOG
Entity type catalog.
public
mixed
TYPE_CATALOG
= 'catalog'
TYPE_CATALOG_ALL
Entity type any.
public
mixed
TYPE_CATALOG_ALL
= 'all'
TYPE_CATALOG_ELEMENT
Entity type catalog element.
public
mixed
TYPE_CATALOG_ELEMENT
= 'element'
TYPE_CATALOG_SECTION
Entity type section.
public
mixed
TYPE_CATALOG_SECTION
= 'section'
Methods
catalogSearch()
Search in the catalog.
public
static catalogSearch([null $query = null ][, string $type = self::TYPE_CATALOG_ALL ][, int $iblock = null ][, int $siteId = null ]) : PublicActionResult|CIBlockResult|int
Parameters
- $query : null = null
-
Query string.
- $type : string = self::TYPE_CATALOG_ALL
-
Search type.
- $iblock : int = null
-
Iblock id optional.
- $siteId : int = null
-
Site id optional.
Return values
PublicActionResult|CIBlockResult|intcheckMultiFeature()
Check feature enabling by codes.
public
static checkMultiFeature(array<string|int, mixed> $code[, array<string|int, mixed> $params = [] ]) : PublicActionResult
Parameters
- $code : array<string|int, mixed>
-
Feature code.
- $params : array<string|int, mixed> = []
-
Additional params array.
Return values
PublicActionResultgetCatalogElement()
Gets catalog element by id.
public
static getCatalogElement(int $elementId) : PublicActionResult
Parameters
- $elementId : int
-
Element id.
Return values
PublicActionResultgetCatalogSection()
Gets catalog section by id.
public
static getCatalogSection(int $sectionId) : PublicActionResult
Parameters
- $sectionId : int
-
Section id.
Return values
PublicActionResultgetIblockURL()
Build element/section url.
public
static getIblockURL(int $elementId, string $urlType) : string
Parameters
- $elementId : int
-
Element / section id.
- $urlType : string
-
Type of url (section / detail).
Return values
stringgetUrlPreview()
Get meta-data by URL.
public
static getUrlPreview(string $url) : PublicActionResult
Parameters
- $url : string
-
Url.
Return values
PublicActionResultgetUserOption()
public
static getUserOption(string $name) : PublicActionResult|null
Parameters
- $name : string
Return values
PublicActionResult|nullisTrue()
Check if it is boolean and true.
public
static isTrue(mixed $value) : bool
Parameters
- $value : mixed
-
Some value
Return values
boolsaveSettings()
Save some internal settings.
public
static saveSettings(array<string|int, mixed> $settings) : PublicActionResult
Parameters
- $settings : array<string|int, mixed>
-
Settings array.