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

Public Member Functions | Private Member Functions | Private Attributes | List of all members
eZ\Publish\Core\Limitation\LanguageLimitationType Class Reference

LanguageLimitation is a Content limitation. More...

Inheritance diagram for eZ\Publish\Core\Limitation\LanguageLimitationType:

## Public Member Functions
| __construct (SPIPersistenceLanguageHandler $persistenceLanguageHandler, SPIPersistenceContentHandler $persistenceContentHandler, iterable $versionTargetEvaluators)
| acceptValue (APILimitationValue $limitationValue)
| Accepts a Limitation value and checks for structural validity. More...
| validate (APILimitationValue $limitationValue)
| Makes sure every language code defined as limitation exists. More...
| buildValue (array $limitationValues)
| Create the Limitation Value. More...
| evaluate (APILimitationValue $value, APIUserReference $currentUser, ValueObject $object, array $targets=null)
| Evaluate permission against content & target. More...
| getCriterion (APILimitationValue $value, APIUserReference $currentUser)
| Returns Criterion for use in find() query. More...
| valueSchema ()
| For LanguageLimitationType it returns an empty array because schema is not deterministic. More...
Public Member Functions inherited from eZ\Publish\SPI\Limitation\TargetAwareType
| evaluate (APILimitationValue $value, APIUserReference $currentUser, APIValueObject $object, array $targets=null)
| Evaluate ("Vote") against a main value object and targets for the context. More...

## Private Member Functions
| evaluateObject (ValueObject $object, APILimitationValue $value)
| evaluateContentCreateStruct (ContentCreateStruct $object, APILimitationValue $value)
| Evaluate language codes of allowed translations for ContentCreateStruct. More...
| evaluateVersionTarget (Target\Version $version, APILimitationValue $value)
| Evaluate permissions to create new Version. More...
| getAllLanguageCodesFromCreateStruct (ContentCreateStruct $contentCreateStruct)
| Get unique list of language codes for all used translations, including mainLanguageCode. More...

## Private Attributes
| $persistenceLanguageHandler
| $persistenceContentHandler
| $versionTargetEvaluators

## Additional Inherited Members
Public Attributes inherited from eZ\Publish\SPI\Limitation\Type
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

LanguageLimitation is a Content limitation.

Definition at line 34 of file LanguageLimitationType.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Limitation\LanguageLimitationType::__construct | ( | SPIPersistenceLanguageHandler | $persistenceLanguageHandler,
|  | SPIPersistenceContentHandler | $persistenceContentHandler,
|  | iterable | $versionTargetEvaluators
| ) |  |

Parameters

  \eZ\Publish\SPI\Persistence\Content\Language\Handler | $persistenceLanguageHandler |
  \eZ\Publish\SPI\Persistence\Content\Handler | $persistenceContentHandler |
  \eZ\Publish\Core\Limitation\LanguageLimitation\VersionTargetEvaluator[] | $versionTargetEvaluators |

Definition at line 50 of file LanguageLimitationType.php.

References eZ\Publish\Core\Limitation\LanguageLimitationType\$persistenceContentHandler, eZ\Publish\Core\Limitation\LanguageLimitationType\$persistenceLanguageHandler, and eZ\Publish\Core\Limitation\LanguageLimitationType\$versionTargetEvaluators.

## Member Function Documentation

## ◆ acceptValue()

eZ\Publish\Core\Limitation\LanguageLimitationType::acceptValue | ( | APILimitationValue | $limitationValue | ) |

Accepts a Limitation value and checks for structural validity.

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

Parameters

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

Exceptions

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 69 of file LanguageLimitationType.php.

## ◆ buildValue()

eZ\Publish\Core\Limitation\LanguageLimitationType::buildValue | ( | array | $limitationValues | ) |

Create the Limitation Value.

Parameters

  array[] | $limitationValues |

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

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 135 of file LanguageLimitationType.php.

## ◆ evaluate()

eZ\Publish\Core\Limitation\LanguageLimitationType::evaluate | ( | APILimitationValue | $value,
|  | APIUserReference | $currentUser,
|  | ValueObject | $object,
|  | array | $targets = `null`
| ) |  |

Evaluate permission against content & target.

{}

