示例#1
0
 public function findOrCreateQuery($data)
 {
     $id = $this->queryRepository->findOrCreate($data, array('query'), $created);
     if ($created) {
         foreach ($data['arguments'] as $argument => $value) {
             $this->queryArgumentRepository->create(array('query_id' => $id, 'argument' => $argument, 'value' => $value));
         }
     }
     return $id;
 }
示例#2
0
 public function findOrCreateQuery($data)
 {
     $id = $this->queryRepository->findOrCreate($data, ['query'], $created);
     if ($created) {
         foreach ($data['arguments'] as $argument => $value) {
             if (is_array($value)) {
                 $value = multi_implode(',', $value);
             }
             $this->queryArgumentRepository->create(['query_id' => $id, 'argument' => $argument, 'value' => $value]);
         }
     }
     return $id;
 }