}
+ if(!empty($q['query']['search'])) {
+ $name = $this->escape($q['query']['search']);
+ // ilike on postgres?!?
+ $this->whereAdd("
+ core_enum.name LIKE '%{$name}%'
+ OR
+ core_enum.display_name LIKE '%{$name}%'
+ ");
+ }
+
// print_r($this);
if(!empty($q['id'])){
$this->id = $q['id'];
CASE WHEN
'$l' = 'en' THEN display_name
ELSE
- CASE WHEN cms_templatestr.txt IS NOT NULL OR cms_templatestr.txt != '' THEN
+ CASE WHEN cms_templatestr.txt IS NOT NULL AND cms_templatestr.txt != '' THEN
cms_templatestr.txt
ELSE
display_name
* @return array ID of core_enum
*/
- function lookupAllByName($etype,$name) {
+ function lookupAllByName($etype,$names) {
$ce = DB_DataObject::Factory('core_enum');
$ce->etype = $etype;
- $ce->whereAddIn('name', $name, 'string');
+ $ce->whereAddIn('name', $names, 'string');
if ($ce->count() > 0) {
return $ce->fetchAll('id');