Example #1
0
 public function onBeforeWrite()
 {
     if ($this->HasTagPage) {
         //create ILike Count only if HasTagPage is true
         if (!$this->ILikeCountID) {
             $ilikeCount = new ILikeCount();
             $ilikeCount->write();
             $this->ILikeCountID = $ilikeCount->ID;
         }
     }
     parent::onBeforeWrite();
 }
Example #2
0
 public function onBeforeWrite()
 {
     //create iLike Counter if it does not yet exist
     if (!$this->ILikeCountID) {
         $ILikeCount = ILikeCount::create();
         $ILikeCount->Count = $this->ILikeCountCount;
         $ILikeCount->write();
         $this->ILikeCountID = $ILikeCount->ID;
     }
     //edit iLine Counter Count directly via TextField
     if ($this->ILikeCountCount) {
         // update existing relation
         $ILikeCount = $this->ILikeCount();
         $ILikeCount->Count = $this->ILikeCountCount;
         $ILikeCount->write();
     }
     parent::onBeforeWrite();
 }