![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/Api/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\Api; use Magento\Framework\Exception\InputException; use Magento\Framework\Phrase; /** * Groups two or more filters together using 'OR' or 'AND' strategy */ class CombinedFilterGroup extends AbstractSimpleObject { /** * Constants defined for keys of data array */ const FILTERS = 'filters'; const COMBINATION_MODE = 'combination_mode'; /** * Possible aggregation strategies for filters */ const COMBINED_WITH_AND = 'AND'; const COMBINED_WITH_OR = 'OR'; /** * Returns a list of filters in this group * * @return \Magento\Framework\Api\Filter[]|null */ public function getFilters() { $filters = $this->_get(self::FILTERS); return $filters === null ? [] : $filters; } /** * Set filters * * @param \Magento\Framework\Api\Filter[] $filters * @return $this * @codeCoverageIgnore */ public function setFilters(array $filters = null): self { return $this->setData(self::FILTERS, $filters); } /** * @return mixed|null */ public function getCombinationMode() { return $this->_get(self::COMBINATION_MODE); } /** * @param string $mode * @return $this * @throws InputException */ public function setCombinationMode(string $mode): self { if ($mode !== self::COMBINED_WITH_AND && $mode !== self::COMBINED_WITH_OR) { throw new InputException( new Phrase('Invalid combination mode: %1', [$mode]) ); } return $this->setData(self::COMBINATION_MODE, $mode); } }