src/ORM/DataObject.php
protected function validateWrite()
    {
        if ($this->ObsoleteClassName) {
            return new ValidationException(
                "Object is of class '{$this->ObsoleteClassName}' which doesn't exist - " .
                "you need to change the ClassName before you can write it"
            );
        }

        // Note: Validation can only be disabled at the global level, not per-model
        if (DataObject::config()->uninherited('validation_enabled')) {
            $result = $this->validate();
            if (!$result->isValid()) {
                return new ValidationException($result);
            }
        }
        return null;
    }
protected function validateWrite()
    {
        if ($this->ObsoleteClassName) {
            return new ValidationException(
                "Object is of class '{$this->ObsoleteClassName}' which doesn't exist - " .
                "you need to change the ClassName before you can write it"
            );
        }

        // Note: Validation can only be disabled at the global level, not per-model
        if (DataObject::config()->uninherited('validation_enabled')) {
            $result = $this->validate();
            if (!$result->isValid()) {
                return new ValidationException($result);
            }
        }
        return null;
    }
protected function validateWrite ( ) { if ( $ this -> ObsoleteClassName ) { return new ValidationException ( "Object is of class '{$this->ObsoleteClassName}' which doesn't exist - " . "you need to change the ClassName before you can write it" ) ; } // Note: Validation can only be disabled at the global level, not per-model if ( DataObject :: config ( ) -> uninherited ( 'validation_enabled' ) ) { $ result = $ this -> validate ( ) ; if ( ! $ result -> isValid ( ) ) { return new ValidationException ( $ result ) ; } } return null ; }
Determine validation of this object prior to write

@return ValidationException Exception generated by this write, or null if valid
Determine validation of this object prior to write