protected function calculateConditions(IMetaModelDataDefinition $container)
{
if ($container->hasDefinition(ModelRelationshipDefinitionInterface::NAME)) {
$definition = $container->getDefinition(ModelRelationshipDefinitionInterface::NAME);
} else {
$definition = new DefaultModelRelationshipDefinition();
$container->setDefinition(ModelRelationshipDefinitionInterface::NAME, $definition);
}
if (!$definition instanceof ModelRelationshipDefinitionInterface) {
throw new \InvalidArgumentException('Search element does not implement the correct interface.');
}
if ($this->getMetaModel()->hasVariants()) {
$this->calculateConditionsWithVariants($container, $definition);
} else {
$this->calculateConditionsWithoutVariants($container, $definition);
}
}