PHP 클래스 Elgg\AttributeLoader

파일 보기 프로젝트 열기: elgg/elgg

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$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