ElementV2Entity extends ElementEntity
Base entity
Tags
Table of Contents
Constants
- DEFAULT_OBJECT_PREFIX = 'EO_'
Methods
- __clone() : mixed
- addField() : Field|false
- camel2snake() : string
- cleanCache() : mixed
- Cleans all cache entries for the entity.
- compileCollectionClass() : Collection|string
- compileDbTableStructureDump() : array<string|int, string>
- compileEntity() : Entity
- compileObjectClass() : EntityObject|string
- createCollection() : null
- createDbTable() : void
- Creates table according to Fields collection
- createObject() : null
- destroy() : bool
- enableFullTextIndex() : mixed
- Sets a flag indicating full text index support for a field.
- fullTextIndexEnabled() : bool
- Returns true if full text index is enabled for a field.
- get() : Entity
- Returns entity object
- getAutoIncrement() : mixed
- getCacheTtl() : int
- Returns cache TTL for the entity, possibly limited by the .settings.php: 'cache_flags' => array('value'=> array( "b_group_max_ttl" => 200, "b_group_min_ttl" => 100, )) Maximum is a higher-priority.
- getCode() : mixed
- getCollectionClass() : Collection|string
- getCollectionClassName() : Collection|string
- getConnection() : Connection
- getDataClass() : DataManager|string
- getDBTableName() : mixed
- getDefaultCollectionClassName() : mixed
- getDefaultObjectClassName() : mixed
- getEntityClassParts() : mixed
- getField() : Field|ScalarField
- getFields() : mixed
- getFullName() : mixed
- getIblock() : EO_Iblock
- getInstance() : Entity
- getInstanceByQuery() : Entity
- getLangCode() : mixed
- getModule() : mixed
- getMultiValueTableName() : mixed
- getName() : mixed
- getNamespace() : mixed
- getObjectClass() : EntityObject|string
- Returns class of Object for current entity.
- getObjectClassName() : EntityObject|string
- Returns class name of Object for current entity.
- getPrimary() : mixed
- getPrimaryArray() : mixed
- getReferencesCountTo() : mixed
- getReferencesTo() : mixed
- getScalarFields() : array<string|int, ScalarField>
- getSingleValueTableName() : mixed
- getTitle() : mixed
- getUfId() : mixed
- getUField() : UField
- has() : bool
- Checks if entity exists
- hasField() : mixed
- hasUField() : bool
- initialize() : mixed
- initializeField() : Field
- Fields factory
- isExists() : mixed
- isUtm() : mixed
- isUts() : mixed
- normalizeEntityClass() : string|DataManager
- normalizeName() : mixed
- onUserTypeChange() : mixed
- postInitialize() : mixed
- readFromCache() : ArrayResult|null
- Reads data from cache.
- reinitialize() : mixed
- Reinitializing entity object for another Table class.
- setDefaultScope() : Query
- setIblock() : mixed
- snake2camel() : mixed
- wakeUpCollection() : null
- wakeUpObject() : null
- writeToCache() : ArrayResult
Constants
DEFAULT_OBJECT_PREFIX
public
mixed
DEFAULT_OBJECT_PREFIX
= 'EO_'
Methods
__clone()
public
__clone() : mixed
addField()
public
addField(array<string|int, mixed>|Field $fieldInfo[, null|string $fieldName = null ]) : Field|false
Parameters
- $fieldInfo : array<string|int, mixed>|Field
- $fieldName : null|string = null
Tags
Return values
Field|falsecamel2snake()
public
static camel2snake(mixed $str) : string
Use Bitrix\StringHelper::camel2snake instead
Parameters
- $str : mixed
Return values
stringcleanCache()
Cleans all cache entries for the entity.
public
cleanCache() : mixed
compileCollectionClass()
public
static compileCollectionClass(mixed $dataClass) : Collection|string
Parameters
- $dataClass : mixed
Return values
Collection|stringcompileDbTableStructureDump()
public
compileDbTableStructureDump() : array<string|int, string>
Tags
Return values
array<string|int, string> —Array of SQL queries
compileEntity()
public
static compileEntity(string $entityName[, null|array<string|int, array<string|int, mixed>>|array<string|int, Field> $fields = null ][, array<string|int, mixed> $parameters = array() ]) : Entity
Parameters
- $entityName : string
- $fields : null|array<string|int, array<string|int, mixed>>|array<string|int, Field> = null
- $parameters : array<string|int, mixed> = array()
-
[namespace, table_name, uf_id, parent, parent_map, default_scope]
Tags
Return values
EntitycompileObjectClass()
public
static compileObjectClass(mixed $dataClass) : EntityObject|string
Parameters
- $dataClass : mixed
Return values
EntityObject|stringcreateCollection()
public
createCollection() : null
Return values
null —Actual type should be annotated by orm:annotate
createDbTable()
Creates table according to Fields collection
public
createDbTable() : void
Tags
createObject()
public
createObject([bool $setDefaultValues = true ]) : null
Parameters
- $setDefaultValues : bool = true
Return values
null —Actual type should be annotated by orm:annotate
destroy()
public
static destroy(Entity|string $entity) : bool
Parameters
- $entity : Entity|string
Return values
boolenableFullTextIndex()
Sets a flag indicating full text index support for a field.
public
enableFullTextIndex(string $field[, bool $mode = true ]) : mixed
Does nothing, mysql 5.6 has fulltext always enabled.
Parameters
- $field : string
- $mode : bool = true
fullTextIndexEnabled()
Returns true if full text index is enabled for a field.
public
fullTextIndexEnabled(string $field) : bool
Always returns true, mysql 5.6 has fulltext always enabled.
Parameters
- $field : string
Return values
boolget()
Returns entity object
public
static get(mixed $entityName) : Entity
Parameters
- $entityName : mixed
Tags
Return values
EntitygetAutoIncrement()
public
getAutoIncrement() : mixed
getCacheTtl()
Returns cache TTL for the entity, possibly limited by the .settings.php: 'cache_flags' => array('value'=> array( "b_group_max_ttl" => 200, "b_group_min_ttl" => 100, )) Maximum is a higher-priority.
public
getCacheTtl(int $ttl) : int
Parameters
- $ttl : int
-
Preferable TTL
Return values
int —Calculated TTL
getCode()
public
getCode() : mixed
getCollectionClass()
public
getCollectionClass() : Collection|string
Return values
Collection|stringgetCollectionClassName()
public
getCollectionClassName() : Collection|string
Return values
Collection|stringgetConnection()
public
getConnection() : Connection
Return values
ConnectiongetDataClass()
public
getDataClass() : DataManager|string
Return values
DataManager|stringgetDBTableName()
public
getDBTableName() : mixed
getDefaultCollectionClassName()
public
static getDefaultCollectionClassName(mixed $entityName) : mixed
Parameters
- $entityName : mixed
getDefaultObjectClassName()
public
static getDefaultObjectClassName(mixed $entityName) : mixed
Parameters
- $entityName : mixed
getEntityClassParts()
public
static getEntityClassParts(mixed $class) : mixed
Parameters
- $class : mixed
getField()
public
getField(mixed $name) : Field|ScalarField
Parameters
- $name : mixed
Tags
Return values
Field|ScalarFieldgetFields()
public
getFields() : mixed
getFullName()
public
getFullName() : mixed
getIblock()
public
getIblock() : EO_Iblock
Return values
EO_IblockgetInstance()
public
static getInstance(string $entityName) : Entity
Parameters
- $entityName : string
Tags
Return values
EntitygetInstanceByQuery()
public
static getInstanceByQuery(Query $query[, null &$entity_name = null ]) : Entity
Parameters
- $query : Query
- $entity_name : null = null
Tags
Return values
EntitygetLangCode()
public
getLangCode() : mixed
getModule()
public
getModule() : mixed
getMultiValueTableName()
public
getMultiValueTableName() : mixed
getName()
public
getName() : mixed
getNamespace()
public
getNamespace() : mixed
getObjectClass()
Returns class of Object for current entity.
public
getObjectClass() : EntityObject|string
Return values
EntityObject|stringgetObjectClassName()
Returns class name of Object for current entity.
public
getObjectClassName() : EntityObject|string
Return values
EntityObject|stringgetPrimary()
public
getPrimary() : mixed
getPrimaryArray()
public
getPrimaryArray() : mixed
getReferencesCountTo()
public
getReferencesCountTo(mixed $refEntityName) : mixed
Parameters
- $refEntityName : mixed
getReferencesTo()
public
getReferencesTo(mixed $refEntityName) : mixed
Parameters
- $refEntityName : mixed
getScalarFields()
public
getScalarFields() : array<string|int, ScalarField>
Return values
array<string|int, ScalarField>getSingleValueTableName()
public
getSingleValueTableName() : mixed
getTitle()
public
getTitle() : mixed
getUfId()
public
getUfId() : mixed
getUField()
public
getUField(mixed $name) : UField
Parameters
- $name : mixed
Tags
Return values
UFieldhas()
Checks if entity exists
public
static has(mixed $entityName) : bool
Parameters
- $entityName : mixed
Return values
boolhasField()
public
hasField(mixed $name) : mixed
Parameters
- $name : mixed
hasUField()
public
hasUField(mixed $name) : bool
Parameters
- $name : mixed
Tags
Return values
boolinitialize()
public
initialize(mixed $className) : mixed
Parameters
- $className : mixed
initializeField()
Fields factory
public
initializeField(string $fieldName, array<string|int, mixed>|Field $fieldInfo) : Field
Parameters
- $fieldName : string
- $fieldInfo : array<string|int, mixed>|Field
Tags
Return values
FieldisExists()
public
static isExists(mixed $name) : mixed
Parameters
- $name : mixed
isUtm()
public
isUtm() : mixed
isUts()
public
isUts() : mixed
normalizeEntityClass()
public
static normalizeEntityClass(mixed $entityName) : string|DataManager
Parameters
- $entityName : mixed
Return values
string|DataManagernormalizeName()
public
static normalizeName(mixed $entityName) : mixed
Parameters
- $entityName : mixed
onUserTypeChange()
public
static onUserTypeChange(mixed $userfield[, mixed $id = null ]) : mixed
Parameters
- $userfield : mixed
- $id : mixed = null
postInitialize()
public
postInitialize() : mixed
Tags
readFromCache()
Reads data from cache.
public
readFromCache(int $ttl, string $cacheId[, bool $countTotal = false ]) : ArrayResult|null
Parameters
- $ttl : int
-
TTL.
- $cacheId : string
-
The cache ID.
- $countTotal : bool = false
-
Whether to read total count from the cache.
Return values
ArrayResult|nullreinitialize()
Reinitializing entity object for another Table class.
public
reinitialize(mixed $className) : mixed
Can be useful for complex inheritance with cloning.
Parameters
- $className : mixed
setDefaultScope()
public
setDefaultScope(Query $query) : Query
Parameters
- $query : Query
Return values
QuerysetIblock()
public
setIblock(EO_Iblock $iblock) : mixed
Parameters
- $iblock : EO_Iblock
Tags
snake2camel()
public
static snake2camel(mixed $str) : mixed
Use Bitrix\StringHelper::snake2camel instead
Parameters
- $str : mixed
wakeUpCollection()
public
wakeUpCollection(mixed $rows) : null
Parameters
- $rows : mixed
Tags
Return values
null —Actual type should be annotated by orm:annotate
wakeUpObject()
public
wakeUpObject(mixed $row) : null
Parameters
- $row : mixed
Tags
Return values
null —Actual type should be annotated by orm:annotate
writeToCache()
public
writeToCache(Result $result, string $cacheId[, bool $countTotal = false ]) : ArrayResult
Parameters
- $result : Result
-
A query result to cache.
- $cacheId : string
-
The cache ID.
- $countTotal : bool = false
-
Whether to write total count to the cache.