public function validateRequiredRow(array $values = [])
{
$failed = [];
$requiredFields = $this->getRequiredFields();
foreach ($values as $formKey => $formValue) {
if (!$this->isFieldInSchema($formKey)) {
throw new \InvalidArgumentException("The Column [{$formKey}] is not defined.");
}
}
foreach ($requiredFields as $requiredField) {
if (empty($values[$requiredField])) {
$failed[$requiredField] = 'missing';
}
}
return $failed;
}