43 $this->cache = $values;
73 return $obj ? $obj->id :
false;
91 return isset(
$cache[$subtype_id]) ?
$cache[$subtype_id]->subtype :
false;
131 return $obj ? $obj->class :
null;
151 return isset(
$cache[$subtype_id]) ?
$cache[$subtype_id]->class :
null;
183 INSERT INTO {$this->db->prefix}entity_subtypes
184 (type, subtype, class) VALUES
185 (:type, :subtype, :class)
216 DELETE FROM {$this->db->prefix}entity_subtypes
217 WHERE type = :type AND subtype = :subtype
223 if (!$this->db->deleteData($sql,
$params)) {
248 UPDATE {$this->db->prefix}entity_subtypes
249 SET type = :type, subtype = :subtype, class = :class
258 if (!$this->db->updateData($sql,
false,
$params)) {
284 if ($this->cache ===
null) {
285 $rows = $this->db->getData(
"
287 FROM {$this->db->prefix}entity_subtypes
if(! $collection_name) $id
getId($type, $subtype)
Return the id for a given subtype.
add($type, $subtype, $class="")
Register \ElggEntities with a certain type and subtype to be loaded as a specific class.
setCachedValues(array $values)
Set the cached values from the boot data.
__construct(Database $db)
Constructor.
getSubtype($subtype_id)
Gets the denormalized string for a given subtype ID.
getClassFromId($subtype_id)
Returns the class name for a subtype id.
retrieveFromCache($type, $subtype)
Retrieve subtype from the cache.
getPopulatedCache()
Get a populated cache object.
update($type, $subtype, $class='')
Update a registered \ElggEntity type, subtype, and class name.
getClass($type, $subtype)
Return the class name for a registered type and subtype.
invalidateCache()
Empty the cache.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
if(! $display_name) $type