BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
BlueSpice\EntityFactory Class Reference

Public Member Functions

 __construct ($entityRegistry, $configFactory, $config)
 
 newFromContent (EntityContent $sContent)
 
 newFromObject (\stdClass $object=null)
 
 newFromID ($id, $ns, $reload=false)
 
 newFromSourceTitle (\Title $title=null, $reload=false)
 
 detachCache (Entity &$oInstance)
 

Protected Member Functions

 factory ($type, $data)
 
 appendCache (Entity &$oInstance)
 
 getInstanceFromCacheByID ($id, $ns=-1)
 
 hasCacheEntry ($id, $ns=-1)
 

Protected Attributes

 $storedById = array()
 
 $entityRegistry = null
 
 $configFactory = null
 
 $config = null
 

Constructor & Destructor Documentation

BlueSpice\EntityFactory::__construct (   $entityRegistry,
  $configFactory,
  $config 
)
Parameters
\BlueSpice\EntityRegistry$entityRegistry
\BlueSpice\EntityConfigFactory$configFactory
\Config$config
Returns
Entity | null

Member Function Documentation

BlueSpice\EntityFactory::appendCache ( Entity $oInstance)
protected

Adds a Entity to the cache

Parameters
Entity$oInstance
Returns
Entity
BlueSpice\EntityFactory::detachCache ( Entity $oInstance)

Removes a Entity from the cache if it's in

Parameters
Entity$oInstance
Returns
Entity
BlueSpice\EntityFactory::getInstanceFromCacheByID (   $id,
  $ns = -1 
)
protected

Gets a instance of the Entity from the cache by ID

Parameters
int$id
Returns
Entity
BlueSpice\EntityFactory::newFromContent ( EntityContent  $sContent)

Get Entity by EntityContent Object, wrapper for newFromObject

Parameters
EntityContent$sContent
Returns
Entity | null
BlueSpice\EntityFactory::newFromID (   $id,
  $ns,
  $reload = false 
)

Get Entity from ID

Parameters
int$id
int$ns
boolean$reload
Returns
Entity | null
BlueSpice\EntityFactory::newFromObject ( \stdClass  $object = null)

Get Entity by Json Object

Parameters
Object$object
Returns
Entity | null
BlueSpice\EntityFactory::newFromSourceTitle ( \Title  $title = null,
  $reload = false 
)

Main method for getting a Entity from a Title

Parameters
\Title$title
boolean$reload
Returns
Entity | null

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