mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 18:44:30 +00:00
42 lines
743 B
PHP
42 lines
743 B
PHP
<?php
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2016 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
namespace Alchemy\Phrasea\Core;
|
|
|
|
class LazyLocator
|
|
{
|
|
/**
|
|
* @var \Pimple
|
|
*/
|
|
private $pimple;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $serviceId;
|
|
|
|
/**
|
|
* @param \Pimple $pimple
|
|
* @param string $serviceId
|
|
*/
|
|
public function __construct(\Pimple $pimple, $serviceId)
|
|
{
|
|
$this->pimple = $pimple;
|
|
$this->serviceId = $serviceId;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function __invoke()
|
|
{
|
|
return $this->pimple->offsetGet($this->serviceId);
|
|
}
|
|
}
|