allowed); if ($object['flags'] == ZBX_FLAG_DISCOVERY_CREATED) { // ignore the "flags" field unset($object['flags']); foreach ($object as $field => $value) { if (!isset($allowedFields[$field])) { // if we allow to update some fields, throw an error referencing a specific field // we check if there is more than 1 field, because the PK must always be present if (count($allowedFields) > 1) { $this->error($this->messageAllowedField, $field); } else { $this->error($this->messageAllowed); } return false; } } } return true; } public function validatePartial(array $array, array $fullArray) { $array['flags'] = $fullArray['flags']; return $this->validate($array); } }