if(!empty($q['!name'])){
$names = explode(',', $q['!name']);
foreach($names as $name){
+ $name = $this->escape($name);
$this->whereAdd("
core_enum.name NOT IN ('$name')
");
}
}
+ if(!empty($q['search']['display_name'])) {
+ $name = $this->escape($q['search']['display_name']);
+ // ilike on postgres?!?
+ $this->whereAdd("
+ core_enum.display_name LIKE '{$name}%'
+ ");
+
+ }
+
}
function postListFilter($data, $authUser, $q) {
return $ce->id;
}
return 0;
+ }
+
+ /**
+ *
+ *
+ *
+ * @param string $etype
+ * @param array $name array of name
+ * @return array ID of core_enum
+ */
+
+ function lookupAllByName($etype,$name) {
+ $ce = DB_DataObject::Factory('core_enum');
+ $ce->etype = $etype;
+ $ce->whereAddIn('name', $name, 'string');
+ if ($ce->count() > 0) {
+ return $ce->fetchAll('id');
+ }
+ return array();
}
function fetchAllByType($etype, $fetchArg1=false, $fetchArg2=false, $fetchArg3=false)
return false;
}
- /**
- * The base enums that the system always needs,
- * If we need to add modular enums, then this can be extended, and the two
- * base data applied.
- *
- * This might be moved to an external file later? - eg json...
- *
- */
- function baseEnums()
- {
- //
- return array(
- array(
- 'etype' => '',
- 'name' => 'COMPTYPE',
- 'display_name' => 'Company Types',
- 'cn' => array(
- array(
- 'name' => 'OWNER',
- 'display_name' => 'Owner',
- 'seqid' => 999, // last...
- )
-
- )
- )
- );
-
-
-
- }
+
function initEnums($data, $base = array())
{
-
- var_Dump($data);
+
$seq_id = 0;
if (!empty($base['etype'])) {
$seq_id = 1;