const ATTR_DECIMAL_PLACES = 141;
const ATTR_PORTABILITY = 106;
- const ATTR_VALIDATE = 107;
const ATTR_COLL_KEY = 108;
const ATTR_QUERY_LIMIT = 109;
const ATTR_DEFAULT_TABLE_TYPE = 112;
const HYDRATE_ARRAY = 3;
const HYDRATE_NONE = 4;
- const VALIDATE_NONE = 0;
- const VALIDATE_LENGTHS = 1;
- const VALIDATE_TYPES = 2;
- const VALIDATE_CONSTRAINTS = 4;
- const VALIDATE_ALL = 7;
const IDENTIFIER_AUTOINC = 1;
const IDENTIFIER_SEQUENCE = 2;
const IDENTIFIER_NATURAL = 3;
IPF_ORM::ATTR_LISTENER => new IPF_ORM_EventListener(),
IPF_ORM::ATTR_RECORD_LISTENER => new IPF_ORM_Record_Listener(),
IPF_ORM::ATTR_THROW_EXCEPTIONS => true,
- IPF_ORM::ATTR_VALIDATE => IPF_ORM::VALIDATE_NONE,
IPF_ORM::ATTR_QUERY_LIMIT => IPF_ORM::LIMIT_RECORDS,
IPF_ORM::ATTR_IDXNAME_FORMAT => "%s_idx",
IPF_ORM::ATTR_SEQNAME_FORMAT => "%s_seq",
$dataType = $this->getTypeOf($fieldName);
- // Validate field type, if type validation is enabled
- if ($this->getAttribute(IPF_ORM::ATTR_VALIDATE) & IPF_ORM::VALIDATE_TYPES) {
- if ( ! IPF_ORM_Validator::isValidType($value, $dataType)) {
- $errorStack->add($fieldName, 'type');
- }
- if ($dataType == 'enum') {
- $enumIndex = $this->enumIndex($fieldName, $value);
- if ($enumIndex === false) {
- $errorStack->add($fieldName, 'enum');
- }
+ // Validate field type
+ if ( ! IPF_ORM_Validator::isValidType($value, $dataType)) {
+ $errorStack->add($fieldName, 'type');
+ }
+ if ($dataType == 'enum') {
+ $enumIndex = $this->enumIndex($fieldName, $value);
+ if ($enumIndex === false) {
+ $errorStack->add($fieldName, 'enum');
}
}
- // Validate field length, if length validation is enabled
- if ($this->getAttribute(IPF_ORM::ATTR_VALIDATE) & IPF_ORM::VALIDATE_LENGTHS) {
- if ( ! IPF_ORM_Validator::validateLength($value, $dataType, $this->getFieldLength($fieldName))) {
- $errorStack->add($fieldName, 'length');
- }
+ // Validate field length
+ if ( ! IPF_ORM_Validator::validateLength($value, $dataType, $this->getFieldLength($fieldName))) {
+ $errorStack->add($fieldName, 'length');
}
// Run all custom validators