src/CoreBundle/Contao/Hooks/AbstractContentElementAndModuleCallback.php
public function getAttributeNames(\DC_Table $objDc)
    {
        $attributeNames = [
            'sorting' => $GLOBALS['TL_LANG']['MSC']['metamodels_sorting'],
            'random'  => $GLOBALS['TL_LANG']['MSC']['random'],
            'id'      => $GLOBALS['TL_LANG']['MSC']['id'][0]
        ];

        $metaModelName = $this->factory->translateIdToMetaModelName($objDc->activeRecord->metamodel);
        $metaModel     = $this->factory->getMetaModel($metaModelName);

        if ($metaModel) {
            foreach ($metaModel->getAttributes() as $objAttribute) {
                $attributeNames[$objAttribute->getColName()] = $objAttribute->getName();
            }
        }

        return $attributeNames;
    }
public function getAttributeNames(\DC_Table $objDc)
    {
        $attributeNames = [
            'sorting' => $GLOBALS['TL_LANG']['MSC']['metamodels_sorting'],
            'random'  => $GLOBALS['TL_LANG']['MSC']['random'],
            'id'      => $GLOBALS['TL_LANG']['MSC']['id'][0]
        ];

        $metaModelName = $this->factory->translateIdToMetaModelName($objDc->activeRecord->metamodel);
        $metaModel     = $this->factory->getMetaModel($metaModelName);

        if ($metaModel) {
            foreach ($metaModel->getAttributes() as $objAttribute) {
                $attributeNames[$objAttribute->getColName()] = $objAttribute->getName();
            }
        }

        return $attributeNames;
    }
public function getAttributeNames ( \ DC_Table $ objDc ) { $ attributeNames = [ 'sorting' => $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'metamodels_sorting' ] , 'random' => $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'random' ] , 'id' => $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'id' ] [ 0 ] ] ; $ metaModelName = $ this -> factory -> translateIdToMetaModelName ( $ objDc -> activeRecord -> metamodel ) ; $ metaModel = $ this -> factory -> getMetaModel ( $ metaModelName ) ; if ( $ metaModel ) { foreach ( $ metaModel -> getAttributes ( ) as $ objAttribute ) { $ attributeNames [ $ objAttribute -> getColName ( ) ] = $ objAttribute -> getName ( ) ; } } return $ attributeNames ; }
Fetch all attribute names for the current MetaModel.

@param \DC_Table $objDc The data container calling this method.

@return string[] array of all attributes as colName => human name

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
Fetch all attribute names for the current MetaModel .