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

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • 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
  • 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
  • ForeignKey
  • Hierarchy
  • HTMLText
  • HTMLVarchar
  • ImportLog_Item
  • Int
  • ManagerEmailOrderNotification
  • Material3D_File
  • MediawebPage_File
  • MediawebPage_Photo
  • MobileContentDecorator
  • Money
  • MultiEnum
  • MySQLDatabase
  • MySQLQuery
  • OrderDataObject
  • OrderHandlersDecorator
  • OrderItemVariationDecorator
  • OrderService
  • OrderServiceOrder
  • OrdersExportDecorator
  • PageIcon
  • PageWidgets
  • Payment
  • PaymentMethodShippingDecorator
  • PaymentOrderExtension
  • Percentage
  • PhotoAlbumItem
  • PhotoAlbumProductLinkDecorator
  • PhotoAlbumWidgetLinkDecorator
  • PhotoGalleryHomepageWidget_Item
  • PrimaryKey
  • Product3DDecorator
  • ProductCatalogCatalogLinkedDecorator
  • 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  * A DataObjectLog is a log of changes that have been made to the database in this session.
  4  * It was designed to help with updates to the CMS tree, and could be used wherever an Ajax call 
  5  * needs to update a complex on-screen representation of your data.
  6  * @package sapphire
  7  * @subpackage model
  8  */
  9 class DataObjectLog extends Object {
 10     /**
 11      * This must be set to true for the DataObjectLog to work
 12      */
 13     static $enabled = false;
 14     
 15     
 16     /**
 17      * The DataObjects that have been added to the database in this session.
 18      * @var array
 19      */
 20     static $added = array();
 21     
 22     /**
 23      * The DataObjects that have been deleted from the database in this session.
 24      * @var array
 25      */
 26     static $deleted = array();
 27     
 28     /**
 29      * The DataObjects that have been changed in the database in this session.
 30      */
 31     static $changed = array();
 32     
 33     /**
 34      * Add this DataObject as added in the log.
 35      * @param DataObject $object
 36      */
 37     static function addedObject($object) {
 38         if(self::$enabled) {
 39             self::$added[$object->class][] = $object;
 40         }
 41     }
 42     
 43     /**
 44      * Add this DataObject as deleted in the log.
 45      * @param DataObject $object
 46      */
 47     static function deletedObject($object) {
 48         if(self::$enabled) {
 49             self::$deleted[$object->class][] = $object; 
 50         }
 51     }
 52     
 53     /**
 54      * Add this DataObject as changed in the log.
 55      * @param DataObject $object
 56      */
 57     static function changedObject($object) {
 58         if(self::$enabled) {
 59             self::$changed[$object->class][] = $object;
 60         }
 61     }
 62     
 63     /**
 64      * Get all DataObjects that have been added this session that are of
 65      * the class or a subclass of the class provided.
 66      * @param string $className The class name.
 67      * @return array
 68      */
 69     static function getAdded($className) {
 70         return self::getByClass($className, self::$added);
 71     }
 72     
 73     /**
 74      * Get all DataObjects that have been deleted this session that are of
 75      * the class or a subclass of the class provided.
 76      * @param string $className The class name.
 77      * @return array
 78      */
 79     static function getDeleted($className) {
 80         return self::getByClass($className, self::$deleted);
 81     }
 82     
 83     /**
 84      * Get all DataObjects that have been changed this session that are of
 85      * the class or a subclass of the class provided.
 86      * @param string $className The class name.
 87      * @return array
 88      */
 89     static function getChanged($className) {
 90         return self::getByClass($className, self::$changed);
 91     }
 92     
 93     /**
 94      * Get all DataObjects in the given set that are of the class or a
 95      * subclass of the class provided.
 96      * @param string $className The class name.
 97      * @param array $set The set to search in.
 98      * @return array
 99      */
100     static function getByClass($className, $set) {
101         $allClasses = ClassInfo::subclassesFor($className);
102         foreach($allClasses as $subClass) {
103             if(isset($set[$subClass])) {
104                 foreach($set[$subClass] as $page) {
105                     $result[$page->ID] = $page;
106                 }
107             }
108         }
109         return isset($result) ? $result : null;
110     }
111 }
112 
113 ?>
[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.1 API Docs API documentation generated by ApiGen 2.8.0