public function castEmbeddedArrays()
{
$annotation = $this->getProperty('annotation');
if (!$annotation) {
throw new Exception("Cannot cast a collection using a caster without an associated annotation object");
}
$listType = $annotation->getCast();
if ($listType == "link") {
return $this->getHydrator()->hydrateCollection($this->value);
}
try {
return $this->castArrayOf($listType);
} catch (Exception $exception) {
$message = "It seems like you are trying to hydrate an embedded property without specifying its type.\n" . "Please add the 'cast' (eg cast='boolean') to the annotation.";
throw new Exception($message, null, $exception);
}
}