function delete($flush = false)
 {
     $this->checkPermission('remove');
     // ($originType, $originId, $destinationType, $destinationId, $metadata)
     $ruid = RequestEventOccurrence::generateRequestUid($this->event->getClassName(), $this->event->id, $this->space->getClassName(), $this->space->id, ['event_occurrence_id' => $this->id, 'rule' => $this->rule]);
     $requests = App::i()->repo('RequestEventOccurrence')->findBy(['requestUid' => $ruid]);
     foreach ($requests as $r) {
         $r->delete($flush);
     }
     parent::delete($flush);
 }
 function findByEventOccurrence(Entities\EventOccurrence $occ)
 {
     $request_uid = Entities\RequestEventOccurrence::generateRequestUid($occ->event->className, $occ->event->id, $occ->space->className, $occ->space->id, ['event_occurrence_id' => $occ->id, 'rule' => $occ->rule]);
     return $this->findBy(['requestUid' => $request_uid]);
 }