/** * Get the queue ID * * Returns the queue's row identifier. * * @param string $name * @return integer|null * @throws Zend_Queue_Exception */ protected function getQueueId($name) { $query = $this->_queueTable->select(); $query->from($this->_queueTable, array('queue_id'))->where('queue_name=?', $name); $queue = $this->_queueTable->fetchRow($query); if ($queue === null) { require_once 'Zend/Queue/Exception.php'; throw new Zend_Queue_Exception('Queue does not exist: ' . $name); } return (int) $queue->queue_id; }
/** * Get the queue ID * * Returns the queue's row identifier. * * @param string $name * @return integer|null * @throws Zend_Queue_Exception */ protected function getQueueId($name) { if (array_key_exists($name, $this->_queues)) { return $this->_queues[$name]; } $query = $this->_queueTable->select(); $query->from($this->_queueTable, array('queue_id'))->where('queue_name=?', $name); $queue = $this->_queueTable->fetchRow($query); if ($queue === null) { throw new Zend_Queue_Exception('Queue does not exist: ' . $name); } $this->_queues[$name] = (int) $queue->queue_id; return $this->_queues[$name]; }