/**
  * Insert a new record and get the value of the primary key.
  *
  * @param  array $values
  * @param  string $sequence
  * @return int
  */
 public function insertGetId(array $values, $sequence = null)
 {
     $this->compileWheres();
     $result = $this->query->insert($values);
     if (0 == (int) $result['errors']) {
         if (isset($values['id'])) {
             return $values['id'];
         }
         // Return id
         return current($result['generated_keys']);
     }
 }