em = $em; parent::__construct(); } protected function configure() { $this->setName('warrantyserial:count') ->setDescription('Count number of pending warranty serial files.') ->setHelp('Count number of pending warranty serial files.'); } protected function execute(InputInterface $input, OutputInterface $output) { $em = $this->em; $status = 'pending'; $db = $em->getConnection(); $ws_query_sql = 'SELECT COUNT(*) AS total FROM warranty_serial_queue WHERE status = :status'; $ws_query_stmt = $db->prepare($ws_query_sql); $ws_query_stmt->bindValue('status', $status); $ws_results = $ws_query_stmt->executeQuery(); $results = $ws_results->fetchAssociative(); $output->write($results['total']); return 0; } }