@@ 122-126 (lines=5) @@ | ||
119 | protected function validate($type, $field, $value) |
|
120 | { |
|
121 | // validate length if defined |
|
122 | if ($maxLength = $this->mapper->getFieldMaxLength($type, $field)) { |
|
123 | if (!$this->validator->validateLength($value, $maxLength)) { |
|
124 | throw new InvalidArgumentException($type . '.' . $field . ' value length exceed database max length.'); |
|
125 | } |
|
126 | } |
|
127 | // validate field type |
|
128 | if ($fieldType = $this->mapper->getFieldType($type, $field)) { |
|
129 | if (!$this->validator->validateType($value, $fieldType)) { |
|
@@ 128-132 (lines=5) @@ | ||
125 | } |
|
126 | } |
|
127 | // validate field type |
|
128 | if ($fieldType = $this->mapper->getFieldType($type, $field)) { |
|
129 | if (!$this->validator->validateType($value, $fieldType)) { |
|
130 | throw new InvalidArgumentException($type . '.' . $field . ' type not valid.'); |
|
131 | } |
|
132 | } |
|
133 | } |
|
134 | ||
135 | /** |