mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
6e589aac75
API Implement form schema "errors" handling
25 lines
442 B
PHP
25 lines
442 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Forms\Tests\EmailFieldTest;
|
|
|
|
use Exception;
|
|
use SilverStripe\Forms\Validator;
|
|
use SilverStripe\ORM\ValidationResult;
|
|
|
|
class TestValidator extends Validator
|
|
{
|
|
public function validationError(
|
|
$fieldName, $message, $messageType = ValidationResult::TYPE_ERROR, $cast = ValidationResult::CAST_TEXT
|
|
) {
|
|
throw new Exception($message);
|
|
}
|
|
|
|
public function javascript()
|
|
{
|
|
}
|
|
|
|
public function php($data)
|
|
{
|
|
}
|
|
}
|