eZ\Publish\Core\Limitation\LocationLimitationType::evaluateForContentCreateStruct PHP Метод

evaluateForContentCreateStruct() защищенный Метод

Evaluate permissions for ContentCreateStruct against LocationCreateStruct placements.
protected evaluateForContentCreateStruct ( eZ\Publish\API\Repository\Values\User\Limitation $value, array $targets = null ) : boolean
$value eZ\Publish\API\Repository\Values\User\Limitation
$targets array
Результат boolean
    protected function evaluateForContentCreateStruct(APILimitationValue $value, array $targets = null)
    {
        // If targets is empty/null return false as user does not have access
        // to content w/o location with this limitation
        if (empty($targets)) {
            return false;
        }
        foreach ($targets as $target) {
            if (!$target instanceof LocationCreateStruct) {
                throw new InvalidArgumentException('$targets', 'If $object is ContentCreateStruct must contain objects of type: LocationCreateStruct');
            }
            // For ContentCreateStruct all placements must match
            if (!in_array($target->parentLocationId, $value->limitationValues)) {
                return false;
            }
        }
        return true;
    }