示例#1
0
文件: Client.php 项目: NTASTE/YiiAMQP
 /**
  * Create a collection of exchanges for this connection
  * @param array $data the data for the exchanges, if any.
  *
  * @return ExchangeCollection the exchange collection
  */
 protected function createExchangeCollection($data = array())
 {
     $collection = new ExchangeCollection();
     $collection->setClient($this);
     $collection->copyFrom($data);
     return $collection;
 }
示例#2
0
文件: Client.php 项目: NTASTE/YiiAMQP
 /**
  * Sets the exchanges for this connection
  * @param \YiiAMQP\ExchangeCollection|array $exchanges
  */
 public function setExchanges($exchanges)
 {
     if ($exchanges instanceof ExchangeCollection) {
         $exchanges->setClient($this);
     } else {
         $exchanges = $this->createExchangeCollection($exchanges);
     }
     $this->_exchanges = $exchanges;
 }