SQLTemplate() public method

By default it is in SELECT mode
public SQLTemplate ( string $mode )
$mode string A key for $this->sql_templates
Exemplo n.º 1
0
 /** Use extended postgresql syntax for fetching ID */
 function SQLTemplate($mode)
 {
     $template = parent::SQLTemplate($mode);
     switch ($mode) {
         case 'insert':
             return $template . " returning id";
     }
     return $template;
 }
Exemplo n.º 2
0
 public function SQLTemplate($mode)
 {
     $template = parent::SQLTemplate($mode);
     switch ($mode) {
         case 'insert':
             if (empty($this->{$id_field}) !== false) {
                 return $template . ' returning ' . $this->{$id_field};
             }
     }
     return $template;
 }