3069 Posts in 868 Topics by 650 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 180 Views |
-
A DataObject as part of another DataObject

4 March 2013 at 7:24pm
Hello,
Imagine that you have a DataObject called Product with some data defined for it:
class Product extends DataObject {
//db fields
static $db = array(
'Name' => 'Varchar',
'Description' => 'Text',
//'etc
);I need to define a set of Features for each Products:
class Feature extends DataObject {
//db fields
static $db = array(
'f1' => 'Varchar',
'f2' => 'Text',
//'etc
);Assuming Features can not be created before creating a Product itself,
how can I create a Product and its Features, inside the Products popup (i.e. assign the Main tab for product fields and create a new tab for Features).Thank you very much.
-
Re: A DataObject as part of another DataObject

5 March 2013 at 11:53am
Not sure if you have the option but I think using SilverStripe 3 takes care of this case for you by default. Certainly it is easy in 3 to add a tab to the getCMSFields() function if the record exists - so a tab for managing features would not appear first time you create the Product DataObject.
-
Re: A DataObject as part of another DataObject

11 March 2013 at 12:31pm
Thanks Frank,
Unfortunately I couldn't find that feature.
So I added the second DataObject as part of the first one.
Not a good solution but it works for now.I'd really like to use DataObjectmanager module in SS3, but I failed.
Too many deprecated methods and settings...But thanks anyway.
| 180 Views | ||
|
Page:
1
|
Go to Top |


