/** * Returns the LimitationType registered with the given identifier. * * @param string $identifier * * @return \eZ\Publish\SPI\Limitation\Type * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if there is no LimitationType with $identifier */ public function getLimitationType($identifier) { return $this->service->getLimitationType($identifier); }
/** * Create a new Limitation object based on the type and value in the $limitation array. * * <pre> * $limitation = array( * 'identifier' => Type of the limitation * 'values' => array(Values to base the limitation on) * ) * </pre> * * @param \eZ\Publish\API\Repository\RoleService $roleService * @param array $limitation * @return \eZ\Publish\API\Repository\Values\User\Limitation */ private function createLimitation(RoleService $roleService, array $limitation) { $limitationType = $roleService->getLimitationType($limitation['identifier']); $limitationValue = is_array($limitation['values']) ? $limitation['values'] : array($limitation['values']); foreach ($limitationValue as $id => $value) { $limitationValue[$id] = $this->referenceResolver->resolveReference($value); } $limitationValue = $this->limitationConverter->resolveLimitationValue($limitation['identifier'], $limitationValue); return $limitationType->buildValue($limitationValue); }