silverstripe-framework/tests/model/DataObjectTest_Namespaced.php
2016-06-29 10:02:32 +12:00

31 lines
691 B
PHP

<?php
namespace DataObjectTest;
use SilverStripe\ORM\DataObject;
/**
* Right now this is only used in DataListTest, but extending it to DataObjectTest in the future would make sense.
* Note that it was deliberated named to include "\N" to try and trip bad code up.
*/
class NamespacedClass extends DataObject implements \TestOnly {
private static $db = array(
'Name' => 'Varchar',
);
private static $has_many = array(
'Relations' => 'DataObjectTest\RelationClass'
);
}
class RelationClass extends DataObject implements \TestOnly {
private static $db = array(
'Title' => 'Varchar'
);
private static $has_one = array(
'Parent' => 'SilverStripe\\ORM\\DataObject'
);
}