LocatorInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  5. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * For full copyright and license information, please see the LICENSE.txt
  9. * Redistributions of files must retain the above copyright notice.
  10. *
  11. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  12. * @link https://cakephp.org CakePHP(tm) Project
  13. * @since 3.1.0
  14. * @license https://opensource.org/licenses/mit-license.php MIT License
  15. */
  16. namespace Cake\ORM\Locator;
  17. use Cake\Datasource\RepositoryInterface;
  18. use Cake\ORM\Table;
  19. /**
  20. * Registries for Table objects should implement this interface.
  21. */
  22. interface LocatorInterface extends \Cake\Datasource\Locator\LocatorInterface
  23. {
  24. /**
  25. * Get a table instance from the registry.
  26. *
  27. * @param string $alias The alias name you want to get.
  28. * @param array $options The options you want to build the table with.
  29. * @return \Cake\ORM\Table
  30. */
  31. public function get(string $alias, array $options = []): Table;
  32. /**
  33. * Set a table instance.
  34. *
  35. * @param string $alias The alias to set.
  36. * @param \Cake\ORM\Table $repository The table to set.
  37. * @return \Cake\ORM\Table
  38. * @psalm-suppress MoreSpecificImplementedParamType
  39. */
  40. public function set(string $alias, RepositoryInterface $repository): Table;
  41. }