Source of file Rooms.php
Size: 1,010 Bytes - Last Modified: 2021-12-23T10:02:49+00:00
/var/www/docs.ssmods.com/process/src/code/dataobjects/Rooms.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | <?php class Rooms extends DataObject{ private static $db = array( 'Name' => 'Varchar', 'Introduction' => 'Text', ); private static $has_one = array( 'Resort' => 'ResortPage', 'Safari' => 'SafariPage', 'CityHotel' => 'CityHotelPage' ); private static $many_many = array( 'RoomImages' => 'Image' ); private static $singular_name = "Room"; private static $plural_name = "Rooms"; public function getCMSFields(){ $fields = parent::getCMSFields(); $fields->removeByName("ResortID"); $fields->removeByName("SafariID"); $fields->removeByName("CityHotelID"); $fields->removeFieldFromTab("Root", "RoomImages"); $fields->dataFieldByName('Name')->SetTitle('Room Name'); $fields->addFieldToTab( 'Root.Main', $uploadField = new uploadField( $name = "RoomImages", $title = "Upload one or more images (max 10 in total)" ) ); $uploadField->setAllowedMaxFileNumber(10); return $fields; } } ?> |