PHP Class Piwik\BaseFactory

Factory types are base classes that contain a **factory** method. This method is used to instantiate concrete instances by a specified string ID. Fatal errors do not occur if a class does not exist. Instead an exception is thrown. Derived classes should override the **getClassNameFromClassId** and **getInvalidClassIdExceptionMessage** static methods.
Show file Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
factory ( string $classId ) : Piwik\DataTable\Renderer Creates a new instance of a class using a string ID.

Protected Methods

Method Description
getClassNameFromClassId ( $id ) Should return a class name based on the class's associated string ID.
getInvalidClassIdExceptionMessage ( $id ) Should return a message to use in an Exception when an invalid class ID is supplied to {@link factory()}.

Private Methods

Method Description
sendPlainHeader ( )

Method Details

factory() public static method

Creates a new instance of a class using a string ID.
public static factory ( string $classId ) : Piwik\DataTable\Renderer
$classId string The ID of the class.
return Piwik\DataTable\Renderer

getClassNameFromClassId() protected static method

Should return a class name based on the class's associated string ID.
protected static getClassNameFromClassId ( $id )

getInvalidClassIdExceptionMessage() protected static method

Should return a message to use in an Exception when an invalid class ID is supplied to {@link factory()}.
protected static getInvalidClassIdExceptionMessage ( $id )