mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
19 lines
426 B
PHP
19 lines
426 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Decorates {@see File} with ErrorPage support
|
||
|
*/
|
||
|
class ErrorPageFileExtension extends DataExtension {
|
||
|
|
||
|
/**
|
||
|
* Used by {@see File::handle_shortcode}
|
||
|
*
|
||
|
* @param int $statusCode HTTP Error code
|
||
|
* @return DataObject Substitute object suitable for handling the given error code
|
||
|
*/
|
||
|
public function getErrorRecordFor($statusCode) {
|
||
|
return ErrorPage::get()->filter("ErrorCode", $statusCode)->first();
|
||
|
}
|
||
|
|
||
|
}
|