protected function resolveValue($value)
{
$identifier = null;
if (is_array($value) && isset($value['__identity'])) {
$identifier = $value['__identity'];
} elseif ($value instanceof $this->objectType) {
$identifier = $this->persistenceManager->getIdentifierByObject($value);
}
if ($identifier === null || !is_string($identifier) && !is_integer($identifier)) {
return false;
}
$pathSegment = $this->getPathSegmentByIdentifier($identifier);
if ($pathSegment === null) {
return false;
}
$this->value = $pathSegment;
return true;
}