AdapterInterface.php 993 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  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 Sonata\CoreBundle\Model\Adapter;
  11. interface AdapterInterface
  12. {
  13. const ID_SEPARATOR = '~';
  14. /**
  15. * Get the identifiers for this model class as a string.
  16. *
  17. * @param object $model
  18. *
  19. * @return string a string representation of the identifiers for this instance
  20. */
  21. public function getNormalizedIdentifier($model);
  22. /**
  23. * Get the identifiers as a string that is save to use in an url.
  24. *
  25. * This is similar to getNormalizedIdentifier but guarantees an id that can
  26. * be used in an URL.
  27. *
  28. * @param object $model
  29. *
  30. * @return string string representation of the id that is save to use in an url
  31. */
  32. public function getUrlsafeIdentifier($model);
  33. }