ElggEntity::initializeAttributes PHP Method

initializeAttributes() protected method

This is vital to distinguish between metadata and base parameters.
protected initializeAttributes ( ) : void
return void
    protected function initializeAttributes()
    {
        parent::initializeAttributes();
        $this->attributes['guid'] = null;
        $this->attributes['type'] = null;
        $this->attributes['subtype'] = null;
        $this->attributes['owner_guid'] = _elgg_services()->session->getLoggedInUserGuid();
        $this->attributes['container_guid'] = _elgg_services()->session->getLoggedInUserGuid();
        $this->attributes['access_id'] = ACCESS_PRIVATE;
        $this->attributes['time_updated'] = null;
        $this->attributes['last_action'] = null;
        $this->attributes['enabled'] = "yes";
    }

Usage Example

Example #1
0
 /**
  * Initialize the attributes array to include the type,
  * title, and description.
  *
  * @return void
  */
 protected function initializeAttributes()
 {
     parent::initializeAttributes();
     $this->attributes['type'] = "object";
     $this->attributes += self::getExternalAttributes();
     $this->tables_split = 2;
 }
All Usage Examples Of ElggEntity::initializeAttributes