/** * Set mode and uniqueField in saveToAnyTableService * * @param SaveToAnyTableService $saveService * @param array $tableConfiguration * @return void */ protected function setModeInSaveService(SaveToAnyTableService $saveService, array $tableConfiguration) { if (!empty($tableConfiguration['_ifUnique.'])) { $uniqueFields = array_keys($tableConfiguration['_ifUnique.']); $saveService->setMode($tableConfiguration['_ifUnique.'][$uniqueFields[0]]); $saveService->setUniqueField($uniqueFields[0]); $this->addAdditionalWhereClause($saveService, $tableConfiguration); } }
/** * Set mode and uniqueField in saveToAnyTableService * * @param SaveToAnyTableService $saveService * @param string $table * @param array $tableConfiguration * @return void */ protected function setModeInSaveService(SaveToAnyTableService $saveService, $table, array $tableConfiguration) { if (!empty($tableConfiguration['_ifUnique.'])) { $uniqueFields = array_keys($tableConfiguration['_ifUnique.']); $saveService->setMode($tableConfiguration['_ifUnique.'][$uniqueFields[0]]); $saveService->setUniqueField($uniqueFields[0]); if (!empty($conf['dbEntry.'][$table . '.']['_ifUniqueWhereClause'])) { $saveService->setAdditionalWhereClause($conf['dbEntry.'][$table . '.']['_ifUniqueWhereClause']); } } }