菜谱项目

ScopeFactoryInterface.php 1011B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the League\Fractal package.
  4. *
  5. * (c) Phil Sturgeon <me@philsturgeon.uk>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace League\Fractal;
  11. use League\Fractal\Resource\ResourceInterface;
  12. /**
  13. * ScopeFactoryInterface
  14. *
  15. * Creates Scope Instances for resources
  16. */
  17. interface ScopeFactoryInterface
  18. {
  19. /**
  20. * @param Manager $manager
  21. * @param ResourceInterface $resource
  22. * @param string|null $scopeIdentifier
  23. * @return Scope
  24. */
  25. public function createScopeFor(Manager $manager, ResourceInterface $resource, $scopeIdentifier = null);
  26. /**
  27. * @param Manager $manager
  28. * @param Scope $parentScope
  29. * @param ResourceInterface $resource
  30. * @param string|null $scopeIdentifier
  31. * @return Scope
  32. */
  33. public function createChildScopeFor(Manager $manager, Scope $parentScope, ResourceInterface $resource, $scopeIdentifier = null);
  34. }