public function __construct($factory = null) { if (!is_null($factory)) { $this->setFactory($factory); } }