duanjia7607 2011-06-21 20:33
浏览 32
已采纳

Zend Queue数据库架构

I'm using Zend_Queue to queue and send out emails (http://framework.zend.com/manual/en/zend.queue.adapters.html)

Is there a way to modify the Zend_Queue_Adapter_Db default table names? By default, the table names are "queue" & "message" which are a little confusing and I would like to name them queues and queues_messages.

  • 写回答

1条回答 默认 最新

  • dongzhan5943 2011-06-21 20:55
    关注

    Those table names appear to be hardcoded as default property values with no built-in mutators, but you can probably override Zend_Queue_Adapter_Db to do your bidding. This code is untested, but something like the following:

    class My_Queue_Adapter_Db extends Zend_Queue_Adapter_Db
    {
        public function __construct($options, Zend_Queue $queue = null)
        {
            parent::__construct($options, $queue);
            if (isset($options['queueTableName']) {
                $this->_queueTable->setOptions(
                    array(Zend_Db_Table_Abstract::NAME => $options['queueTableName'])
                );
            }
        }
    }
    

    Then just pass a 'queueTableName' property to the constructor. Same principles applies to the _messageTable property.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?