|
@@ 85-89 (lines=5) @@
|
| 82 |
|
private function validateRequired($key, $value) |
| 83 |
|
{ |
| 84 |
|
switch ($this->action) { |
| 85 |
|
case 'add': |
| 86 |
|
if (!isset($value) && (true === $this->fieldsParams[$key]['required_add'])) { |
| 87 |
|
throw new EntityFieldsException("Adding error: the required field \"$key\" is missing or empty"); |
| 88 |
|
} |
| 89 |
|
break; |
| 90 |
|
case 'update': |
| 91 |
|
if (!isset($value) && (true === $this->fieldsParams[$key]['required_update'])) { |
| 92 |
|
throw new EntityFieldsException("Updating error: the required field \"$key\" is missing or empty"); |
|
@@ 90-94 (lines=5) @@
|
| 87 |
|
throw new EntityFieldsException("Adding error: the required field \"$key\" is missing or empty"); |
| 88 |
|
} |
| 89 |
|
break; |
| 90 |
|
case 'update': |
| 91 |
|
if (!isset($value) && (true === $this->fieldsParams[$key]['required_update'])) { |
| 92 |
|
throw new EntityFieldsException("Updating error: the required field \"$key\" is missing or empty"); |
| 93 |
|
} |
| 94 |
|
break; |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
return true; |