Source for file GetAttributesResponse.php

Documentation is available at GetAttributesResponse.php

  1. <?php
  2. /** 
  3.  *  PHP Version 5
  4.  *
  5.  *  @category    Amazon
  6.  *  @package     Amazon_SimpleDB
  7.  *  @copyright   Copyright 2008 Amazon Technologies, Inc.
  8.  *  @link        http://aws.amazon.com
  9.  *  @license     http://aws.amazon.com/apache2.0  Apache License, Version 2.0
  10.  *  @version     2007-11-07
  11.  */
  12. /******************************************************************************* 
  13.  *    __  _    _  ___ 
  14.  *   (  )( \/\/ )/ __)
  15.  *   /__\ \    / \__ \
  16.  *  (_)(_) \/\/  (___/
  17.  * 
  18.  *  Amazon Simple DB PHP5 Library
  19.  *  Generated: Thu Aug 28 06:20:51 PDT 2008
  20.  * 
  21.  */
  22.  
  23. /**
  24.  *  @see Amazon_SimpleDB_Model
  25.  */
  26. require_once ('Amazon/SimpleDB/Model.php');  
  27.  
  28.     
  29.  
  30. /**
  31.  * Amazon_SimpleDB_Model_GetAttributesResponse
  32.  * 
  33.  * Properties:
  34.  * <ul>
  35.  * 
  36.  * <li>GetAttributesResult: Amazon_SimpleDB_Model_GetAttributesResult</li>
  37.  * <li>ResponseMetadata: Amazon_SimpleDB_Model_ResponseMetadata</li>
  38.  *
  39.  * </ul>
  40.  */ 
  41. {
  42.  
  43.  
  44.     /**
  45.      * Construct new Amazon_SimpleDB_Model_GetAttributesResponse
  46.      * 
  47.      * @param mixed $data DOMElement or Associative Array to construct from.
  48.      * 
  49.      *  Valid properties:
  50.      *  <ul>
  51.      * 
  52.      *  <li>GetAttributesResult: Amazon_SimpleDB_Model_GetAttributesResult</li>
  53.      *  <li>ResponseMetadata: Amazon_SimpleDB_Model_ResponseMetadata</li>
  54.      *
  55.      *  </ul>
  56.      */
  57.     public function __construct($data null)
  58.     {
  59.         $this->_fields = array (
  60.         'GetAttributesResult' => array('FieldValue' => null'FieldType' => 'Amazon_SimpleDB_Model_GetAttributesResult'),
  61.         'ResponseMetadata' => array('FieldValue' => null'FieldType' => 'Amazon_SimpleDB_Model_ResponseMetadata'),
  62.         );
  63.         parent::__construct($data);
  64.     }
  65.  
  66.        
  67.     /**
  68.      * Construct Amazon_SimpleDB_Model_GetAttributesResponse from XML string
  69.      * 
  70.      * @param string $xml XML string to construct from
  71.      * @return Amazon_SimpleDB_Model_GetAttributesResponse 
  72.      */
  73.     public static function fromXML($xml)
  74.     {
  75.         $dom new DOMDocument();
  76.         $dom->loadXML($xml);
  77.         $xpath new DOMXPath($dom);
  78.         $xpath->registerNamespace('a''http://sdb.amazonaws.com/doc/2007-11-07/');
  79.         $response $xpath->query('//a:GetAttributesResponse');
  80.         if ($response->length == 1{
  81.             return new Amazon_SimpleDB_Model_GetAttributesResponse(($response->item(0)))
  82.         else {
  83.             throw new Exception ("Unable to construct Amazon_SimpleDB_Model_GetAttributesResponse from provided XML. 
  84.                                   Make sure that GetAttributesResponse is a root element");
  85.         }
  86.           
  87.     }
  88.     
  89.     /**
  90.      * Gets the value of the GetAttributesResult.
  91.      * 
  92.      * @return GetAttributesResult GetAttributesResult
  93.      */
  94.     public function getGetAttributesResult(
  95.     {
  96.         return $this->_fields['GetAttributesResult']['FieldValue'];
  97.     }
  98.  
  99.     /**
  100.      * Sets the value of the GetAttributesResult.
  101.      * 
  102.      * @param GetAttributesResult GetAttributesResult
  103.      * @return void 
  104.      */
  105.     public function setGetAttributesResult($value
  106.     {
  107.         $this->_fields['GetAttributesResult']['FieldValue'$value;
  108.         return;
  109.     }
  110.  
  111.     /**
  112.      * Sets the value of the GetAttributesResult  and returns this instance
  113.      * 
  114.      * @param GetAttributesResult $value GetAttributesResult
  115.      * @return Amazon_SimpleDB_Model_GetAttributesResponse instance
  116.      */
  117.     public function withGetAttributesResult($value)
  118.     {
  119.         $this->setGetAttributesResult($value);
  120.         return $this;
  121.     }
  122.  
  123.  
  124.     /**
  125.      * Checks if GetAttributesResult  is set
  126.      * 
  127.      * @return bool true if GetAttributesResult property is set
  128.      */
  129.     public function isSetGetAttributesResult()
  130.     {
  131.         return !is_null($this->_fields['GetAttributesResult']['FieldValue']);
  132.  
  133.     }
  134.  
  135.     /**
  136.      * Gets the value of the ResponseMetadata.
  137.      * 
  138.      * @return ResponseMetadata ResponseMetadata
  139.      */
  140.     public function getResponseMetadata(
  141.     {
  142.         return $this->_fields['ResponseMetadata']['FieldValue'];
  143.     }
  144.  
  145.     /**
  146.      * Sets the value of the ResponseMetadata.
  147.      * 
  148.      * @param ResponseMetadata ResponseMetadata
  149.      * @return void 
  150.      */
  151.     public function setResponseMetadata($value
  152.     {
  153.         $this->_fields['ResponseMetadata']['FieldValue'$value;
  154.         return;
  155.     }
  156.  
  157.     /**
  158.      * Sets the value of the ResponseMetadata  and returns this instance
  159.      * 
  160.      * @param ResponseMetadata $value ResponseMetadata
  161.      * @return Amazon_SimpleDB_Model_GetAttributesResponse instance
  162.      */
  163.     public function withResponseMetadata($value)
  164.     {
  165.         $this->setResponseMetadata($value);
  166.         return $this;
  167.     }
  168.  
  169.  
  170.     /**
  171.      * Checks if ResponseMetadata  is set
  172.      * 
  173.      * @return bool true if ResponseMetadata property is set
  174.      */
  175.     public function isSetResponseMetadata()
  176.     {
  177.         return !is_null($this->_fields['ResponseMetadata']['FieldValue']);
  178.  
  179.     }
  180.  
  181.  
  182.  
  183.     /**
  184.      * XML Representation for this object
  185.      * 
  186.      * @return string XML for this object
  187.      */
  188.     public function toXML(
  189.     {
  190.         $xml "";
  191.         $xml .= "<GetAttributesResponse xmlns=\"http://sdb.amazonaws.com/doc/2007-11-07/\">";
  192.         $xml .= $this->_toXMLFragment();
  193.         $xml .= "</GetAttributesResponse>";
  194.         return $xml;
  195.     }
  196.  
  197. }

Documentation generated on Thu, 28 Aug 2008 06:35:49 -0700 by phpDocumentor 1.4.2