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

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

ObjectStateLimitation is a Content limitation. More...

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

## 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, ValueObject $object, array $targets=null)
| Evaluate permission against content & target(placement/parent/assignment). More...
| getCriterion (APILimitationValue $value, APIUserReference $currentUser)
| Returns Criterion for use in find() query. More...
| valueSchema ()
Public Member Functions inherited from eZ\Publish\Core\Limitation\AbstractPersistenceLimitationType
| __construct (SPIPersistenceHandler $persistence)
Public Member Functions inherited from 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. More...

## Private Member Functions
| isStateGroupUsedForLimitation ($stateGroupId, array $limitationValues)
| Checks if the State Group contains at least one State that is used by Limitation. More...
| areObjectStatesMatchingTheLimitation (array $objectStateIds, array $limitationValues)
| Verifies if all the Object States are matching the Limitation Values. More...
| groupLimitationValues (array $limitationValues)
| Groups limitation values by the State Group. More...
| getContentInfo (ValueObject $object)
| getObjectStateIdsForContentCreate (Handler $objectStateHandler, array $limitationValues)
| getDefaultStateId (array $states, Group $stateGroup)
| getObjectStateIdsToVerify (Handler $objectStateHandler, ContentInfo $object, array $limitationValues)

## 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
Protected Attributes inherited from eZ\Publish\Core\Limitation\AbstractPersistenceLimitationType
| $persistence

## Detailed Description

ObjectStateLimitation is a Content limitation.

Definition at line 32 of file ObjectStateLimitationType.php.

## Member Function Documentation

## ◆ acceptValue()

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

Accepts a Limitation value and checks for structural validity.

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

Exceptions

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 43 of file ObjectStateLimitationType.php.

## ◆ areObjectStatesMatchingTheLimitation()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::areObjectStatesMatchingTheLimitation | ( | array | $objectStateIds,
|  | array | $limitationValues
| ) |  |
| private

Verifies if all the Object States are matching the Limitation Values.

Parameters

  int[] | $objectStateIds |
  string[] | $limitationValues |

Returns
  bool

Definition at line 188 of file ObjectStateLimitationType.php.

Referenced by eZ\Publish\Core\Limitation\ObjectStateLimitationType\evaluate().

## ◆ buildValue()

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

Create the Limitation Value.

Parameters

  mixed[] | $limitationValues |

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

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 97 of file ObjectStateLimitationType.php.

## ◆ evaluate()

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

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

Exceptions

Definition at line 117 of file ObjectStateLimitationType.php.

References eZ\Publish\Core\Limitation\ObjectStateLimitationType\areObjectStatesMatchingTheLimitation(), eZ\Publish\Core\Limitation\ObjectStateLimitationType\getContentInfo(), eZ\Publish\Core\Limitation\ObjectStateLimitationType\getObjectStateIdsForContentCreate(), and eZ\Publish\Core\Limitation\ObjectStateLimitationType\getObjectStateIdsToVerify().

## ◆ getContentInfo()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::getContentInfo | ( | ValueObject | $object | ) |
| private

Exceptions

Definition at line 274 of file ObjectStateLimitationType.php.

Referenced by eZ\Publish\Core\Limitation\ObjectStateLimitationType\evaluate().

## ◆ getCriterion()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::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|\eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOperator

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 209 of file ObjectStateLimitationType.php.

## ◆ getDefaultStateId()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::getDefaultStateId | ( | array | $states,
|  | Group | $stateGroup
| ) |  |
| private

Parameters

  \eZ\Publish\SPI\Persistence\Content\ObjectState[] | $states |

Exceptions

Definition at line 327 of file ObjectStateLimitationType.php.

## ◆ getObjectStateIdsForContentCreate()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::getObjectStateIdsForContentCreate | ( | Handler | $objectStateHandler,
|  | array | $limitationValues
| ) |  |
| private

Parameters

  int[] | $limitationValues | Limitation Object State IDs

Returns
  int[] Object State IDs to verify

Exceptions

Definition at line 297 of file ObjectStateLimitationType.php.

References eZ\Publish\SPI\Persistence\Content\ObjectState\Handler\loadObjectStates().

Referenced by eZ\Publish\Core\Limitation\ObjectStateLimitationType\evaluate().

## ◆ getObjectStateIdsToVerify()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::getObjectStateIdsToVerify | ( | Handler | $objectStateHandler,
|  | ContentInfo | $object,
|  | array | $limitationValues
| ) |  |
| private

Definition at line 348 of file ObjectStateLimitationType.php.

References eZ\Publish\SPI\Persistence\Content\ObjectState\Handler\getContentState().

Referenced by eZ\Publish\Core\Limitation\ObjectStateLimitationType\evaluate().

## ◆ groupLimitationValues()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::groupLimitationValues | ( | array | $limitationValues | ) |
| private

Groups limitation values by the State Group.

Parameters

  string[] | $limitationValues |

Returns
  int[][]

Definition at line 244 of file ObjectStateLimitationType.php.

## ◆ isStateGroupUsedForLimitation()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::isStateGroupUsedForLimitation | ( |  | $stateGroupId,
|  | array | $limitationValues
| ) |  |
| private

Checks if the State Group contains at least one State that is used by Limitation.

Parameters

  int | $stateGroupId |
  string[] | $limitationValues |

Returns
  bool

Definition at line 165 of file ObjectStateLimitationType.php.

## ◆ validate()

eZ\Publish\Core\Limitation\ObjectStateLimitationType::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[]

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 69 of file ObjectStateLimitationType.php.

## ◆ valueSchema()

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

Exceptions

Implements eZ\Publish\SPI\Limitation\Type.

Definition at line 266 of file ObjectStateLimitationType.php.

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

- ObjectStateLimitationType.php

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