Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Exceptions

  • ValidationException
 1 <?php
 2 /**
 3  * Exception thrown by {@link DataObject}::write if validation fails. By throwing an
 4  * exception rather than a user error, the exception can be caught in unit tests and as such
 5  * can be used as a successful test.
 6  * 
 7  * @package sapphire
 8  * @subpackage validation
 9  */
10 class ValidationException extends Exception {
11 
12     /**
13      * @var {@link ValidationResult} or string
14      */
15     protected $result;
16 
17     public function __construct($result = null, $message = null, $code = 0) {
18         if($result instanceof ValidationResult) {
19             $this->result = $result;
20         } else {
21             $code = $message;
22             $message = $result;
23         }
24         
25         parent::__construct($message, $code);
26     }
27     
28     public function getResult() {
29         return $this->result;   
30     }
31 }
32 ?>
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0