Resources/contao/dca/tl_content.php
public function get_maps(DataContainer $dc)
    {
        $maps = $this->Database->prepare ( "SELECT * FROM tl_c4g_maps WHERE is_map=1 AND published=1" )->execute ();
        if ($maps->numRows > 0) {
            while ( $maps->next () ) {
                if (!isset($this->firstMapId)) {
                    // save first map id
                    $this->firstMapId = $maps->id;
                }
                $return [$maps->id] = $maps->name;
            }
        }
        return $return;
    }
public function get_maps(DataContainer $dc)
    {
        $maps = $this->Database->prepare ( "SELECT * FROM tl_c4g_maps WHERE is_map=1 AND published=1" )->execute ();
        if ($maps->numRows > 0) {
            while ( $maps->next () ) {
                if (!isset($this->firstMapId)) {
                    // save first map id
                    $this->firstMapId = $maps->id;
                }
                $return [$maps->id] = $maps->name;
            }
        }
        return $return;
    }
public function get_maps ( DataContainer $ dc ) { $ maps = $ this -> Database -> prepare ( "SELECT * FROM tl_c4g_maps WHERE is_map=1 AND published=1" ) -> execute ( ) ; if ( $ maps -> numRows > 0 ) { while ( $ maps -> next ( ) ) { if ( ! isset ( $ this -> firstMapId ) ) { // save first map id $ this -> firstMapId = $ maps -> id ; } $ return [ $ maps -> id ] = $ maps -> name ; } } return $ return ; }
Return all defined maps
@param object
@return array
Return all defined maps