Example #1
0
 /**
  * @param string $table
  * @param array $data
  * @return mixed
  */
 public function save($table, $data)
 {
     $q = QueryBuilder::buildSaveQuery($table, $data);
     if ($this->execute($q)) {
         if (!$this->fictive) {
             $last_id = $this->lastInsertId();
             if (!empty($last_id)) {
                 return $last_id;
             } else {
                 $av = array_values($data);
                 return $av[0];
             }
         } else {
             return uniqid();
         }
     } else {
         return false;
     }
 }