2012-06-25 00:43:37 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace DataObjectTest;
|
2016-06-15 06:03:16 +02:00
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
|
2012-06-25 00:43:37 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2016-06-15 06:03:16 +02:00
|
|
|
class NamespacedClass extends DataObject implements \TestOnly {
|
2013-03-21 19:48:54 +01:00
|
|
|
private static $db = array(
|
2012-06-25 00:43:37 +02:00
|
|
|
'Name' => 'Varchar',
|
|
|
|
);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2013-07-10 02:44:24 +02:00
|
|
|
private static $has_many = array(
|
|
|
|
'Relations' => 'DataObjectTest\RelationClass'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
class RelationClass extends DataObject implements \TestOnly {
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2013-07-10 02:44:24 +02:00
|
|
|
private static $db = array(
|
|
|
|
'Title' => 'Varchar'
|
|
|
|
);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2013-07-10 02:44:24 +02:00
|
|
|
private static $has_one = array(
|
2016-06-15 06:03:16 +02:00
|
|
|
'Parent' => 'SilverStripe\\ORM\\DataObject'
|
2013-07-10 02:44:24 +02:00
|
|
|
);
|
2012-06-25 00:43:37 +02:00
|
|
|
}
|