private function getterPrimaryProxy($value = null, PropertyMetadata $metadata)
{
if ($this->persistedId !== null) {
return $this->persistedId;
} elseif (!$metadata->isVirtual) {
return $value;
}
$id = [];
$keys = $this->getMetadata()->getPrimaryKey();
foreach ($keys as $key) {
$id[] = $value = $this->getRawValue($key);
}
if (count($keys) === 1) {
return $id[0];
} else {
return $id;
}
}