/** * @see EventDispatcherInterface::dispatch * * @api */ public function dispatch($eventName, sfEvent $event = null) { if (null !== $this->application) { $this->application->debug(sprintf('Dispatching `%s` event.', $eventName)); } return parent::dispatch($eventName, $event); }
/** * Clears cached data associated to the page to be flushed. * * @param \BackBee\Event\Event $event */ public function onFlushPage(Event $event) { // Checks if page caching is available $this->object = $event->getTarget(); if (false === $this->object instanceof Page || false === $this->checkCachePageEvent(false)) { return; } if (true === $this->page_cache_deletion_done) { return; } $pages = ScheduledEntities::getScheduledEntityUpdatesByClassname($this->application->getEntityManager(), 'BackBee\\NestedNode\\Page'); if (0 === count($pages)) { return; } $page_uids = array(); foreach ($pages as $page) { $page_uids[] = $page->getUid(); } $this->cache_page->removeByTag($page_uids); $this->page_cache_deletion_done = true; $this->application->debug(sprintf('Remove cache for `%s(%s)`.', get_class($this->object), implode(', ', $page_uids))); }
/** * [addRoute description]. * * @param [type] $name [description] * @param array $route [description] */ private function addRoute($name, array $route) { $this->raw_routes[$name] = $route; $this->add($name, new Route($route['pattern'], $route['defaults'], true === array_key_exists('requirements', $route) ? $route['requirements'] : array())); $this->application->debug(sprintf('Route `%s` with pattern `%s` defined.', $name, $route['pattern'])); }