Add alternative constructor
Adds a new constructor that allows to create a new instance of the MathRenderer based on an inputhash. This method is required for the Specialpage and the MathSearch extension. Change-Id: I618b0fa7dcfdf8a7c740991c19ae0d70e71f19ba
This commit is contained in:
parent
27aee07cb0
commit
d928de94e5
@ -95,6 +95,19 @@ abstract class MathRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $md5
|
||||
* @return MathRenderer the MathRenderer generated from md5
|
||||
*/
|
||||
public static function newFromMd5( $md5 ) {
|
||||
$class = get_called_class();
|
||||
$instance = new $class;
|
||||
$instance->setMd5( $md5 );
|
||||
$instance->readFromDatabase();
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static factory method for getting a renderer based on mode
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user