3 * This file is part of Zippy.
5 * (c) Alchemy <info@alchemy.fr>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
10 namespace Alchemy\Zippy\Resource;
12 use Alchemy\Zippy\Resource\Resource as ZippyResource;
14 class ResourceTeleporter
21 * @param TeleporterContainer $container
23 public function __construct(TeleporterContainer $container)
25 $this->container = $container;
29 * Teleports a resource to its target in the context
31 * @param string $context
32 * @param ZippyResource $resource
34 * @return ResourceTeleporter
36 public function teleport($context, ZippyResource $resource)
40 ->fromResource($resource)
41 ->teleport($resource, $context);
47 * Creates the ResourceTeleporter with the default TeleporterContainer
49 * @return ResourceTeleporter
51 public static function create()
53 return new static(TeleporterContainer::load());