setRule example


    public function check($value$rules, array $errors = []$dbGroup = null): bool
    {
        $this->reset();

        return $this->setRule(
            'check',
            null,
            $rules,
            $errors
        )->run(
            ['check' => $value],
            null,
            $dbGroup
        );
    }

    
$product->setCheapestPriceRule($rule);

                $this->priceCalculationService->calculateProduct($product$context);

                $priceObj = $product->getCheapestUnitPrice();

                if ($this->config->get('calculateCheapestPriceWithMinPurchase')) {
                    $priceObj = $product->getCheapestPrice();
                }

                if ($priceObj) {
                    $priceObj->setRule(null);

                    $prices[$number][$key] = $priceObj;
                }
            }
        }

        return $prices;
    }

    /** * @param string[] $customerGroups * @param int[] $currencies */

    public function allow($roles = null, $resources = null, $privileges = null, Zend_Acl_Assert_Interface $assert = null)
    {
        return $this->setRule(self::OP_ADD, self::TYPE_ALLOW, $roles$resources$privileges$assert);
    }

    /** * Adds a "deny" rule to the ACL * * @param Zend_Acl_Role_Interface|string|array $roles * @param Zend_Acl_Resource_Interface|string|array $resources * @param string|array $privileges * @param Zend_Acl_Assert_Interface $assert * @uses Zend_Acl::setRule() * @return Zend_Acl Provides a fluent interface */
Home | Imprint | This part of the site doesn't use cookies.