protected function processExposeDepth(&$fields, $class, EntityManagerRegistry $emr, $depth = 0, $fetchType = null)
{
$this->registered_expose_classes[] = $class;
if ($depth > 0) {
/** @var \Doctrine\ORM\Mapping\ClassMetaData $metaData */
$metaData = $emr->getManagerForClass($class)->getClassMetadata($class);
$fields = $metaData->getColumnNames();
if ($depth - 1 > 0) {
--$depth;
foreach ($metaData->getAssociationMappings() as $key => $assocMapping) {
if (!in_array($assocMapping['targetEntity'], $this->registered_expose_classes) && (is_null($fetchType) || $assocMapping['fetch'] == $fetchType)) {
$this->processExposeDepth($fields[$key], $assocMapping['targetEntity'], $emr, $depth, $fetchType);
}
}
}
}
}