modelementpropertyset.class.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of MODX Revolution.
  4. *
  5. * Copyright (c) MODX, LLC. All Rights Reserved.
  6. *
  7. * For complete copyright and license information, see the COPYRIGHT and LICENSE
  8. * files found in the top-level directory of this distribution.
  9. */
  10. /**
  11. * Represents a modPropertySet relation to a specific modElement.
  12. *
  13. * @property int $element The ID of the Element referenced
  14. * @property string $element_class The class key of the Element referenced
  15. * @property int $property_set The ID of the property set being used
  16. *
  17. * @package modx
  18. * @extends xPDOObject
  19. */
  20. class modElementPropertySet extends xPDOObject {
  21. /**
  22. * Returns related modElement instances based on the element_class column.
  23. *
  24. * {@inheritdoc}
  25. */
  26. public function & getOne($alias, $criteria= null, $cacheFlag= true) {
  27. if ($alias == 'Element') {
  28. $criteria = $this->xpdo->newQuery($this->get('element_class'), $criteria);
  29. }
  30. $object = parent :: getOne($alias, $criteria, $cacheFlag);
  31. return $object;
  32. }
  33. }