vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/PricingManager/Rule/Listing.php line 54

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\Rule;
  15. use Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\Rule;
  16. use Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\RuleInterface;
  17. /**
  18.  * @method Rule[] load()
  19.  * @method Rule|false current()
  20.  * @method \Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\Rule\Listing\Dao getDao()
  21.  */
  22. class Listing extends \Pimcore\Model\Listing\AbstractListing
  23. {
  24.     /**
  25.      * @var bool
  26.      */
  27.     protected $validate;
  28.     /**
  29.      * @param bool $state
  30.      */
  31.     public function setValidation($state)
  32.     {
  33.         $this->validate = (bool)$state;
  34.     }
  35.     /**
  36.      * @param string $key
  37.      *
  38.      * @return bool
  39.      */
  40.     public function isValidOrderKey($key)
  41.     {
  42.         return in_array($key, ['prio''name']);
  43.     }
  44.     /**
  45.      * @return RuleInterface[]
  46.      */
  47.     public function getRules()
  48.     {
  49.         return $this->getData();
  50.     }
  51.     /**
  52.      * @param RuleInterface[] $rules
  53.      *
  54.      * @return $this
  55.      */
  56.     public function setRules(array $rules)
  57.     {
  58.         return $this->setData($rules);
  59.     }
  60. }