123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace Gedmo\References\Mapping\Event;
- use Doctrine\Common\Persistence\ObjectManager;
- use Gedmo\Mapping\Event\AdapterInterface;
- /**
- * Doctrine event adapter interface for References behavior
- *
- * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
- * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
- * @author Jonathan H. Wage <jonwage@gmail.com>
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
- interface ReferencesAdapter extends AdapterInterface
- {
- /**
- * Gets the identifier of the given object using the passed ObjectManager.
- *
- * @param ObjectManager $om
- * @param object $object
- * @param bool $single
- *
- * @return array|string|int $id - array or single identifier
- */
- public function getIdentifier($om, $object, $single = true);
- /**
- * Gets a single reference for the given ObjectManager, class and identifier.
- *
- * @param ObjectManager $om
- * @param string $class
- * @param array|string|int $identifier
- **/
- public function getSingleReference($om, $class, $identifier);
- /**
- * Extracts identifiers from object or proxy.
- *
- * @param ObjectManager $om
- * @param object $object
- * @param bool $single
- *
- * @return array|string|int - array or single identifier
- */
- public function extractIdentifier($om, $object, $single = true);
- }
|