コード例 #1
0
 function onBeforeWrite()
 {
     // Move to Photo Gallery Holder if created under something else
     if ($this->Parent()->ClassName != "PhotoGalleryHolder" && PhotoGalleryHolder::get()->count() > 0) {
         $this->ParentID = PhotoGalleryHolder::get()->first()->ID;
     }
     parent::onBeforeWrite();
 }
コード例 #2
0
 function ChildHolders()
 {
     return PhotoGalleryHolder::get()->filter(array("ParentID" => $this->ID));
 }