/** * Loads the full ElggPodcast when given a guid. * * @param mixed $guid GUID of an ElggObject or the stdClass object from entities table * * @return bool * @throws InvalidClassException */ protected function load($guid) { $attr_loader = new ElggAttributeLoader(get_class(), 'object', $this->attributes); $attr_loader->requires_access_control = true; $attr_loader->secondary_loader = 'get_object_entity_as_row'; $attrs = $attr_loader->getRequiredAttributes($guid); if (!$attrs) { return false; } // Force subtype to podcast for this loaded entity $attrs['subtype'] = get_subtype_id('object', 'podcast'); $this->attributes = $attrs; $this->attributes['tables_loaded'] = 2; return true; }
/** * Load the ElggGroup data from the database * * @param mixed $guid GUID of an ElggGroup entity or database row from entity table * * @return bool */ protected function load($guid) { $attr_loader = new ElggAttributeLoader(get_class(), 'group', $this->attributes); $attr_loader->requires_access_control = !$this instanceof ElggPlugin; $attr_loader->secondary_loader = 'get_group_entity_as_row'; $attrs = $attr_loader->getRequiredAttributes($guid); if (!$attrs) { return false; } $this->attributes = $attrs; $this->attributes['tables_loaded'] = 2; _elgg_cache_entity($this); return true; }
/** * Load the ElggUser data from the database * * @param mixed $guid ElggUser GUID or stdClass database row from entity table * * @return bool */ protected function load($guid) { $attr_loader = new ElggAttributeLoader(get_class(), 'user', $this->attributes); $attr_loader->secondary_loader = 'get_user_entity_as_row'; $attrs = $attr_loader->getRequiredAttributes($guid); if (!$attrs) { return false; } $this->attributes = $attrs; $this->attributes['tables_loaded'] = 2; _elgg_cache_entity($this); return true; }