silverstripe-framework/tests/model/DataObjectTest_Namespaced.php

29 lines
643 B
PHP
Raw Normal View History

<?php
namespace DataObjectTest;
/**
* 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.
*/
2013-07-10 02:44:24 +02:00
class NamespacedClass extends \DataObject implements \TestOnly {
private static $db = array(
'Name' => 'Varchar',
);
2013-07-10 02:44:24 +02:00
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' => 'DataObject'
);
}