private function processActiveHook(AJXP_Notification $notification, $namespace, $parentActionType = null)
 {
     $origNode = $notification->getNode();
     $node = new AJXP_Node($origNode->getUrl());
     $all = $this->collectWatches($node, $namespace);
     if ($node->isRoot() && $node->getRepository() !== null && $node->getRepository()->hasContentFilter()) {
         $node->setLeaf(true);
     } else {
         $node->setLeaf(false);
     }
     foreach ($all["node"] as $id) {
         $this->notificationCenter->postNotification($notification, $id);
     }
     foreach ($all["ancestors"] as $pair) {
         $parentNotification = new AJXP_Notification();
         /**
          * @var AJXP_Node $parentNode
          */
         $parentNode = $pair["node"];
         if ($parentNode->isRoot() && $parentNode->getRepository() !== null && $parentNode->getRepository()->hasContentFilter()) {
             $parentNode->setLeaf(true);
         } else {
             $parentNode->setLeaf(false);
         }
         $parentNotification->setNode($parentNode);
         if ($parentActionType == null) {
             $parentNotification->setAction($notification->getAction());
         } else {
             $parentNotification->setAction($parentActionType);
         }
         $this->notificationCenter->prepareNotification($notification);
         $parentNotification->addRelatedNotification($notification);
         $this->notificationCenter->postNotification($parentNotification, $pair["id"]);
     }
 }
 public function processReadHook(AJXP_Node $node)
 {
     $ids = $this->getWatchesOnNode($node, self::$META_WATCH_READ);
     $notif = new AJXP_Notification();
     $notif->setAction(AJXP_NOTIF_NODE_VIEW);
     $notif->setNode($node);
     if (count($ids)) {
         foreach ($ids as $id) {
             $this->notificationCenter->postNotification($notif, $id);
         }
     }
     if (!$node->isRoot()) {
         $parentNode = new AJXP_Node(dirname($node->getUrl()));
         $parentNode->setLeaf(false);
         $ids = $this->getWatchesOnNode($parentNode, self::$META_WATCH_READ);
         if (count($ids)) {
             // POST NOW : PARENT FOLDER IS AFFECTED
             $parentNotif = new AJXP_Notification();
             $parentNotif->setNode($parentNode);
             $parentNotif->setAction(AJXP_NOTIF_NODE_VIEW);
             $this->notificationCenter->prepareNotification($notif);
             $parentNotif->addRelatedNotification($notif);
             foreach ($ids as $id) {
                 $this->notificationCenter->postNotification($parentNotif, $id);
             }
         }
     }
 }
 private function processActiveHook(AJXP_Notification $notification, $namespace, $parentActionType = null)
 {
     $node = $notification->getNode();
     $all = $this->collectWatches($node, $namespace);
     foreach ($all["node"] as $id) {
         $this->notificationCenter->postNotification($notification, $id);
     }
     foreach ($all["ancestors"] as $pair) {
         $parentNotification = new AJXP_Notification();
         $parentNotification->setNode($pair["node"]);
         $parentNotification->getNode()->setLeaf(false);
         if ($parentActionType == null) {
             $parentNotification->setAction($notification->getAction());
         } else {
             $parentNotification->setAction($parentActionType);
         }
         $this->notificationCenter->prepareNotification($notification);
         $parentNotification->addRelatedNotification($notification);
         $this->notificationCenter->postNotification($parentNotification, $pair["id"]);
     }
 }