PHP Class MetaModels\Factory

To create a MetaModel instance, either call @link{MetaModelFactory::byId()} or @link{MetaModelFactory::byTableName()}
Inheritance: implements metamodels\IFactory
显示文件 Open project: metamodels/core Class Usage Examples

Protected Properties

Property Type Description
$serviceContainer metamodels\IMetaModelsServiceContainer The service container.

Public Methods

Method Description
byId ( integer $intId ) : metamodels\IMetaModel Create a MetaModel instance from the id.
byTableName ( string $strTableName ) : metamodels\IMetaModel Create a MetaModel instance from the table name.
collectNames ( )
getAllTables ( ) : string[] Query for all known MetaModel database tables.
getDefaultFactory ( ) : metamodels\IFactory Retrieve the default factory from the default container.
getMetaModel ( $metaModelName )
getServiceContainer ( ) : metamodels\IMetaModelsServiceContainer Retrieve the service container.
setServiceContainer ( metamodels\IMetaModelsServiceContainer $serviceContainer ) : Factory Set the service container.
translateIdToMetaModelName ( $metaModelId )

Protected Methods

Method Description
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface Retrieve the event dispatcher.

Method Details

byId() public static method

Create a MetaModel instance from the id.
Deprecation: To create an instance use methods translateIdToMetaModelName() and getMetaModel().
public static byId ( integer $intId ) : metamodels\IMetaModel
$intId integer The id of the MetaModel.
return metamodels\IMetaModel the instance of the MetaModel or null if not found.

byTableName() public static method

Create a MetaModel instance from the table name.
Deprecation: To create an instance use method getMetaModel().
public static byTableName ( string $strTableName ) : metamodels\IMetaModel
$strTableName string The name of the table.
return metamodels\IMetaModel the instance of the MetaModel or null if not found.

collectNames() public method

public collectNames ( )

getAllTables() public static method

Query for all known MetaModel database tables.
Deprecation: To retrieve all names use method collectNames().
public static getAllTables ( ) : string[]
return string[] all MetaModel table names as string array.

getDefaultFactory() public static method

Retrieve the default factory from the default container.
public static getDefaultFactory ( ) : metamodels\IFactory
return metamodels\IFactory

getEventDispatcher() protected method

Retrieve the event dispatcher.
protected getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
return Symfony\Component\EventDispatcher\EventDispatcherInterface

getMetaModel() public method

public getMetaModel ( $metaModelName )

getServiceContainer() public method

Retrieve the service container.
public getServiceContainer ( ) : metamodels\IMetaModelsServiceContainer
return metamodels\IMetaModelsServiceContainer

setServiceContainer() public method

Set the service container.
public setServiceContainer ( metamodels\IMetaModelsServiceContainer $serviceContainer ) : Factory
$serviceContainer metamodels\IMetaModelsServiceContainer The service container to use.
return Factory

translateIdToMetaModelName() public method

public translateIdToMetaModelName ( $metaModelId )

Property Details

$serviceContainer protected_oe property

The service container.
protected IMetaModelsServiceContainer,metamodels $serviceContainer
return metamodels\IMetaModelsServiceContainer