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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba
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
Sounds like you want a nested DataObjectManager?
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com
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!!
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);
}
}
?>
Since you're in the DataObjectManager forum, I have to recommend that you change "ManyManyComplexTableField" to "ManyManyDataObjectManager" :)
yes... that's worked!!
wonderful.... but i have other problem... in myCrm...
the interface appears unconfigured and dataobject gives errors... not save for example....