Пример #1
0
 /**
  * Prepare a command for sending and get the RequestInterface object created by the command
  *
  * @param CommandInterface $command Command to prepare
  *
  * @return RequestInterface
  */
 protected function prepareCommand(CommandInterface $command)
 {
     // Set the client and prepare the command
     $request = $command->setClient($this)->prepare();
     // Set the state to new if the command was previously executed
     $request->setState(RequestInterface::STATE_NEW);
     $this->dispatch('command.before_send', array('command' => $command));
     return $request;
 }