PHP Класс Elgg\AttributeLoader

Показать файл Открыть проект

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

Свойство Тип Описание
$full_loader function used to load all necessary attributes
$primary_loader function used to load attributes from {prefix}entities table
$requires_access_control should access control be considered when fetching entity?
$secondary_loader function used to load attributes from secondary table

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

Свойство Тип Описание
$additional_select_values retrieved values that are not attributes
$class class of object being loaded
$initialized_attributes array
$integer_attr_names names of attributes in all entities that should be stored as integer values
$null_attr_names names of attributes in all entities that should be stored as null if empty
$primary_attr_names names of attributes in all entities
$required_type entity type (not class) required for fetched primaries
$secondary_attr_names names of secondary attributes required for the entity

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

Метод Описание
__construct ( string $class, string $required_type, array $initialized_attrs ) Constructor
getAdditionalSelectValues ( ) : array Get values selected from the database that are not attributes
getRequiredAttributes ( mixed $row ) : array Get all required attributes for the entity, validating any that are passed in. Returns empty array if can't be loaded (Check $failure_reason).

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

Метод Описание
checkType ( stdClass $row ) : void Check that the type is correct
filterAddedColumns ( array $row ) : array Filter non-attribute keys into $this->additional_select_values
isMissingPrimaries ( stdClass $row ) : array Get primary attributes missing that are missing
isMissingSecondaries ( stdClass $row ) : array Get secondary attributes that are missing

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

__construct() публичный метод

Constructor
public __construct ( string $class, string $required_type, array $initialized_attrs )
$class string class of object being loaded
$required_type string entity type this is being used to populate
$initialized_attrs array attributes after initializeAttributes() has been run

checkType() защищенный метод

Check that the type is correct
protected checkType ( stdClass $row ) : void
$row stdClass Database row
Результат void

filterAddedColumns() защищенный метод

Filter non-attribute keys into $this->additional_select_values
protected filterAddedColumns ( array $row ) : array
$row array All columns from the query
Результат array Columns acceptable for the entity's attributes

getAdditionalSelectValues() публичный метод

Get values selected from the database that are not attributes
public getAdditionalSelectValues ( ) : array
Результат array

getRequiredAttributes() публичный метод

This function splits loading between "primary" attributes (those in {prefix}entities table) and "secondary" attributes (e.g. those in {prefix}objects_entity), but can load all at once if a combined loader is available.
public getRequiredAttributes ( mixed $row ) : array
$row mixed a row loaded from DB (array or \stdClass) or a GUID
Результат array will be empty if failed to load all attributes (access control or entity doesn't exist)

isMissingPrimaries() защищенный метод

Get primary attributes missing that are missing
protected isMissingPrimaries ( stdClass $row ) : array
$row stdClass Database row
Результат array

isMissingSecondaries() защищенный метод

Get secondary attributes that are missing
protected isMissingSecondaries ( stdClass $row ) : array
$row stdClass Database row
Результат array

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

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

retrieved values that are not attributes
protected $additional_select_values

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

class of object being loaded
protected $class

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

function used to load all necessary attributes
public $full_loader

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

protected array $initialized_attributes
Результат array

$integer_attr_names защищенное статическое свойство

names of attributes in all entities that should be stored as integer values
protected static $integer_attr_names

$null_attr_names защищенное статическое свойство

names of attributes in all entities that should be stored as null if empty
protected static $null_attr_names

$primary_attr_names защищенное статическое свойство

names of attributes in all entities
protected static $primary_attr_names

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

function used to load attributes from {prefix}entities table
public $primary_loader

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

entity type (not class) required for fetched primaries
protected $required_type

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

should access control be considered when fetching entity?
public $requires_access_control

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

names of secondary attributes required for the entity
protected $secondary_attr_names

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

function used to load attributes from secondary table
public $secondary_loader