silverstripe-framework/tests/model/DataObjectTest_Namespaced.php

31 lines
691 B
PHP
Raw Normal View History

<?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',
);
2014-08-15 08:53:05 +02:00
2013-07-10 02:44:24 +02:00
private static $has_many = array(
'Relations' => 'DataObjectTest\RelationClass'
);
}
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(
'Parent' => 'SilverStripe\\ORM\\DataObject'
2013-07-10 02:44:24 +02:00
);
}