MaterializedPathMock.php 762 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Mock to test concurrency in MaterializedPath strategy
  4. *
  5. * @author Gustavo Adrian <comfortablynumb84@gmail.com>
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @link http://www.gediminasm.org
  8. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  9. */
  10. namespace Tree\Fixture\Mock;
  11. use Gedmo\Tree\Strategy\ODM\MongoDB\MaterializedPath;
  12. use Doctrine\Common\Persistence\ObjectManager;
  13. use Gedmo\Mapping\Event\AdapterInterface;
  14. class MaterializedPathMock extends MaterializedPath
  15. {
  16. public $releaseLocks = false;
  17. protected function releaseTreeLocks(ObjectManager $om, AdapterInterface $ea)
  18. {
  19. if ($this->releaseLocks) {
  20. parent::releaseTreeLocks($om, $ea);
  21. }
  22. }
  23. }