/**
  * {@inheritdoc}
  */
 public function process(ContextInterface $context)
 {
     /** @var ConfigContext $context */
     $maxRelatedEntities = $context->getMaxRelatedEntities();
     if (null === $maxRelatedEntities || $maxRelatedEntities < 0) {
         // there is no limit to the number of related entities
         return;
     }
     $definition = $context->getResult();
     if (empty($definition)) {
         // nothing to update
         return;
     }
     $entityClass = $context->getClassName();
     if (!$this->doctrineHelper->isManageableEntityClass($entityClass)) {
         // only manageable entities are supported
         return;
     }
     $this->setLimits($definition, $entityClass, $maxRelatedEntities);
     $context->setResult($definition);
 }