idField = array_values((array) $idField)[0]; parent::__construct($entityName, $actionName); } /** * @throws \API_Exception */ protected function validateValues() { $unmatched = []; foreach ($this->records as $record) { if (empty($record[$this->idField])) { $unmatched = array_unique(array_merge($unmatched, $this->checkRequiredFields($record))); } } if ($unmatched) { throw new \API_Exception("Mandatory values missing from Api4 {$this->getEntityName()}::{$this->getActionName()}: " . implode(", ", $unmatched), "mandatory_missing", ["fields" => $unmatched]); } } /** * @return string */ protected function getIdField() { return $this->idField; } }