Elgg  Version 1.11
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Elgg\AttributeLoader Class Reference

Public Member Functions

 __construct ($class, $required_type, array $initialized_attrs)
 Constructor. More...
 
 getAdditionalSelectValues ()
 Get values selected from the database that are not attributes. More...
 
 getRequiredAttributes ($row)
 Get all required attributes for the entity, validating any that are passed in. More...
 

Public Attributes

 $requires_access_control = true
 
 $primary_loader = 'get_entity_as_row'
 
 $secondary_loader = ''
 
 $full_loader = ''
 

Protected Member Functions

 isMissingPrimaries ($row)
 Get primary attributes missing that are missing. More...
 
 isMissingSecondaries ($row)
 Get secondary attributes that are missing. More...
 
 checkType ($row)
 Check that the type is correct. More...
 
 filterAddedColumns ($row)
 Filter non-attribute keys into $this->additional_select_values. More...
 

Protected Attributes

 $secondary_attr_names = array()
 
 $required_type
 
 $initialized_attributes
 
 $class
 
 $additional_select_values = array()
 

Static Protected Attributes

static $primary_attr_names
 
static $integer_attr_names
 
static $null_attr_names
 

Detailed Description

Definition at line 12 of file AttributeLoader.php.

Constructor & Destructor Documentation

Elgg\AttributeLoader::__construct (   $class,
  $required_type,
array  $initialized_attrs 
)

Constructor.

Parameters
string$classclass of object being loaded
string$required_typeentity type this is being used to populate
array$initialized_attrsattributes after initializeAttributes() has been run
Exceptions

Definition at line 114 of file AttributeLoader.php.

Member Function Documentation

Elgg\AttributeLoader::checkType (   $row)
protected

Check that the type is correct.

Parameters
\stdClass$rowDatabase row
Returns
void
Exceptions

Definition at line 157 of file AttributeLoader.php.

Elgg\AttributeLoader::filterAddedColumns (   $row)
protected

Filter non-attribute keys into $this->additional_select_values.

Parameters
array$rowAll columns from the query
Returns
array Columns acceptable for the entity's attributes

Definition at line 270 of file AttributeLoader.php.

Elgg\AttributeLoader::getAdditionalSelectValues ( )

Get values selected from the database that are not attributes.

Returns
array

Definition at line 169 of file AttributeLoader.php.

Elgg\AttributeLoader::getRequiredAttributes (   $row)

Get all required attributes for the entity, validating any that are passed in.

Returns empty array if can't be loaded (Check $failure_reason).

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.

Parameters
mixed$rowa row loaded from DB (array or ) or a GUID
Returns
array will be empty if failed to load all attributes (access control or entity doesn't exist)
Exceptions

Definition at line 186 of file AttributeLoader.php.

Elgg\AttributeLoader::isMissingPrimaries (   $row)
protected

Get primary attributes missing that are missing.

Parameters
\stdClass$rowDatabase row
Returns
array

Definition at line 136 of file AttributeLoader.php.

Elgg\AttributeLoader::isMissingSecondaries (   $row)
protected

Get secondary attributes that are missing.

Parameters
\stdClass$rowDatabase row
Returns
array

Definition at line 146 of file AttributeLoader.php.

Member Data Documentation

Elgg\AttributeLoader::$additional_select_values = array()
protected

Definition at line 104 of file AttributeLoader.php.

Elgg\AttributeLoader::$class
protected

Definition at line 79 of file AttributeLoader.php.

Elgg\AttributeLoader::$full_loader = ''

Definition at line 99 of file AttributeLoader.php.

Elgg\AttributeLoader::$initialized_attributes
protected

Definition at line 74 of file AttributeLoader.php.

Elgg\AttributeLoader::$integer_attr_names
staticprotected
Initial value:
= array(
'guid',
'owner_guid',
'container_guid',
'site_guid',
'access_id',
'time_created',
'time_updated',
'last_action',
'prev_last_action',
'last_login',
'prev_last_login'
)

Definition at line 36 of file AttributeLoader.php.

Elgg\AttributeLoader::$null_attr_names
staticprotected
Initial value:
= array(
'name',
'title',
'description',
'url',
)

Definition at line 54 of file AttributeLoader.php.

Elgg\AttributeLoader::$primary_attr_names
staticprotected
Initial value:
= array(
'guid',
'type',
'subtype',
'owner_guid',
'container_guid',
'site_guid',
'access_id',
'time_created',
'time_updated',
'last_action',
'enabled',
)

Definition at line 19 of file AttributeLoader.php.

Elgg\AttributeLoader::$primary_loader = 'get_entity_as_row'

Definition at line 89 of file AttributeLoader.php.

Elgg\AttributeLoader::$required_type
protected

Definition at line 69 of file AttributeLoader.php.

Elgg\AttributeLoader::$requires_access_control = true

Definition at line 84 of file AttributeLoader.php.

Elgg\AttributeLoader::$secondary_attr_names = array()
protected

Definition at line 64 of file AttributeLoader.php.

Elgg\AttributeLoader::$secondary_loader = ''

Definition at line 94 of file AttributeLoader.php.


The documentation for this class was generated from the following file: