Exemple #1
0
 /**
  * Faz o parse de um campo <queue>
  * @param SimpleXMLElement $element
  */
 protected function parseQueue($element)
 {
     $i18n = Zend_Registry::get('i18n');
     $form_element = new Zend_Form_Element_Select((string) $element->id);
     $form_element->setLabel((string) $i18n->translate("Queue"));
     foreach (Snep_Queues::getInstance()->getQueues() as $queue) {
         $form_element->addMultiOption($queue, $queue);
         if (isset($element->value) && $queue == $element->value) {
             $form_element->setValue($element->value);
         }
     }
     return $form_element;
 }
Exemple #2
0
 protected function registerQueues()
 {
     $db = Zend_Registry::get("db");
     $queues = Snep_Queues::getInstance();
     $select = $db->select()->from('queues');
     $stmt = $db->query($select);
     $result = $stmt->fetchAll();
     foreach ($result as $queue) {
         $queues->register($queue['name']);
     }
 }