protected function getRepositoryList($modelClass)
{
$modelReflection = new ClassType($modelClass);
$builder = $this->getContainerBuilder();
$builder->addDependency($modelReflection->getFileName());
$repositories = [];
foreach ($modelReflection->getAnnotations() as $key => $annotations) {
if ($key !== 'property-read') {
continue;
}
foreach ($annotations as $annotation) {
list($class, $name) = preg_split('#\\s+#', $annotation);
$class = AnnotationsParser::expandClassName($class, $modelReflection);
if (!class_exists($class)) {
throw new RuntimeException("Repository '{$class}' does not exist.");
}
$repositories[ltrim($name, '$')] = $class;
}
}
return $repositories;
}