3.1 compat

This commit is contained in:
Ingo Schommer 2013-03-26 11:44:04 +01:00
parent 7e098b2863
commit e15366359e
15 changed files with 36 additions and 48 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
class BasicFieldsTestPage extends TestPage { class BasicFieldsTestPage extends TestPage {
static $db = array( private static $db = array(
'Checkbox' => 'Boolean', 'Checkbox' => 'Boolean',
'Readonly' => 'Varchar', 'Readonly' => 'Varchar',
'Textarea' => 'Text', 'Textarea' => 'Text',
@ -33,7 +33,7 @@ class BasicFieldsTestPage extends TestPage {
'OptionSet' => 'Int', 'OptionSet' => 'Int',
); );
static $has_one = array( private static $has_one = array(
'Dropdown' => 'TestCategory', 'Dropdown' => 'TestCategory',
'GroupedDropdown' => 'TestCategory', 'GroupedDropdown' => 'TestCategory',
'ListboxField' => 'TestCategory', 'ListboxField' => 'TestCategory',
@ -42,11 +42,11 @@ class BasicFieldsTestPage extends TestPage {
'Image' => 'Image', 'Image' => 'Image',
); );
static $has_many = array( private static $has_many = array(
'HasManyFiles' => 'File', 'HasManyFiles' => 'File',
); );
static $many_many = array( private static $many_many = array(
'ManyManyFiles' => 'File', 'ManyManyFiles' => 'File',
'MultipleListboxField' => 'TestCategory', 'MultipleListboxField' => 'TestCategory',
); );

View File

@ -6,27 +6,27 @@ class Company extends DataObject {
* *
* @var array * @var array
*/ */
public static $db = array( private static $db = array(
'Name'=>'Varchar(255)', 'Name'=>'Varchar(255)',
'Category'=>'Varchar(255)', 'Category'=>'Varchar(255)',
'Revenue'=>'Float', 'Revenue'=>'Float',
'CEO'=>'Varchar(255)', 'CEO'=>'Varchar(255)',
); );
public static $has_one = array( private static $has_one = array(
'RelationFieldsTestPage' => 'RelationFieldsTestPage', 'RelationFieldsTestPage' => 'RelationFieldsTestPage',
'GridFieldTestPageHasOne' => 'GridFieldTestPage' 'GridFieldTestPageHasOne' => 'GridFieldTestPage'
); );
public static $has_many = array( private static $has_many = array(
'Employees' => 'Employee' 'Employees' => 'Employee'
); );
public static $many_many = array( private static $many_many = array(
'PastEmployees' => 'Employee' 'PastEmployees' => 'Employee'
); );
public static $many_many_extraFields = array( private static $many_many_extraFields = array(
'PastEmployees' => array( 'PastEmployees' => array(
'YearStart' => 'Int', 'YearStart' => 'Int',
'YearEnd' => 'Int', 'YearEnd' => 'Int',
@ -34,12 +34,12 @@ class Company extends DataObject {
) )
); );
static $belongs_many_many = array( private static $belongs_many_many = array(
'RelationFieldsTestPages' => 'RelationFieldsTestPage', 'RelationFieldsTestPages' => 'RelationFieldsTestPage',
'GridFieldTestPage' => 'GridFieldTestPage' 'GridFieldTestPage' => 'GridFieldTestPage'
); );
public static $summary_fields = array( private static $summary_fields = array(
'Name', 'Name',
'Category', 'Category',
'Revenue', 'Revenue',
@ -47,7 +47,7 @@ class Company extends DataObject {
'DynamicProperty' 'DynamicProperty'
); );
public static $searchable_fields = array( private static $searchable_fields = array(
'Name', 'Name',
'Category', 'Category',
'Revenue', 'Revenue',

View File

@ -6,17 +6,17 @@
*/ */
class Employee extends DataObject { class Employee extends DataObject {
public static $db = array( private static $db = array(
'Name' => 'Varchar', 'Name' => 'Varchar',
'Biography' => 'HTMLText' 'Biography' => 'HTMLText'
); );
public static $has_one = array( private static $has_one = array(
'Company' => 'Company', 'Company' => 'Company',
'ProfileImage' => 'Image' 'ProfileImage' => 'Image'
); );
public static $belongs_many_many = array( private static $belongs_many_many = array(
'PastCompanies' => 'Company' 'PastCompanies' => 'Company'
); );

View File

@ -1,6 +1,6 @@
<?php <?php
class FileUploadRole extends DataExtension{ class FileUploadRole extends DataExtension{
static $has_one = array( private static $has_one = array(
'AFile' => 'File', 'AFile' => 'File',
'AImage' => 'Image', 'AImage' => 'Image',
); );

View File

@ -2,7 +2,7 @@
class FrameworkTestRole extends DataExtension { class FrameworkTestRole extends DataExtension {
static $has_one = array( private static $has_one = array(
'FavouritePage' => 'SiteTree', 'FavouritePage' => 'SiteTree',
); );

View File

@ -1,7 +1,7 @@
<?php <?php
class FrameworkTestSiteTreeExtension extends DataExtension { class FrameworkTestSiteTreeExtension extends DataExtension {
static $has_one = array('RelationFieldsTestPage' => 'RelationFieldsTestPage'); private static $has_one = array('RelationFieldsTestPage' => 'RelationFieldsTestPage');
static $belongs_many_many = array('RelationFieldsTestPages' => 'RelationFieldsTestPage'); private static $belongs_many_many = array('RelationFieldsTestPages' => 'RelationFieldsTestPage');
} }

View File

@ -1,15 +1,15 @@
<?php <?php
class GridFieldTestPage extends TestPage { class GridFieldTestPage extends TestPage {
static $has_one = array( private static $has_one = array(
"HasOneCompany" => "Company", "HasOneCompany" => "Company",
); );
static $has_many = array( private static $has_many = array(
"HasManyCompanies" => "Company", "HasManyCompanies" => "Company",
); );
static $many_many = array( private static $many_many = array(
"ManyManyCompanies" => "Company", "ManyManyCompanies" => "Company",
); );

View File

@ -3,7 +3,7 @@
class Organisation extends DataObject { class Organisation extends DataObject {
// Used to test the Multiform module // Used to test the Multiform module
static $db = array( private static $db = array(
'OrganisationName' => 'Text' 'OrganisationName' => 'Text'
); );

View File

@ -2,20 +2,20 @@
class RelationFieldsTestPage extends TestPage { class RelationFieldsTestPage extends TestPage {
static $has_one = array( private static $has_one = array(
"HasOneCompany" => "Company", "HasOneCompany" => "Company",
"HasOnePage" => "SiteTree", "HasOnePage" => "SiteTree",
); );
static $has_many = array( private static $has_many = array(
"HasManyCompanies" => "Company", "HasManyCompanies" => "Company",
"HasManyPages" => "SiteTree", "HasManyPages" => "SiteTree",
); );
static $many_many = array( private static $many_many = array(
"ManyManyCompanies" => "Company", "ManyManyCompanies" => "Company",
"ManyManyPages" => "SiteTree", "ManyManyPages" => "SiteTree",
); );
static $defaults = array( private static $defaults = array(
'Title' => 'Relational Fields' 'Title' => 'Relational Fields'
); );

View File

@ -4,10 +4,10 @@
* A data type that is related many-many to RelationFieldsTestPage, for testing purposes * A data type that is related many-many to RelationFieldsTestPage, for testing purposes
*/ */
class TestCategory extends DataObject { class TestCategory extends DataObject {
static $db = array( private static $db = array(
"Title" => "Varchar", "Title" => "Varchar",
); );
static $belongs_many_many = array( private static $belongs_many_many = array(
"RelationPages" => "RelationFieldsTestPage", "RelationPages" => "RelationFieldsTestPage",
); );

View File

@ -1,10 +1,10 @@
<?php <?php
class TestModelAdmin extends ModelAdmin { class TestModelAdmin extends ModelAdmin {
static $url_segment = 'test'; private static $url_segment = 'test';
static $menu_title = 'Test ModelAdmin'; private static $menu_title = 'Test ModelAdmin';
static $managed_models = array( private static $managed_models = array(
"Company", "Company",
"Employee", "Employee",
); );

View File

@ -2,12 +2,6 @@
class Page2MultiFormTestPage extends Page { class Page2MultiFormTestPage extends Page {
static $db = array(
);
static $has_one = array(
);
} }
class Page2MultiFormTestPage_Controller extends Page_Controller { class Page2MultiFormTestPage_Controller extends Page_Controller {

View File

@ -2,12 +2,6 @@
class Page3MultiFormTestPage extends Page { class Page3MultiFormTestPage extends Page {
static $db = array(
);
static $has_one = array(
);
} }
class Page3MultiFormTestPage_Controller extends Page_Controller { class Page3MultiFormTestPage_Controller extends Page_Controller {

View File

@ -1,11 +1,11 @@
<?php <?php
class TestTag extends DataObject { class TestTag extends DataObject {
static $db = array( private static $db = array(
'Title' => 'Text' 'Title' => 'Text'
); );
static $belongs_many_many = array( private static $belongs_many_many = array(
'Pages' => 'TestTagFieldPage' 'Pages' => 'TestTagFieldPage'
); );

View File

@ -1,12 +1,12 @@
<?php <?php
class TestTagFieldPage extends Page { class TestTagFieldPage extends Page {
static $db = array( private static $db = array(
'TestTagString' => 'Text', 'TestTagString' => 'Text',
'FixedTags' => 'Text' 'FixedTags' => 'Text'
); );
static $many_many = array( private static $many_many = array(
'TestTags' => 'TestTag', 'TestTags' => 'TestTag',
); );