Example #1
0
 /**
  * Set the collection which the query is targeting.
  *
  * @param string $table
  *
  * @return Builder
  */
 public function from($table)
 {
     if ($table) {
         $this->table = r\table($table);
         $this->query->table($table);
     }
     return parent::from($table);
 }
Example #2
0
 protected function write(array $record)
 {
     unset($record['level_name']);
     if (array() === $record['extra']) {
         unset($record['extra']);
     }
     /** @var \DateTime $datetime */
     $datetime = $record['datetime'];
     $rDatetime = r\epochTime($datetime->getTimestamp());
     $record['datetime'] = $rDatetime;
     //$result =
     r\table("log")->insert($record, ['durability' => 'soft'])->run($this->connection, ['noreply' => true]);
     //        echo "Insert: $result\n";
 }