public function getQueryParts()
    {
        $fields = 'SQL_CALC_FOUND_ROWS *';
        $table = $this->table;
        $where = '1=1';

        // if a searchword was given, calculate percent of score
        if ($this->pObj->sword) {
            $fields .= ', MATCH (title, content) AGAINST ("'
                . $this->pObj->scoreAgainst
                . '") + ('
                . $this->pObj->extConf['multiplyValueToTitle']
                . ' * MATCH (title) AGAINST ("'
                . $this->pObj->scoreAgainst
                . '")) AS score';
        }

        // add where clause
        $where .= $this->getWhere();

        // add ordering
        $orderBy = $this->getOrdering();

        // add limitation
        $limit = $this->getLimit();

        $queryParts = array(
            'SELECT' => $fields,
            'FROM' => $table,
            'WHERE' => $where,
            'GROUPBY' => '',
            'ORDERBY' => $orderBy,
            'LIMIT' => $limit[0] . ',' . $limit[1]
        );

        // hook for third party applications to manipulate last part of query building
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getQueryParts'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getQueryParts'] as $_classRef) {
                $_procObj = &GeneralUtility::makeInstance($_classRef);
                $queryParts = $_procObj->getQueryParts($queryParts, $this);
            }
        }

        return $queryParts;
    }
public function getQueryParts()
    {
        $fields = 'SQL_CALC_FOUND_ROWS *';
        $table = $this->table;
        $where = '1=1';

        // if a searchword was given, calculate percent of score
        if ($this->pObj->sword) {
            $fields .= ', MATCH (title, content) AGAINST ("'
                . $this->pObj->scoreAgainst
                . '") + ('
                . $this->pObj->extConf['multiplyValueToTitle']
                . ' * MATCH (title) AGAINST ("'
                . $this->pObj->scoreAgainst
                . '")) AS score';
        }

        // add where clause
        $where .= $this->getWhere();

        // add ordering
        $orderBy = $this->getOrdering();

        // add limitation
        $limit = $this->getLimit();

        $queryParts = array(
            'SELECT' => $fields,
            'FROM' => $table,
            'WHERE' => $where,
            'GROUPBY' => '',
            'ORDERBY' => $orderBy,
            'LIMIT' => $limit[0] . ',' . $limit[1]
        );

        // hook for third party applications to manipulate last part of query building
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getQueryParts'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getQueryParts'] as $_classRef) {
                $_procObj = &GeneralUtility::makeInstance($_classRef);
                $queryParts = $_procObj->getQueryParts($queryParts, $this);
            }
        }

        return $queryParts;
    }
public function getQueryParts ( ) { $ fields = 'SQL_CALC_FOUND_ROWS *' ; $ table = $ this -> table ; $ where = '1=1' ; // if a searchword was given, calculate percent of score if ( $ this -> pObj -> sword ) { $ fields .= ', MATCH (title, content) AGAINST ("' . $ this -> pObj -> scoreAgainst . '") + (' . $ this -> pObj -> extConf [ 'multiplyValueToTitle' ] . ' * MATCH (title) AGAINST ("' . $ this -> pObj -> scoreAgainst . '")) AS score' ; } // add where clause $ where .= $ this -> getWhere ( ) ; // add ordering $ orderBy = $ this -> getOrdering ( ) ; // add limitation $ limit = $ this -> getLimit ( ) ; $ queryParts = array ( 'SELECT' => $ fields , 'FROM' => $ table , 'WHERE' => $ where , 'GROUPBY' => '' , 'ORDERBY' => $ orderBy , 'LIMIT' => $ limit [ 0 ] . ',' . $ limit [ 1 ] ) ; // hook for third party applications to manipulate last part of query building if ( is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'ke_search' ] [ 'getQueryParts' ] ) ) { foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'ke_search' ] [ 'getQueryParts' ] as $ _classRef ) { $ _procObj = & GeneralUtility :: makeInstance ( $ _classRef ) ; $ queryParts = $ _procObj -> getQueryParts ( $ queryParts , $ this ) ; } } return $ queryParts ; }
get query parts like SELECT, FROM and WHERE for MySQL-Query

@return array Array containing the query parts for MySQL
get query parts like SELECT FROM and WHERE for MySQL - Query