private function isExtBasePossible() { tx_rnbase::load('tx_rnbase_util_TYPO3'); // TODO: bessere Testklasse finden return FALSE && tx_rnbase_util_TYPO3::isExtLoaded('extbase') && tx_rnbase_util_TYPO3::isExtMinVersion('t3sponsors', 2001); }
/** * Create a where condition for string search in different database tables and columns. * @param array $kw * @param array $searchFields */ private function _getSearchLike($kw, $searchFields) { global $TYPO3_DB; $searchTable = ''; // Für TYPO3 nicht relevant if (tx_rnbase_util_TYPO3::isExtLoaded('dbal')) { // Bei dbal darf die Tabelle nicht leer sein. Wir setzen die erste Tabelle in den searchfields $col = $searchFields[0]; list($searchTable, $col) = explode('.', $col); } $wheres = array(); while (list(, $val) = each($kw)) { $val = trim($val); $where_p = array(); if (strlen($val) >= 2) { $val = $TYPO3_DB->escapeStrForLike($TYPO3_DB->quoteStr($val, $searchTable), $searchTable); reset($searchFields); while (list(, $field) = each($searchFields)) { $where_p[] = $field . ' LIKE \'%' . $val . '%\''; } } if (count($where_p)) { $wheres[] = ' (' . implode(' OR ', $where_p) . ')'; } } $where = count($wheres) ? implode(' AND ', $wheres) : ''; return $where; }