Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create an instance of $className without calling its constructor. From \Tx_Extbase_Object_Container_Container
/**
* Create an instance of $className without calling its constructor
*
* @param string $className
* @return object
*/
public function getEmptyObject($className) {
$className = $this->getImplementationClassName($className);
$classInfo = $this->getClassInfo($className);
// get an object and avoid calling __construct()
$object = unserialize('O:' . strlen($className) . ':"' . $className . '":0:{};');
$this->injectDependencies($object, $classInfo);
return $object;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.