7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Create a HasOneComplexTable or HasMany in Dataobject?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 755 Views |
-
Create a HasOneComplexTable or HasMany in Dataobject?

30 December 2010 at 1:09am
Hi, everyone...
i've got a question it's possible create a HasOneComplexTable in "Class Products extends DataObject" for example ...
its possible make relationship for other classes?Sorry guys i'am a newbie...
and sorry my english...thanks all
-
Re: Create a HasOneComplexTable or HasMany in Dataobject?

30 December 2010 at 3:45am
Sounds like you want a nested DataObjectManager?
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Create a HasOneComplexTable or HasMany in Dataobject?

30 December 2010 at 4:06am
yeah.... i' follow these tuts... but i' newbie and try... try... to achieve... so i be a pacient... ehehe and try... try... try...
great job unclecheese...
Thanks!!
-
Re: Create a HasOneComplexTable or HasMany in Dataobject?

30 December 2010 at 5:18am
The code is right?
<?php
class Fabricante extends DataObject {
static $db = array(
'Nomefab' => 'Varchar(255)',
);static $has_many = array(
'Produtos'=>'Produto'
);static $searchable_fields = array(
'Nomefab'
);static $summary_fields = array(
'Nomefab' => 'Nome Fabricante'
);function getCMSFields(){
return new FieldSet(
new TextField('Nomefab','Nome Fabricante'));
$managerpro = new ManyManyComplexTableField(
$this,
'Produtos',
'Produto',
array('Nome'=>'Nome'),
'getCMSFields_forPopup' );
//$f->removeFieldFromTab('Root', 'Fabricantes'); //
$f->addFieldToTab('Root.Fabricantes', $managerpro);}
}
?> -
Re: Create a HasOneComplexTable or HasMany in Dataobject?

30 December 2010 at 5:38am
Since you're in the DataObjectManager forum, I have to recommend that you change "ManyManyComplexTableField" to "ManyManyDataObjectManager"
-
Re: Create a HasOneComplexTable or HasMany in Dataobject?

30 December 2010 at 11:53pm
yes... that's worked!!
wonderful.... but i have other problem... in myCrm...the interface appears unconfigured and dataobject gives errors... not save for example....
| 755 Views | ||
|
Page:
1
|
Go to Top |

