public function evaluate(APILimitationValue $value, APIUserReference $currentUser, ValueObject $object, array $targets = null)
{
if (!$value instanceof APIStatusLimitation) {
throw new InvalidArgumentException('$value', 'Must be of type: APIStatusLimitation');
}
if ($object instanceof Content) {
$object = $object->getVersionInfo();
} elseif (!$object instanceof VersionInfo) {
throw new InvalidArgumentException('$object', 'Must be of type: Content or VersionInfo');
}
if (empty($value->limitationValues)) {
return false;
}
/*
* @var $object \eZ\Publish\API\Repository\Values\Content\VersionInfo
*/
return in_array($object->status, $value->limitationValues);
}