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
Private Methods
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.
getInvalidClassIdExceptionMessage()
protected static method
Should return a message to use in an Exception when an invalid class ID is supplied to
{@link factory()}.