Class

eZ\Publish\Core\Limitation\LanguageLimitationType

class LanguageLimitationType extends AbstractPersistenceLimitationType implements Type

LanguageLimitation is a Content limitation.

Methods

__construct(Handler $persistence)

from AbstractPersistenceLimitationType
acceptValue(Limitation $limitationValue)

Accepts a Limitation value and checks for structural validity.

ValidationError[] validate(Limitation $limitationValue)

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

Limitation buildValue(array $limitationValues)

Create the Limitation Value.

bool evaluate(Limitation $value, UserReference $currentUser, ValueObject $object, array $targets = null)

Evaluate permission against content & target(placement/parent/assignment).

CriterionInterface getCriterion(Limitation $value, UserReference $currentUser)

Returns Criterion for use in find() query.

mixed[]|int valueSchema()

Returns info on valid $limitationValues.

Details

public __construct(Handler $persistence)

Parameters

Handler $persistence

at line 40
public acceptValue(Limitation $limitationValue)

Accepts a Limitation value and checks for structural validity.

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

Parameters

Limitation $limitationValue

Exceptions

InvalidArgumentException If the value does not match the expected type/structure

at line 64
public ValidationError[] validate(Limitation $limitationValue)

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

Make sure {@link acceptValue()} is checked first!

Parameters

Limitation $limitationValue

Return Value

ValidationError[]

at line 92
public Limitation buildValue(array $limitationValues)

Create the Limitation Value.

Parameters

array $limitationValues

Return Value

Limitation

at line 112
public bool evaluate(Limitation $value, UserReference $currentUser, ValueObject $object, array $targets = null)

Evaluate permission against content & target(placement/parent/assignment).

Parameters

Limitation $value
UserReference $currentUser
ValueObject $object
array $targets The context of the $object, like Location of Content, if null none where provided by caller

Return Value

bool Returns one of ACCESS_* constants

Exceptions

InvalidArgumentException If any of the arguments are invalid Example: If LimitationValue is instance of ContentTypeLimitationValue, and Type is SectionLimitationType.
BadStateException If value of the LimitationValue is unsupported Example if OwnerLimitationValue->limitationValues[0] is not one of: [ 1, 2 ]

at line 158
public CriterionInterface getCriterion(Limitation $value, UserReference $currentUser)

Returns Criterion for use in find() query.

Parameters

Limitation $value
UserReference $currentUser

Return Value

CriterionInterface

at line 180
public mixed[]|int valueSchema()

Returns info on valid $limitationValues.

Return Value

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 VALUESCHEMA constants.