mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7688 from open-sausages/pulls/4.0/less-breaking-warnings
BUG Don't warn on table name for classes without tables
This commit is contained in:
commit
7643c90410
@ -3,15 +3,16 @@
|
|||||||
namespace SilverStripe\ORM;
|
namespace SilverStripe\ORM;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use SilverStripe\Core\Injector\Injectable;
|
use InvalidArgumentException;
|
||||||
|
use LogicException;
|
||||||
|
use SilverStripe\Core\ClassInfo;
|
||||||
|
use SilverStripe\Core\Config\Config;
|
||||||
use SilverStripe\Core\Config\Configurable;
|
use SilverStripe\Core\Config\Configurable;
|
||||||
|
use SilverStripe\Core\Injector\Injectable;
|
||||||
use SilverStripe\Core\Injector\Injector;
|
use SilverStripe\Core\Injector\Injector;
|
||||||
use SilverStripe\Dev\TestOnly;
|
use SilverStripe\Dev\TestOnly;
|
||||||
use SilverStripe\ORM\FieldType\DBComposite;
|
use SilverStripe\ORM\FieldType\DBComposite;
|
||||||
use SilverStripe\Core\ClassInfo;
|
use SilverStripe\ORM\FieldType\DBField;
|
||||||
use SilverStripe\Core\Config\Config;
|
|
||||||
use InvalidArgumentException;
|
|
||||||
use LogicException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides dataobject and database schema mapping functionality
|
* Provides dataobject and database schema mapping functionality
|
||||||
@ -316,7 +317,7 @@ class DataObjectSchema
|
|||||||
return $class;
|
return $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ClassInfo::classImplements($class, TestOnly::class)) {
|
if (!ClassInfo::classImplements($class, TestOnly::class) && $this->classHasTable($class)) {
|
||||||
trigger_error(
|
trigger_error(
|
||||||
"It is recommended to define a table_name for your '$class'." .
|
"It is recommended to define a table_name for your '$class'." .
|
||||||
' Not defining a table_name may cause subsequent table names to be too long and may not be supported' .
|
' Not defining a table_name may cause subsequent table names to be too long and may not be supported' .
|
||||||
@ -541,7 +542,6 @@ class DataObjectSchema
|
|||||||
*/
|
*/
|
||||||
protected function cacheDefaultDatabaseIndexes($class)
|
protected function cacheDefaultDatabaseIndexes($class)
|
||||||
{
|
{
|
||||||
$indexes = [];
|
|
||||||
if (array_key_exists($class, $this->defaultDatabaseIndexes)) {
|
if (array_key_exists($class, $this->defaultDatabaseIndexes)) {
|
||||||
return $this->defaultDatabaseIndexes[$class];
|
return $this->defaultDatabaseIndexes[$class];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user