Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZ\Publish\SPI\Limitation\Type Interface Reference

This interface represent the Limitation Type. More...

Inheritance diagram for eZ\Publish\SPI\Limitation\Type:

## Public Member Functions
| acceptValue (APILimitationValue $limitationValue)
| Accepts a Limitation value and checks for structural validity. More...
| validate (APILimitationValue $limitationValue)
| Makes sure LimitationValue->limitationValues is valid according to valueSchema(). More...
| buildValue (array $limitationValues)
| Create the Limitation Value. More...
| evaluate (APILimitationValue $value, APIUserReference $currentUser, APIValueObject $object, array $targets=null)
| Evaluate ("Vote") against a main value object and targets for the context. More...
| getCriterion (APILimitationValue $value, APIUserReference $currentUser)
| Returns Criterion for use in find() query. More...
| valueSchema ()
| Returns info on valid $limitationValues. More...

## Public Attributes
const | ACCESS_GRANTED = true
| Constants for return value of {. More...
const | ACCESS_ABSTAIN = null
const | ACCESS_DENIED = false
const | VALUE_SCHEMA_LOCATION_ID = 1
| Constants for valueSchema() return values. More...
const | VALUE_SCHEMA_LOCATION_PATH = 2

## Detailed Description

This interface represent the Limitation Type.

A Limitation is a lot like a Symfony voter, telling the permission system if user has access or not. It consists of a Limitation Value which is persisted, and this Limitation Type which contains the business logic for evaluate ("vote"), as well as accepting and validating the Value object and to generate criteria for content/location searches.

Definition at line 21 of file SPI/Limitation/Type.php.

## Member Function Documentation

## ◆ acceptValue()

eZ\Publish\SPI\Limitation\Type::acceptValue | ( | APILimitationValue | $limitationValue | ) |

Accepts a Limitation value and checks for structural validity.

Makes sure LimitationValue object and ->limitationValues is of correct type.

Exceptions

Implemented in Ibexa\Core\Limitation\RoleLimitationType, Ibexa\Core\Limitation\MemberOfLimitationType, eZ\Publish\Core\Limitation\UserGroupLimitationType, eZ\Publish\Core\Limitation\SubtreeLimitationType, eZ\Publish\Core\Limitation\StatusLimitationType, eZ\Publish\Core\Limitation\SiteAccessLimitationType, eZ\Publish\Core\Limitation\SectionLimitationType, eZ\Publish\Core\Limitation\ParentUserGroupLimitationType, eZ\Publish\Core\Limitation\ParentOwnerLimitationType, eZ\Publish\Core\Limitation\ParentDepthLimitationType, eZ\Publish\Core\Limitation\ParentContentTypeLimitationType, eZ\Publish\Core\Limitation\OwnerLimitationType, eZ\Publish\Core\Limitation\ObjectStateLimitationType, eZ\Publish\Core\Limitation\NewSectionLimitationType, eZ\Publish\Core\Limitation\NewObjectStateLimitationType, eZ\Publish\Core\Limitation\LocationLimitationType, eZ\Publish\Core\Limitation\LanguageLimitationType, eZ\Publish\Core\Limitation\ContentTypeLimitationType, and eZ\Publish\Core\Limitation\BlockingLimitationType.

## ◆ buildValue()

eZ\Publish\SPI\Limitation\Type::buildValue | ( | array | $limitationValues | ) |

Create the Limitation Value.

The is the method to create values as Limitation type needs value knowledge anyway in acceptValue, the reverse relation is provided by means of identifier lookup (Value has identifier, and so does RoleService).

Parameters

  mixed[] | $limitationValues |

Returns
  \eZ\Publish\API\Repository\Values\User\Limitation

Implemented in Ibexa\Core\Limitation\RoleLimitationType, Ibexa\Core\Limitation\MemberOfLimitationType, eZ\Publish\Core\Limitation\UserGroupLimitationType, eZ\Publish\Core\Limitation\SubtreeLimitationType, eZ\Publish\Core\Limitation\StatusLimitationType, eZ\Publish\Core\Limitation\SiteAccessLimitationType, eZ\Publish\Core\Limitation\SectionLimitationType, eZ\Publish\Core\Limitation\ParentUserGroupLimitationType, eZ\Publish\Core\Limitation\ParentOwnerLimitationType, eZ\Publish\Core\Limitation\ParentDepthLimitationType, eZ\Publish\Core\Limitation\ParentContentTypeLimitationType, eZ\Publish\Core\Limitation\OwnerLimitationType, eZ\Publish\Core\Limitation\ObjectStateLimitationType, eZ\Publish\Core\Limitation\NewSectionLimitationType, eZ\Publish\Core\Limitation\NewObjectStateLimitationType, eZ\Publish\Core\Limitation\LocationLimitationType, eZ\Publish\Core\Limitation\LanguageLimitationType, eZ\Publish\Core\Limitation\ContentTypeLimitationType, and eZ\Publish\Core\Limitation\BlockingLimitationType.

## ◆ evaluate()

eZ\Publish\SPI\Limitation\Type::evaluate | ( | APILimitationValue | $value,
|  | APIUserReference | $currentUser,
|  | APIValueObject | $object,
|  | array | $targets = `null`
| ) |  |

Evaluate ("Vote") against a main value object and targets for the context.

Exceptions

Implemented in eZ\Publish\SPI\Limitation\TargetAwareType.

## ◆ getCriterion()

eZ\Publish\SPI\Limitation\Type::getCriterion | ( | APILimitationValue | $value,
|  | APIUserReference | $currentUser
| ) |  |

Returns Criterion for use in find() query.

Exceptions

Implemented in Ibexa\Core\Limitation\RoleLimitationType, Ibexa\Core\Limitation\MemberOfLimitationType, eZ\Publish\Core\Limitation\UserGroupLimitationType, eZ\Publish\Core\Limitation\SubtreeLimitationType, eZ\Publish\Core\Limitation\StatusLimitationType, eZ\Publish\Core\Limitation\SiteAccessLimitationType, eZ\Publish\Core\Limitation\SectionLimitationType, eZ\Publish\Core\Limitation\ParentUserGroupLimitationType, eZ\Publish\Core\Limitation\ParentOwnerLimitationType, eZ\Publish\Core\Limitation\ParentDepthLimitationType, eZ\Publish\Core\Limitation\ParentContentTypeLimitationType, eZ\Publish\Core\Limitation\OwnerLimitationType, eZ\Publish\Core\Limitation\ObjectStateLimitationType, eZ\Publish\Core\Limitation\NewSectionLimitationType, eZ\Publish\Core\Limitation\NewObjectStateLimitationType, eZ\Publish\Core\Limitation\LocationLimitationType, eZ\Publish\Core\Limitation\LanguageLimitationType, eZ\Publish\Core\Limitation\ContentTypeLimitationType, and eZ\Publish\Core\Limitation\BlockingLimitationType.

## ◆ validate()

eZ\Publish\SPI\Limitation\Type::validate | ( | APILimitationValue | $limitationValue | ) |

Makes sure LimitationValue->limitationValues is valid according to valueSchema().

Make sure acceptValue() is checked first!

Parameters

  \eZ\Publish\API\Repository\Values\User\Limitation | $limitationValue |

Returns
  \eZ\Publish\SPI\FieldType\ValidationError[]

Implemented in Ibexa\Core\Limitation\RoleLimitationType, Ibexa\Core\Limitation\MemberOfLimitationType, eZ\Publish\Core\Limitation\UserGroupLimitationType, eZ\Publish\Core\Limitation\SubtreeLimitationType, eZ\Publish\Core\Limitation\StatusLimitationType, eZ\Publish\Core\Limitation\SiteAccessLimitationType, eZ\Publish\Core\Limitation\SectionLimitationType, eZ\Publish\Core\Limitation\ParentUserGroupLimitationType, eZ\Publish\Core\Limitation\ParentOwnerLimitationType, eZ\Publish\Core\Limitation\ParentDepthLimitationType, eZ\Publish\Core\Limitation\ParentContentTypeLimitationType, eZ\Publish\Core\Limitation\OwnerLimitationType, eZ\Publish\Core\Limitation\ObjectStateLimitationType, eZ\Publish\Core\Limitation\NewSectionLimitationType, eZ\Publish\Core\Limitation\NewObjectStateLimitationType, eZ\Publish\Core\Limitation\LocationLimitationType, eZ\Publish\Core\Limitation\LanguageLimitationType, eZ\Publish\Core\Limitation\ContentTypeLimitationType, and eZ\Publish\Core\Limitation\BlockingLimitationType.

## ◆ valueSchema()

eZ\Publish\SPI\Limitation\Type::valueSchema | ( |  | ) |

Returns info on valid $limitationValues.

Returns
  mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name of that option, in case of int on of VALUE_SCHEMA_* constants. Note: The hash might be an instance of Traversable, and not a native php array.

Implemented in Ibexa\Core\Limitation\RoleLimitationType, Ibexa\Core\Limitation\MemberOfLimitationType, eZ\Publish\Core\Limitation\UserGroupLimitationType, eZ\Publish\Core\Limitation\SubtreeLimitationType, eZ\Publish\Core\Limitation\StatusLimitationType, eZ\Publish\Core\Limitation\SiteAccessLimitationType, eZ\Publish\Core\Limitation\SectionLimitationType, eZ\Publish\Core\Limitation\ParentUserGroupLimitationType, eZ\Publish\Core\Limitation\ParentOwnerLimitationType, eZ\Publish\Core\Limitation\ParentDepthLimitationType, eZ\Publish\Core\Limitation\ParentContentTypeLimitationType, eZ\Publish\Core\Limitation\OwnerLimitationType, eZ\Publish\Core\Limitation\ObjectStateLimitationType, eZ\Publish\Core\Limitation\NewSectionLimitationType, eZ\Publish\Core\Limitation\NewObjectStateLimitationType, eZ\Publish\Core\Limitation\LocationLimitationType, eZ\Publish\Core\Limitation\LanguageLimitationType, eZ\Publish\Core\Limitation\ContentTypeLimitationType, and eZ\Publish\Core\Limitation\BlockingLimitationType.

## Member Data Documentation

## ◆ ACCESS_ABSTAIN

const eZ\Publish\SPI\Limitation\Type::ACCESS_ABSTAIN = null

Definition at line 34 of file SPI/Limitation/Type.php.

Referenced by eZ\Publish\Core\Limitation\SectionLimitationType\evaluate(), eZ\Publish\Core\Limitation\SubtreeLimitationType\evaluate(), Ibexa\Core\Limitation\MemberOfLimitationType\evaluate(), Ibexa\Core\Limitation\RoleLimitationType\evaluate(), and eZ\Publish\Core\Limitation\LanguageLimitation\VersionTranslationUpdateEvaluator\evaluate().

## ◆ ACCESS_DENIED

const eZ\Publish\SPI\Limitation\Type::ACCESS_DENIED = false

Definition at line 35 of file SPI/Limitation/Type.php.

Referenced by Ibexa\Core\Limitation\MemberOfLimitationType\evaluate(), Ibexa\Core\Limitation\RoleLimitationType\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\ContentDeleteEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\ContentTranslationEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\VersionPublishingEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\VersionTranslationUpdateEvaluator\evaluate(), and Ibexa\Core\Limitation\MemberOfLimitationType\evaluateUser().

## ◆ ACCESS_GRANTED

const eZ\Publish\SPI\Limitation\Type::ACCESS_GRANTED = true

Constants for return value of {.

See also
  evaluate()}.

Currently ACCESS_ABSTAIN must mean that evaluate does not support the provided $object or $targets, this is currently only supported by role limitations as policy limitations should not allow this.

Note: In future version constant values might change to 1, 0 and -1 as used in Symfony.

Since
  5.3.2

Definition at line 33 of file SPI/Limitation/Type.php.

Referenced by Ibexa\Core\Limitation\RoleLimitationType\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\ContentDeleteEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\ContentTranslationEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\NewDraftEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\VersionPublishingEvaluator\evaluate(), eZ\Publish\Core\Limitation\LanguageLimitation\VersionTranslationUpdateEvaluator\evaluate(), and Ibexa\Core\Limitation\MemberOfLimitationType\evaluateUser().

## ◆ VALUE_SCHEMA_LOCATION_ID

const eZ\Publish\SPI\Limitation\Type::VALUE_SCHEMA_LOCATION_ID = 1

Constants for valueSchema() return values.

Used in cases where a certain value is accepted but the options are to many to return as a hash of options. GUI should typically present option to browse content tree to select limitation value(s).

Definition at line 43 of file SPI/Limitation/Type.php.

Referenced by eZ\Publish\Core\Limitation\LocationLimitationType\valueSchema().

## ◆ VALUE_SCHEMA_LOCATION_PATH

const eZ\Publish\SPI\Limitation\Type::VALUE_SCHEMA_LOCATION_PATH = 2

Definition at line 44 of file SPI/Limitation/Type.php.

Referenced by eZ\Publish\Core\Limitation\SubtreeLimitationType\valueSchema().

The documentation for this interface was generated from the following file:

- SPI/Limitation/Type.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.