silverstripe-framework/tests/model/DataObjectTest_Namespaced.php

33 lines
721 B
PHP
Raw Normal View History

<?php
namespace DataObjectTest;
use SilverStripe\ORM\DataObject;
use SilverStripe\Dev\TestOnly;
/**
* 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
);
}