本文整理汇总了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());
}