MaterializedPathRepository.php 938 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Gedmo\Tree\Document\MongoDB\Repository;
  3. use Gedmo\Exception\InvalidArgumentException,
  4. Gedmo\Tree\Strategy,
  5. Gedmo\Tree\Strategy\ORM\MaterializedPath;
  6. /**
  7. * The MaterializedPathRepository has some useful functions
  8. * to interact with MaterializedPath tree. Repository uses
  9. * the strategy used by listener
  10. *
  11. * @author Gustavo Falco <comfortablynumb84@gmail.com>
  12. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  13. * @package Gedmo.Tree.Entity.Repository
  14. * @subpackage MaterializedPathRepository
  15. * @link http://www.gediminasm.org
  16. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  17. */
  18. class MaterializedPathRepository extends AbstractTreeRepository
  19. {
  20. /**
  21. * {@inheritdoc}
  22. */
  23. protected function validate()
  24. {
  25. return $this->listener->getStrategy($this->dm, $this->getClassMetadata()->name)->getName() === Strategy::MATERIALIZED_PATH;
  26. }
  27. }