Source of file FaqSection.php
Size: 1,141 Bytes - Last Modified: 2021-12-23T10:05:47+00:00
/var/www/docs.ssmods.com/process/src/code/FaqSection.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | <?php /** * Represents a single faq section object. * * @package advancedfaq */ class FaqSection extends DataObject { private static $db = array( 'Title' => 'Varchar(100)', 'SortOrder'=>'Int' ); public static $default_sort='SortOrder'; private static $has_one = array( 'FaqPage' => 'FaqPage' ); private static $has_many = array( 'Faqs' => 'Faq' ); private static $extensions = array( "Versioned('Stage', 'Live')" ); private static $summary_fields = array( 'Title' ); /* * Modify the default fields shown to the user */ public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('Title')); $fields->removeByName('FaqPageID'); $fields->removeByName('Faqs'); $fields->removeByName('SortOrder'); return $fields; } /** allow all users for crud operations **/ public function canView($member = null) { return true; } public function canEdit($member = null) { return true; } public function canDelete($member = null) { return true; } public function canCreate($member = null) { return true; } } |