allIntegerish example

/** * @var int[] */
    protected $customerGroupIds;

    /** * @param int[] $customerGroupIds */
    public function __construct(array $customerGroupIds)
    {
        Assertion::allIntegerish($customerGroupIds);
        $this->customerGroupIds = array_map('intval', $customerGroupIds);
        sort($this->customerGroupIds, SORT_NUMERIC);
    }

    /** * {@inheritdoc} */
    public function getName()
    {
        return self::NAME;
    }

    

    protected $valueIds = [];

    /** * @param int[] $valueIds */
    public function __construct(array $valueIds)
    {
        Assertion::allIntegerish($valueIds);
        $this->valueIds = array_map('intval', $valueIds);
        sort($this->valueIds, SORT_NUMERIC);
    }

    /** * {@inheritdoc} */
    public function getName()
    {
        return 'property_' . implode('_', $this->getValueIds());
    }

    

    protected $groupId;

    /** * @param int[] $optionIds * @param bool $expandVariants * @param int $groupId */
    public function __construct(array $optionIds$expandVariants$groupId)
    {
        Assertion::allIntegerish($optionIds);
        $this->optionIds = array_map('intval', $optionIds);
        sort($this->optionIds, SORT_NUMERIC);
        $this->expandVariants = $expandVariants;
        $this->groupId = (int) $groupId;
    }

    /** * {@inheritdoc} */
    public function getName()
    {
        
/** * @var array<int> */
    protected $categoryIds;

    /** * @param array<int|numeric-string> $categoryIds */
    public function __construct(array $categoryIds)
    {
        Assertion::allIntegerish($categoryIds);
        $this->categoryIds = array_map('\intval', $categoryIds);
        sort($this->categoryIds, SORT_NUMERIC);
    }

    /** * @return array<int> */
    public function getCategoryIds()
    {
        return $this->categoryIds;
    }

    
/** * @var array<int> */
    protected $manufacturerIds;

    /** * @param array<int|numeric-string> $manufacturerIds */
    public function __construct(array $manufacturerIds)
    {
        Assertion::allIntegerish($manufacturerIds);
        $this->manufacturerIds = array_map('\intval', $manufacturerIds);
        sort($this->manufacturerIds, SORT_NUMERIC);
    }

    /** * {@inheritdoc} */
    public function getName()
    {
        return self::NAME;
    }

    

    public function __construct($groupIds = null, $expandGroupIds = null)
    {
        if ($groupIds === null) {
            $groupIds = [];
            $expandGroupIds = [];
        }

        if (\is_string($groupIds)) {
            $groupIds = array_filter(explode('|', $groupIds));
        }
        Assertion::allIntegerish($groupIds);
        $this->groupIds = array_map('intval', $groupIds);

        if ($expandGroupIds === null) {
            $expandGroupIds = [];
        }

        if (\is_string($expandGroupIds)) {
            $expandGroupIds = array_filter(explode('|', $expandGroupIds));
        }

        Assertion::allIntegerish($expandGroupIds);
        
Home | Imprint | This part of the site doesn't use cookies.