diff options
Diffstat (limited to 'app/Factory.php')
| -rw-r--r-- | app/Factory.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/Factory.php b/app/Factory.php index d6269b6ed8..f164c6287c 100644 --- a/app/Factory.php +++ b/app/Factory.php @@ -30,6 +30,7 @@ use Fisharebest\Webtrees\Contracts\RepositoryFactoryInterface; use Fisharebest\Webtrees\Contracts\SourceFactoryInterface; use Fisharebest\Webtrees\Contracts\SubmissionFactoryInterface; use Fisharebest\Webtrees\Contracts\SubmitterFactoryInterface; +use Fisharebest\Webtrees\Contracts\XrefFactoryInterface; /** * A service locator for our various factory objects. @@ -69,6 +70,9 @@ class Factory /** @var SubmitterFactoryInterface */ private static $submitter_factory; + /** @var XrefFactoryInterface */ + private static $xref_factory; + /** * Store or retrieve a factory object. * @@ -244,4 +248,20 @@ class Factory return self::$submitter_factory; } + + /** + * Store or retrieve a factory object. + * + * @param XrefFactoryInterface|null $factory + * + * @return XrefFactoryInterface + */ + public static function xref(XrefFactoryInterface $factory = null): XrefFactoryInterface + { + if ($factory instanceof XrefFactoryInterface) { + self::$xref_factory = $factory; + } + + return self::$xref_factory; + } } |
