You added a $has_many inside the DataObjectManager class? It's a form field, not a model.
---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com
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
You added a $has_many inside the DataObjectManager class? It's a form field, not a model.
---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com
hmm... I added only a model in my class, then I do not understand what and where to add more.
I have a class BookPage extends Page and Book extends DataObject
In class Book I added:
static $has_many = array (
'LinkComment' => 'DataObjectComment'
)
in class BookPage_Controller added function:
function DataObjectComment () (
$Obj = DataObject::get_one ("Book", 'ID ='. Convert::raw2sql ((int) $this->urlParams['ID']));
return new DataObjectCommentInterface ($obj, 'DataObjectComments', $obj-> data ());
)
in Template i use $DataObjectComment and see Comments and form post, but he not work
I really do not know how to get to work. Maybe someone can give me an example for the study?
no anyone easy example?
Hi freenet,
have you solved your issue? If yes, can you help me with the same problem?
my issue is explained here..
http://www.silverstripe.org/dataobjectmanager-module-forum/show/19101
thanks