Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Re: $DataObject::get() Question

$
0
0

Thanks very much for the answer Willr,

->where("Title LIKE '$searchString'") Didn't work however I used:

$entries = BookstoreBook::get()
->filter(array(
'Title:PartialMatch' => $searchString,
'Description:PartialMatch' => $searchString
));
$pagedList = new PaginatedList($entries);
$pagedList->setPageLength(1);
return $pagedList;

Which returned the entries that matched the title. I also need it to match other fields not only title, but adding another key value pair to the associative array didn't work as the OR I expected:

->filter(array(
'Title:PartialMatch' => $searchString,
'Description:PartialMatch' => $searchString -> I expected adding this would make an OR but it only matches the Title...
));

Any idea why it doesn't work????

Thank youu!!!!


Posted to: $DataObject::get() Question | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles