/** * This method declares a new exchange * * @param Options $options * * @return $this - Channel - Provides fluent interface */ public function declareExchange(Options $options) { $this->exchangeOptions = $options; $this->exchange_declare($this->exchangeOptions->getName(), $this->exchangeOptions->getType(), $this->exchangeOptions->getPassive(), $this->exchangeOptions->getDurable(), $this->exchangeOptions->getAutoDelete(), $this->exchangeOptions->getInternal(), $this->exchangeOptions->getNowait(), $this->exchangeOptions->getArguments(), $this->exchangeOptions->getTicket()); return $this; }
/** * This method declares a new queue * * @param Options $options * * @return string */ public function declareQueue(Options $options) { $queue = $this->queue_declare($options->getName(), $options->getPassive(), $options->getDurable(), $options->getExclusive(), $options->getAutoDelete(), $options->getNowait(), $options->getArguments(), $options->getTicket()); if (!empty($queue)) { $queueName = array_shift($queue); } else { $queueName = $options->getName(); } return $queueName; }
/** * * @param Options $options * * @throws InvalidArgumentException * * @return $this Connection - Provides fluent interface */ public function setExchangeOptions(Options $options) { $name = $options->getName(); $type = $options->getType(); if (empty($name)) { throw new InvalidArgumentException('You must provide an exchange name'); } if (empty($type)) { throw new InvalidArgumentException('You must provide an exchange type'); } $this->exchangeOptions = $options; return $this; }