yii\helpers\BaseArrayHelper::isSubset PHP Метод

isSubset() публичный статический Метод

This method will return true, if all elements of $needles are contained in $haystack. If at least one element is missing, false will be returned.
С версии: 2.0.7
public static isSubset ( array | Traversable $needles, array | Traversable $haystack, boolean $strict = false ) : boolean
$needles array | Traversable The values that must **all** be in `$haystack`.
$haystack array | Traversable The set of value to search.
$strict boolean Whether to enable strict (`===`) comparison.
Результат boolean `true` if `$needles` is a subset of `$haystack`, `false` otherwise.
    public static function isSubset($needles, $haystack, $strict = false)
    {
        if (is_array($needles) || $needles instanceof \Traversable) {
            foreach ($needles as $needle) {
                if (!static::isIn($needle, $haystack, $strict)) {
                    return false;
                }
            }
            return true;
        } else {
            throw new InvalidParamException('Argument $needles must be an array or implement Traversable');
        }
    }