Jump to:

23471 Posts in 18937 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Add form field datetime with many_many table

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 223 Views
  • khanhdeux
    Avatar
    Community Member
    13 Posts

    Add form field datetime with many_many table Link to this post

    Hi team,
    i have the following dataobjects

    class Video extends DataObject {

    private static $belongs_many_many = array(
    'Channels' => 'Channel',
    );

    );

    class Channel extends DataObject {

    private static $db = array(
    'ChannelTitle' => 'Varchar(255)',
    'ChannelDescription' => 'Text'
    );
    private static $many_many = array(
    'Videos' => 'Video'
    );
    private static $summary_fields = array(
    'ChannelTitle'
    );
    private static $many_many_extraFields = array(
    'Videos' => array(
    'PublishedDate' => 'SS_Datetime',
    'UnpublishedDate' => 'SS_Datetime'
    )
    );

    }
    The relation between video and channel is many_many
    now i have to add a form to submit the publishedDate and unpublisheddate for the specific channels. what is the datefields and variable suitable name for its like i have Channel: youtube, smarttv, tablets.. and add 2 above fields to set to each channel for a video. Thanks

    223 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.