Added more relation editing fields to frameworktest

This commit is contained in:
Sam Minnee 2009-01-30 05:01:28 +00:00
parent 08c22fbbf2
commit 660fd19a49

View File

@ -1,12 +1,15 @@
<?php
class RelationFieldsTestPage extends TestPage {
static $has_one = array(
"FavouriteItem" => "TestCTFItem",
);
static $has_many = array(
"Items" => "TestCTFItem",
);
static $many_many = array(
"CheckboxSet" => "TestCategory",
);
static $has_may = array(
"Items" => "TestCTFItem",
);
function getCMSFields() {
$fields = parent::getCMSFields();
@ -14,10 +17,27 @@ class RelationFieldsTestPage extends TestPage {
$fields->addFieldToTab("Root.Content.CheckboxSet",
new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
/*
$fields->addFieldToTab("Root.Content.ComplexTableField",
new ComplexTableField($this, "Items", "TestCTFItem", array(
"Title" => "Item Title",
"Author" => "Item Author")));
*/
$fields->addFieldToTab("Root.Content.HasOneComplexTableField",
new HasOneComplexTableField($this, "FavouriteItem", "TestCTFItem", array(
"Title" => "Item Title",
"Author" => "Item Author")));
$fields->addFieldToTab("Root.Content.HasManyComplexTableField",
new HasManyComplexTableField($this, "Items", "TestCTFItem", array(
"Title" => "Item Title",
"Author" => "Item Author")));
$fields->addFieldToTab("Root.Content.ManyManyComplexTableField",
new ManyManyComplexTableField($this, "CheckboxSet", "TestCategory", array(
"Title" => "Item Title")));
// $fields->addFieldToTab("Root.Tests.ComplexTableField",
// new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));