entity.')'; //print $sql; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { while ($obj=$this->db->fetch_object($resql)) { $fieldname=$keyforaliasextra.'.'.$obj->name; $fieldlabel=ucfirst($obj->label); $typeFilter="Text"; switch($obj->type) { case 'int': case 'double': case 'price': $typeFilter="Numeric"; break; case 'date': case 'datetime': $typeFilter="Date"; break; case 'boolean': $typeFilter="Boolean"; break; case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null if ($tmpparam['options'] && is_array($tmpparam['options'])) { $tmpkeys=array_keys($tmpparam['options']); $tmp=array_shift($tmpkeys); } if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; break; } if ($obj->type!='separate') { $this->export_fields_array[$r][$fieldname]=$fieldlabel; $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; $this->export_entities_array[$r][$fieldname]=$keyforelement; } } } // End add axtra fields