소스 검색

* Populate the internal queue array when getQueues() is called
* Remove the chosen queue name when delete() is called from the internal queue array


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18421 44c647ce-9c0f-0410-b52a-842ac1e357ba

jplock 16 년 전
부모
커밋
ce02cc5668
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      library/Zend/Queue/Adapter/Db.php

+ 8 - 2
library/Zend/Queue/Adapter/Db.php

@@ -250,6 +250,10 @@ class Zend_Queue_Adapter_Db extends Zend_Queue_Adapter_AdapterAbstract
             }
         }
 
+        if (array_key_exists($name, $this->_queues)) {
+            unset($this->_queues[$name]);
+        }
+
         return true;
     }
 
@@ -267,11 +271,13 @@ class Zend_Queue_Adapter_Db extends Zend_Queue_Adapter_AdapterAbstract
         $query = $this->_queueTable->select();
         $query->from($this->_queueTable, array('queue_id', 'queue_name'));
 
-        $list = array();
+        $this->_queues = array();
         foreach ($this->_queueTable->fetchAll($query) as $queue) {
-            $list[] = $queue->queue_name;
+            $this->_queues[$queue->queue_name] = (int)$queue->queue_id;
         }
 
+        $list = array_keys($this->_queues);
+
         return $list;
     }