mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
17 lines
369 B
PHP
17 lines
369 B
PHP
|
<?php
|
||
|
|
||
|
use SilverStripe\Dev\TestOnly;
|
||
|
use SilverStripe\ORM\ValidationException;
|
||
|
|
||
|
class CMSMainTest_ClassB extends Page implements TestOnly
|
||
|
{
|
||
|
protected function onBeforeWrite()
|
||
|
{
|
||
|
parent::onBeforeWrite();
|
||
|
|
||
|
if ($this->ClassName !== self::class) {
|
||
|
throw new ValidationException("Class saved with incorrect ClassName");
|
||
|
}
|
||
|
}
|
||
|
}
|