本文整理匯總了PHP中Guzzle\Service\Command\CommandInterface::getResponse方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommandInterface::getResponse方法的具體用法?PHP CommandInterface::getResponse怎麽用?PHP CommandInterface::getResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Guzzle\Service\Command\CommandInterface
的用法示例。
在下文中一共展示了CommandInterface::getResponse方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fromCommand
/**
* Create a new model instance from a command.
*
* @param CommandInterface
* @return array
*/
public static function fromCommand(CommandInterface $command)
{
$file = new self();
$file->setParameters($command->getResponse()->json() + array('path' => $command['path']));
$file->finishUpload();
return $file->getParameters();
}
示例2: factory
/**
* {@inheritdoc}
*/
public function factory(CommandInterface $originalCommand, array $data)
{
$command = $this->newCommand();
// set up embedded command
$command->setClient($originalCommand->getClient());
$originalResponse = $originalCommand->getResponse();
$response = $this->createResponse($originalResponse, $data);
$command->setResponse($response);
return $command;
}
示例3: before
/**
* {@inheritdoc}
*/
public function before(CommandInterface $command, array &$result)
{
$json = $command->getResponse()->json();
// store links to use later
if (array_key_exists(self::ELEMENT, $json)) {
$this->set($command, 'links', $json[self::ELEMENT]);
}
// create new array of links which visit() adds to
$result[self::ELEMENT] = array();
}
示例4: before
/**
* {@inheritdoc}
*/
public function before(CommandInterface $command, array &$result)
{
$json = $command->getResponse()->json();
// store links to use later
if (array_key_exists($this->getOutputFieldName(), $json)) {
$this->set($command, $this->getFieldName(), $json[$this->getOutputFieldName()]);
}
// create new array of links which visit() adds to
$result[$this->getOutputFieldName()] = array();
}
示例5: before
public function before(CommandInterface $command, array &$result)
{
// Set the result of the command to the array conversion of the XML body
$result = json_decode(json_encode($command->getResponse()->xml()), true);
}
示例6: before
public function before(CommandInterface $command, array &$result)
{
$result = json_decode(json_encode($command->getResponse()->xml()), true);
}
示例7: before
public function before(CommandInterface $command, array &$result)
{
// Ensure that the result of the command is always rooted with the parsed JSON data
$result = $command->getResponse()->json();
}
示例8: before
/**
* {@inheritdoc}
*/
public function before(CommandInterface $command, array &$result)
{
// Set the result of the command to the array conversion of the XML body
$result = get_object_vars($command->getResponse()->xml());
}