/** * translates an generated alias {@see TableMetaModelFilterSetting::getAttributeNames()} * to the corresponding attribute id. * * @param string $strValue the id to translate. * * @param DataContainer $objDC the data container calling. * * @return int */ public function nameToAttrId($strValue, $objDC) { $this->objectsFromUrl($objDC); if (!$this->objMetaModel) { return 0; } $strName = str_replace($this->objMetaModel->getTableName() . '_', '', $strValue); $objAttribute = $this->objMetaModel->getAttribute($strName); if (!$objAttribute) { return 0; } return $objAttribute->get('id'); }
/** * Check if the attribute exists in the table and holds a value. * * @param string $strField the name of the attribute that shall be tested. * * @return boolean */ public function fieldExists($strField) { return !!(in_array($strField, array('id', 'pid', 'tstamp', 'sorting')) || $this->objMetaModel->getAttribute($strField)); }