web/lib/Zend/Service/Amazon/SimpleDb/Attribute.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Service_Amazon
    16  * @package    Zend_Service_Amazon
    17  * @subpackage SimpleDb
    17  * @subpackage SimpleDb
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Response.php 17539 2009-08-10 22:51:26Z mikaelkael $
    20  * @version    $Id: Response.php 17539 2009-08-10 22:51:26Z mikaelkael $
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @category   Zend
    24  * @category   Zend
    25  * @package    Zend_Service_Amazon
    25  * @package    Zend_Service_Amazon
    26  * @subpackage SimpleDb
    26  * @subpackage SimpleDb
    27  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    27  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    28  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    28  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    29  */
    29  */
    30 class Zend_Service_Amazon_SimpleDb_Attribute
    30 class Zend_Service_Amazon_SimpleDb_Attribute
    31 {
    31 {
    32     protected $_itemName;
    32     protected $_itemName;
    33     protected $_name;
    33     protected $_name;
    34     protected $_values;
    34     protected $_values;
    35 
    35 
    36     /**
    36     /**
    37      * Constructor
    37      * Constructor
    38      * 
    38      *
    39      * @param  string $itemName 
    39      * @param  string $itemName
    40      * @param  string $name 
    40      * @param  string $name
    41      * @param  array $values 
    41      * @param  array $values
    42      * @return void
    42      * @return void
    43      */
    43      */
    44     function __construct($itemName, $name, $values) 
    44     function __construct($itemName, $name, $values)
    45     {
    45     {
    46         $this->_itemName = $itemName;
    46         $this->_itemName = $itemName;
    47         $this->_name     = $name;
    47         $this->_name     = $name;
    48 
    48 
    49         if (!is_array($values)) {
    49         if (!is_array($values)) {
    51         } else {
    51         } else {
    52             $this->_values = $values;
    52             $this->_values = $values;
    53         }
    53         }
    54     }
    54     }
    55 
    55 
    56 	/**
    56     /**
    57      * Return the item name to which the attribute belongs
    57      * Return the item name to which the attribute belongs
    58      *
    58      *
    59      * @return string
    59      * @return string
    60      */
    60      */
    61     public function getItemName ()
    61     public function getItemName ()
    62     {
    62     {
    63         return $this->_itemName;
    63         return $this->_itemName;
    64     }
    64     }
    65 
    65 
    66 	/**
    66     /**
    67      * Retrieve attribute values
    67      * Retrieve attribute values
    68      *
    68      *
    69      * @return array
    69      * @return array
    70      */
    70      */
    71     public function getValues()
    71     public function getValues()
    72     {
    72     {
    73         return $this->_values;
    73         return $this->_values;
    74     }
    74     }
    75 
    75 
    76 	/**
    76     /**
    77      * Retrieve the attribute name
    77      * Retrieve the attribute name
    78      *
    78      *
    79      * @return string
    79      * @return string
    80      */
    80      */
    81     public function getName ()
    81     public function getName ()
    82     {
    82     {
    83         return $this->_name;
    83         return $this->_name;
    84     }
    84     }
    85     
    85 
    86     /**
    86     /**
    87      * Add value
    87      * Add value
    88      * 
    88      *
    89      * @param  mixed $value 
    89      * @param  mixed $value
    90      * @return void
    90      * @return void
    91      */
    91      */
    92     public function addValue($value)
    92     public function addValue($value)
    93     {
    93     {
    94         if (is_array($value)) {
    94         if (is_array($value)) {
    95              $this->_values += $value;   
    95              $this->_values += $value;
    96         } else {
    96         } else {
    97             $this->_values[] = $value;
    97             $this->_values[] = $value;
    98         }
    98         }
    99     }
    99     }
   100 
   100