Webylon 3.2 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • 1c
    • exchange
      • catalog
  • auth
  • Booking
  • building
    • company
  • cart
    • shipping
    • steppedcheckout
  • Catalog
    • monument
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • AdditionalMenuWidget_Item
  • AdvancedSliderHomepageWidget_Item
  • AssetManagerFolder
  • BannerWidget_Item
  • BaseObjectDecorator
  • BookingOrder
  • BookingPaymentMethod
  • BookingService
  • Boolean
  • ButtonsBlockHomepageWidget_Item
  • CarouselHomepageWidget_Item
  • CatalogFilter
  • CatalogRubricsHomepageWidget_CatalogDecorator
  • ClientEmailOrderNotification
  • ClientVKOrderNotification
  • ComponentSet
  • Currency
  • DatabaseAdmin
  • DataObject
  • DataObjectDecorator
  • DataObjectLog
  • DataObjectSet
  • DataObjectSet_Iterator
  • Date
  • DB
  • DBField
  • Decimal
  • DocumentItem
  • DocumentPage_File
  • Double
  • Enum
  • ErrorPageSubsite
  • FileDataObjectTrackingDecorator
  • FileImportDecorator
  • Float
  • FlowerGarden_Size
  • ForeignKey
  • Hierarchy
  • HouseCatalogProductDecorator
  • HTMLText
  • HTMLVarchar
  • Import1CLog
  • Import1CLog_File
  • Import1CLog_Item
  • Import1CLog_Task
  • ImportCatalog1C_PriceType
  • ImportCatalog1C_ProductProp
  • Int
  • ManagerEmailOrderNotification
  • Material3D_File
  • MediawebPage_File
  • MediawebPage_Photo
  • MobileContentDecorator
  • Money
  • MonumentGalleryItem
  • MonumentPhotoGallery
  • MultiEnum
  • MySQLDatabase
  • MySQLQuery
  • Notification
  • OrderDataObject
  • OrderDecorator
  • OrderHandlersDecorator
  • OrderItemDecorator
  • OrderItemVariationDecorator
  • Orders1CExchange_OrdersDecorator
  • OrderService
  • OrderServiceOrder
  • PageIcon
  • PageWidgets
  • Payment
  • PaymentMethodShippingDecorator
  • PaymentOrderExtension
  • Percentage
  • Person
  • PhotoAlbumItem
  • PhotoAlbumProductLinkDecorator
  • PhotoAlbumWidgetLinkDecorator
  • PhotoGalleryHomepageWidget_Item
  • PortraitType
  • PrimaryKey
  • Product3DDecorator
  • ProductCatalogCatalogLinkedDecorator
  • ProductImportLog
  • ProductImportLog_Item
  • ProductParam
  • ProductParamValue
  • ProductVariation
  • RatePeriod
  • RealtyImportLog
  • RealtyImportLog_Item
  • RedirectEntry
  • RoomOrder
  • RoomOrderPerson
  • RoomRate
  • RoomService
  • RoomServiceOrder
  • SberbankPaymentDecorator
  • SeoOpenGraphPageDecorator
  • ServiceOrder
  • ShippingMethodPaymentDecorator
  • ShopCountry
  • SimpleOrderCatalogDecorator
  • SimpleOrderProductDecorator
  • SiteConfigWidgets
  • SiteTreeDecorator
  • SiteTreeImportDecorator
  • SliderHomepageWidget_Item
  • SMSCOrderNotification
  • SMSOrderNotification
  • SortableDataObject
  • SQLMap
  • SQLMap_Iterator
  • SQLQuery
  • SS_Database
  • SS_Datetime
  • SS_Query
  • StringField
  • SubsiteDomain
  • Text
  • TextAnonsWidget_Item
  • Texture3D_File
  • Time
  • Varchar
  • Versioned
  • Versioned_Version
  • VideoCategory
  • VideoEntry
  • VKNotificationQueue
  • WebylonWidget_Item
  • YaMoneyPaymentDecorator
  • Year

Interfaces

  • CompositeDBField
  • CurrentPageIdentifier
  • DataObjectInterface
 1 <?php
 2 
 3 class VideoEntry extends DataObject {
 4 
 5     static $db = array(
 6         'Title' => 'Text',
 7         'Description' => 'Text',
 8         'Lenght' => 'Varchar(7)',
 9         'Source' => 'Varchar(255)',
10         'SourceLink' => 'Varchar(255)'
11     );
12     static $has_one = array(
13         'SourceVideo' => 'VideoFile',
14         'PreviewImage' => 'Image',
15         'VideoCategory' => 'VideoCategory',
16         'VideoBankPage' => 'VideoBankPage',
17     );
18     static $casting = array(
19         'Video' => 'HTMLText'
20     );
21 
22     /*
23      * Ссылка на видео
24      */
25 
26     function Link() {
27         return VideoBankPage::find_root_link() . 'show/' . $this->ID;
28     }
29 
30     function Video() {
31         $sc = SiteConfig::current_site_config();
32         $width = $sc->VideoWidth;
33         $height = $sc->VideoHeight;
34         if ($this->PreviewImageID != 0 && $this->PreviewImage()->ID != 0) {
35             $img = $this->PreviewImage();
36         } else {
37             $img = $this->SourceVideo()->VideoThumbnail();
38         }
39         $img = $img->CroppedImage($width, $height)->URL;
40         return "<a href=\"" . $this->SourceVideo()->URL . "\" style=\"display:block;width:" . $width . "px;height:" . $height . "px;\" class=\"modern-light\"><img src=\"" . $img . "\" alt=\"" . $this->Title . "\" /></a>";
41     }
42 
43     function Value(){
44         return $this->Title;
45     }
46 
47     function getCMSFields($params = null) {
48         $fields = parent::getCMSFields($params);
49         $fields->removeByName('SortOrder');
50         return $fields;
51     }
52 
53     function getCMSFields_forPopup() {
54         $fields = parent::getCMSFields();
55         $fields->removeByName('SortOrder');
56         $fields->replaceField('Title', new TextField('Title', $this->fieldLabel('Title')));
57         $fields->replaceField('PreviewImage', new ImageField('PreviewImage', _t('VideoEntry.has_one_PreviewImage','Preview Image')));
58         return $fields;
59     }
60 
61     static function get_by_id($id, $cache = true) {
62         $callerClass = 'VideoEntry';
63         $item = DataObject::get_by_id($callerClass, $id, $cache);
64         return $item;
65     }
66 
67     static function get($filter="",$sort = "", $limit = "") {
68         $callerClass = 'VideoEntry';
69         $join = "";
70         return DataObject::get($callerClass, $filter, $sort, $join, $limit);
71     }
72     
73     function onBeforeDelete() {     
74         if ($this->SourceVideo()->ID) {         
75             $this->SourceVideo()->delete();         
76         }   
77         if ($this->PreviewImage()->ID) {            
78             $this->PreviewImage()->delete();            
79         }       
80         parent::onBeforeDelete();
81     }
82 }
83 
84 ?>
85 
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.2 API Docs API documentation generated by ApiGen 2.8.0