コード例 #1
0
 /**
  * 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
0
 /**
  * {@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
0
 /**
  * {@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
0
ファイル: AbstractVisitor.php プロジェクト: dh-open/desk-php
 /**
  * {@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
0
 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
0
ファイル: XmlVisitor.php プロジェクト: Ryu0621/SaNaVi
public function before(CommandInterface $command, array &$result)
{

 $result = json_decode(json_encode($command->getResponse()->xml()), true);
}
コード例 #7
0
ファイル: JsonVisitor.php プロジェクト: jorjoh/Varden
 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
0
ファイル: JsonVisitor.php プロジェクト: Ryu0621/SaNaVi
 public function before(CommandInterface $command, array &$result)
 {
     $result = $command->getResponse()->json();
 }
コード例 #9
0
 /**
  * {@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());
 }