2008-10-03 00:05:45 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class RelationFieldsTestPage extends TestPage {
|
2012-02-29 14:47:37 +01:00
|
|
|
|
2009-01-30 06:01:28 +01:00
|
|
|
static $has_one = array(
|
2012-02-29 14:47:37 +01:00
|
|
|
"HasOneCompany" => "Company",
|
2008-10-03 00:05:45 +02:00
|
|
|
);
|
2009-01-30 06:01:28 +01:00
|
|
|
static $has_many = array(
|
2012-02-29 14:47:37 +01:00
|
|
|
"HasManyCompanies" => "Company",
|
2008-10-03 00:05:45 +02:00
|
|
|
);
|
2009-01-30 06:01:28 +01:00
|
|
|
static $many_many = array(
|
2012-02-29 14:47:37 +01:00
|
|
|
"ManyManyCompanies" => "Company",
|
2009-01-30 06:01:28 +01:00
|
|
|
);
|
2008-10-03 00:05:45 +02:00
|
|
|
|
|
|
|
function getCMSFields() {
|
|
|
|
$fields = parent::getCMSFields();
|
|
|
|
|
2012-02-29 14:27:36 +01:00
|
|
|
$fields->addFieldToTab("Root.CheckboxSet",
|
2008-10-03 00:05:45 +02:00
|
|
|
new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
|
|
|
|
2012-02-29 14:27:36 +01:00
|
|
|
$fields->addFieldToTab("Root.CTF",
|
2012-02-29 14:47:37 +01:00
|
|
|
new ComplexTableField($this, "HasManyCompanies", "TestCTFItem")
|
|
|
|
);
|
2009-01-30 06:01:28 +01:00
|
|
|
|
2012-02-29 14:27:36 +01:00
|
|
|
// TODO Fix legacy relation CTFs in 3.0
|
2009-01-30 06:01:28 +01:00
|
|
|
|
2012-02-29 14:27:36 +01:00
|
|
|
// $fields->addFieldToTab("Root.HasOneCTF",
|
2012-02-29 15:26:00 +01:00
|
|
|
// new HasOneComplexTableField($this, "HasOneCompany");
|
2012-02-29 14:27:36 +01:00
|
|
|
|
|
|
|
// $fields->addFieldToTab("Root.HasManyCTF",
|
2012-02-29 15:26:00 +01:00
|
|
|
// new HasManyComplexTableField($this, "HasManyCompanies");
|
2009-01-30 06:01:28 +01:00
|
|
|
|
2012-02-29 14:27:36 +01:00
|
|
|
// $fields->addFieldToTab("Root.ManyManyCTF",
|
2012-02-29 15:26:00 +01:00
|
|
|
// new ManyManyComplexTableField($this, "ManyManyCompanies");
|
2009-01-30 06:01:28 +01:00
|
|
|
|
2008-10-03 00:05:45 +02:00
|
|
|
|
|
|
|
// $fields->addFieldToTab("Root.Tests.ComplexTableField",
|
|
|
|
// new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
|
|
|
// $fields->addFieldToTab("Root.Tests.CheckboxSet", new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class RelationFieldsTestPage_Controller extends TestPage_Controller {
|
|
|
|
|
2012-02-29 15:26:00 +01:00
|
|
|
}
|