public function getAttributeOptions(GetPropertyOptionsEvent $event)
{
if ($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_dcasetting_condition' || $event->getPropertyName() !== 'attr_id') {
return;
}
$result = array();
$metaModel = $this->getMetaModel($event->getEnvironment());
$conditionType = $event->getModel()->getProperty('type');
$allowedAttributes = $GLOBALS['METAMODELS']['inputscreen_conditions'][$conditionType]['attributes'];
foreach ($metaModel->getAttributes() as $attribute) {
if (is_array($allowedAttributes) && !in_array($attribute->get('type'), $allowedAttributes)) {
continue;
}
$typeName = $attribute->get('type');
$strSelectVal = $metaModel->getTableName() . '_' . $attribute->getColName();
$result[$strSelectVal] = $attribute->getName() . ' [' . $typeName . ']';
}
$event->setOptions($result);
}