/** * 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; }
/** * 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; }