コード例 #1
0
ファイル: Queue.php プロジェクト: aoepeople/aoe_queue
 /**
  * Constructor
  * 
  * @param  string $queueName
  * 
  * @throws Mage_Core_Exception If $queueName is not a string
  */
 public function __construct($queueName = 'default')
 {
     if (empty($queueName)) {
         $queueName = 'default';
     }
     if (!is_string($queueName)) {
         Mage::throwException('Invalid queueName');
     }
     /** @var Mage_Core_Model_Resource $resource */
     $resource = Mage::getModel('core/resource');
     /** @var Varien_Db_Adapter_Interface $connection */
     $connection = $resource->getConnection(Mage_Core_Model_Resource::DEFAULT_WRITE_RESOURCE);
     $config = array('name' => $queueName, 'messageClass' => 'Aoe_Queue_Model_Message', 'dbAdapter' => $connection, 'dbQueueTable' => $resource->getTableName('aoe_queue/queue'), 'dbMessageTable' => $resource->getTableName('aoe_queue/message'));
     parent::__construct($config);
     /** @var Aoe_Queue_Model_Adapter_Db $adapter */
     $adapter = Mage::getModel('aoe_queue/adapter_db', $this->getOptions());
     $this->setAdapter($adapter);
 }