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; }
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; }