[TYPO3-mvc] Need help with search form

Steffen Ritter info at rs-websystems.de
Wed Dec 9 08:43:25 CET 2009


Mam Violeng schrieb:
> Hi All,
> 
> I have one form with a keyword text box to search the keyword through 
> the fields in the table (more than 5 fields). I was wondering if extbase 
> also provide some function similar 
> GLOBALS['TYPO3_DB']->searchQuery($searchWords, $fields, $table) or not.

You have to implement such functions on your own. The table field won't 
match, since there are no tables in extbase or mvc. You may Implement an 
  searchFor($keywords=array, $inProperties=array) in an abstract 
Repository which all of your repositories are extending, than it's easy 
to build a search query with likes...
Have a look at the thread of "repository chain multiple likes" - the 
results may help you,.

> 
> Please give me some hints. I also have one more question regarding using 
> $query->statement($statement, $parameters, $language) I don't what this 
> function do, and how to use it, anyone has any real examples how to use it?

Hey, the last to parameters you may drop quietly... just use $result = 
$query->statement('SELECT * from caz")->execute() as

$data = $GLOBALS['TYPO3_DB']->sql_query('SELECT * from caz);
$result =array();
whhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($data)) {
	$result[] = newExtbaseDomainObjectFromData($row);
}

newExtbaseDomainObjectFromDatafor shure is only a description of what 
would be done...

> Thanks in advance.
> 
> Regards,
> 
> Violeng Mam


More information about the TYPO3-project-typo3v4mvc mailing list