LockInterface.php 727 B

1234567891011121314151617181920212223242526272829303132333435
  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\AdminBundle\Model;
  11. use Sonata\AdminBundle\Exception\LockException;
  12. /**
  13. * @author Emmanuel Vella <vella.emmanuel@gmail.com>
  14. */
  15. interface LockInterface
  16. {
  17. /**
  18. * @param object $object
  19. *
  20. * @return mixed|null
  21. */
  22. public function getLockVersion($object);
  23. /**
  24. * @param object $object
  25. * @param mixed $expectedVersion
  26. *
  27. * @throws LockException
  28. */
  29. public function lock($object, $expectedVersion);
  30. }