Exemplo n.º 1
0
 /**
  * Adds a middleware to the middleware list. The higher priority value, the earlier a middleware
  * will be triggered in the chain (defaults to 0).
  *
  * @param MiddlewareInterface $middleware
  * @param int                 $priority
  */
 public function addMiddleware(MiddlewareInterface $middleware, $priority = 0)
 {
     if (!$this->middlewares->containsKey($priority)) {
         $this->middlewares->set($priority, new ArrayList());
     }
     /** @var ArrayList $middlewares */
     $middlewares = $this->middlewares->get($priority);
     if ($middlewares->findOne(Criteria::eq($middleware)) === null) {
         $middlewares->add($middleware);
     }
 }
Exemplo n.º 2
0
 /**
  * @param Migration $migration
  */
 public function persist(Migration $migration)
 {
     $this->store->set($migration->version()->__toString(), $migration);
 }