protected function addParentCondition(IMetaModelDataDefinition $container, $definition)
{
$inputScreen = $this->getInputScreenDetails();
if ($inputScreen->isStandalone()) {
return;
}
$setter = array(array('to_field' => 'pid', 'from_field' => 'id'));
$inverse = array();
/** @var ParentChildConditionInterface $relationship */
$relationship = $definition->getChildCondition($inputScreen->getParentTable(), $container->getName());
if (!$relationship instanceof ParentChildConditionInterface) {
$relationship = new ParentChildCondition();
$relationship->setSourceName($inputScreen->getParentTable())->setDestinationName($container->getName());
$definition->addChildCondition($relationship);
} else {
$setter = array_merge_recursive($setter, $relationship->getSetters());
$inverse = array_merge_recursive($inverse, $relationship->getInverseFilterArray());
}
// For tl_ prefix, the only unique target can be the id?
// maybe load parent dc and scan for unique in config then.
$relationship->setFilterArray(FilterBuilder::fromArray($relationship->getFilterArray())->getFilter()->andRemotePropertyEquals('pid', 'id')->getAllAsArray())->setSetters($setter)->setInverseFilterArray($inverse);
}