\RoxEntityFactory

This factory is used to create entity objects like Group or Member All MVC-model derived classes are born with an instance of it

Summary

Methods
Properties
Constants
create()
storeTableDescription()
getEntityTableDescription()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$_entities
$_table_descriptions
$_entity_classes
N/A

Properties

$_entities

$_entities : array

here's where you store the name of the file of your entity class omit the .php bit - because you have to store a .ini file too and it has to have the same name as the class file, except for ending

Type

array

$_table_descriptions

$_table_descriptions : array

This static array stores entity DB definitions - that is, the parsed DESCRIBE queries done

Type

array

$_entity_classes

$_entity_classes : array

This static array stores entity reflection instances - that is, the reflection objects used to instantiate entities. Done in order to avoid instantiating them over and over

Type

array

Methods

create()

create() : mixed

Creates an entity object based on input args and returns it Passes any arguments to the entity when creating it NOTE: to pass arguments to this function, pass them as normal! I.E.: $this->_entity_factory('Group', $other_parameter, $other_parameter, etc);

Returns

mixed —

An entity based on RoxEntityBase or false on fail

storeTableDescription()

storeTableDescription(array $info, object $entity)

stores the table description for a given entity

Parameters

array $info
  • array of table info
object $entity
  • an entity object

getEntityTableDescription()

getEntityTableDescription(object $entity) : array|false

fetches the table description for a given entity

Parameters

object $entity
  • entity object to get info for

Returns

array|false