Definition at line 145 of file LanguageLimitationType.php.

## ◆ evaluateContentCreateStruct()

eZ\Publish\Core\Limitation\LanguageLimitationType::evaluateContentCreateStruct | ( | ContentCreateStruct | $object,
|  | APILimitationValue | $value
| ) |  |
| private

Evaluate language codes of allowed translations for ContentCreateStruct.

Parameters

  \eZ\Publish\API\Repository\Values\Content\ContentCreateStruct | $object |
  \eZ\Publish\API\Repository\Values\User\Limitation | $value |

Returns
  bool|null

Definition at line 220 of file LanguageLimitationType.php.

## ◆ evaluateObject()

eZ\Publish\Core\Limitation\LanguageLimitationType::evaluateObject | ( | ValueObject | $object,
|  | APILimitationValue | $value
| ) |  |
| private

Parameters

  \eZ\Publish\API\Repository\Values\ValueObject | $object |
  \eZ\Publish\API\Repository\Values\User\Limitation | $value |

Returns
  bool|null

Definition at line 181 of file LanguageLimitationType.php.

## ◆ evaluateVersionTarget()

eZ\Publish\Core\Limitation\LanguageLimitationType::evaluateVersionTarget | ( | Target\Version | $version,
|  | APILimitationValue | $value
| ) |  |
| private

Evaluate permissions to create new Version.

Parameters

  \eZ\Publish\SPI\Limitation\Target\Version | $version |
  \eZ\Publish\API\Repository\Values\User\Limitation | $value |

Returns
  bool|null

Definition at line 240 of file LanguageLimitationType.php.

## ◆ getAllLanguageCodesFromCreateStruct()

eZ\Publish\Core\Limitation\LanguageLimitationType::getAllLanguageCodesFromCreateStruct | ( | ContentCreateStruct | $contentCreateStruct | ) |
| private

Get unique list of language codes for all used translations, including mainLanguageCode.

Parameters

  \eZ\Publish\API\Repository\Values\Content\ContentCreateStruct | $contentCreateStruct |

Returns
  string[]

Definition at line 265 of file LanguageLimitationType.php.

## ◆ getCriterion()

eZ\Publish\Core\Limitation\LanguageLimitationType::getCriterion | ( | APILimitationValue | $value,
|  | APIUserReference | $currentUser
| ) |  |

Returns Criterion for use in find() query.

Parameters

  \eZ\Publish\API\Repository\Values\User\Limitation | $value |
  \eZ\Publish\API\Repository\Values\User\UserReference | $currentUser |

Returns
  \eZ\Publish\API\Repository\Values\Content\Query\CriterionInterface

Exceptions

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 286 of file LanguageLimitationType.php.

## ◆ validate()

eZ\Publish\Core\Limitation\LanguageLimitationType::validate | ( | APILimitationValue | $limitationValue | ) |

Makes sure every language code defined as limitation exists.

Make sure acceptValue() is checked first!

Parameters

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

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

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 105 of file LanguageLimitationType.php.

## ◆ valueSchema()

eZ\Publish\Core\Limitation\LanguageLimitationType::valueSchema | ( |  | ) |

For LanguageLimitationType it returns an empty array because schema is not deterministic.

See also
  validate for business logic.

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 307 of file LanguageLimitationType.php.

## Member Data Documentation

## ◆ $persistenceContentHandler

eZ\Publish\Core\Limitation\LanguageLimitationType::$persistenceContentHandler
| private

Definition at line 40 of file LanguageLimitationType.php.

Referenced by eZ\Publish\Core\Limitation\LanguageLimitationType\__construct().

## ◆ $persistenceLanguageHandler

eZ\Publish\Core\Limitation\LanguageLimitationType::$persistenceLanguageHandler
| private

Definition at line 37 of file LanguageLimitationType.php.

Referenced by eZ\Publish\Core\Limitation\LanguageLimitationType\__construct().

## ◆ $versionTargetEvaluators

eZ\Publish\Core\Limitation\LanguageLimitationType::$versionTargetEvaluators
| private

Definition at line 43 of file LanguageLimitationType.php.

Referenced by eZ\Publish\Core\Limitation\LanguageLimitationType\__construct().

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

- LanguageLimitationType.php

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