DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
SELECT_mm_query()¶
What does it do?¶
The method sends a SQL-Select statement and returns a SQL query.
Header¶
/**
* Creates a SELECT query, selecting fields ($select) from two/three tables joined
* Use $mm_table together with $local_table or $foreign_table to select over two tables. Or use all three tables to select the full MM-relation.
* The JOIN is done with [$local_table].uid <--> [$mm_table].uid_local / [$mm_table].uid_foreign <--> [$foreign_table].uid
* The function is very useful for selecting MM-relations between tables adhering to the MM-format used by TCE (TYPO3 Core Engine). See the section on $GLOBALS['TCA'] in Inside TYPO3 for more details.
*
* @param string $select See exec_SELECT_mm_query()
* @param string $local_table See exec_SELECT_mm_query()
* @param string $mm_table See exec_SELECT_mm_query()
* @param string $foreign_table See exec_SELECT_mm_query()
* @param string $whereClause See exec_SELECT_mm_query()
* @param string $groupBy See exec_SELECT_mm_query()
* @param string $orderBy See exec_SELECT_mm_query()
* @param string $limit See exec_SELECT_mm_query()
* @return string Full SQL query for SELECT
* @see SELECTquery()
*/
public static function SELECT_mm_query( $select, $local_table, $mm_table, $foreign_table, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '' )
Sample¶
$query = \Netzmacher\Refresh\Compatibility\Core\Database\DatabaseConnection::SELECT_mm_query( $select, $local_table, $mm_table, $foreign_table, $whereClause, $groupBy );
Refresh¶
You can refresh your extension by find and replace.
// Code from TYPO3 6.2 to 8.7
$query = $GLOBALS[ 'TYPO3_DB' ]->SELECT_mm_query( $select, $local_table, $mm_table, $foreign_table, $whereClause, $groupBy );
// Code from TYPO3 6.2 to 9.x
$query = \Netzmacher\Refresh\Compatibility\Core\Database\DatabaseConnection::SELECT_mm_query( $select, $local_table, $mm_table, $foreign_table, $whereClause, $groupBy );
Move “$GLOBALS[ ‘TYPO3_DB’ ]->SELECT_mm_query” to “Netzmacher\Refresh\Compatibility\Core\Database\DatabaseConnection::SELECT_mm_query”