コード例 #1
0
ファイル: Builder.php プロジェクト: brunojk/laravel-rethinkdb
 /**
  * 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);
 }
コード例 #2
0
ファイル: Handler.php プロジェクト: caseycs/monolog-rethinkdb
 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";
 }