示例#1
0
 /**
  * Get an array of all available queues
  *
  * @return array
  */
 public function getQueues()
 {
     $queues = array();
     foreach ($this->_queue->fetchAll() as $queue) {
         $queues[] = $queue->queue_name;
     }
     return $queues;
 }
示例#2
0
文件: Db.php 项目: ki8asui/isography
 /**
  * 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;
 }
示例#3
0
 /**
  * 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];
 }