ZF\Console\Dispatcher::has PHP Метод

has() публичный Метод

{@inheritDoc}
public has ( $command )
    public function has($command)
    {
        return isset($this->commandMap[$command]);
    }

Usage Example

Пример #1
0
 /**
  * Map a route handler
  *
  * If a given route specification has a "handler" entry, and the dispatcher
  * does not currently have a handler for that command, map it.
  *
  * @param array $route
  */
 protected function mapRouteHandler(array $route)
 {
     if (!isset($route['handler'])) {
         return;
     }
     $command = $route['name'];
     if ($this->dispatcher->has($command)) {
         return;
     }
     $this->dispatcher->map($command, $route['handler']);
 }