Simplify_Object

Base class for all domain objects.

Defined (1)

The class is defined in the following location(s).

/includes/gateways/simplify-commerce/includes/Simplify/Object.php  
  1. class Simplify_Object { 
  2.  
  3. private $properties = array(); 
  4.  
  5. /** 
  6. * @ignore 
  7. */ 
  8. public function __get($key) { 
  9. if (array_key_exists($key, $this->properties)) { 
  10. return $this->properties[$key]; 
  11. } else { 
  12. return null; 
  13.  
  14. /** 
  15. * @ignore 
  16. */ 
  17. public function __set($key, $value) { 
  18. $this->properties[$key] = $value; 
  19.  
  20. /** 
  21. * Updates the object's properties with the values in the specified map. 
  22. * @param $hash array Map of values to set. 
  23. */ 
  24. public function setAll($hash) { 
  25. foreach ($hash as $key => $value) { 
  26. $this->$key = $value; 
  27.  
  28. /** 
  29. * @ignore 
  30. */ 
  31. public function __toString() { 
  32. return json_encode($this->properties); 
  33.  
  34. /** 
  35. * Returns the object's properties as a map. 
  36. * @return array map of properties. 
  37. */ 
  38. public function getProperties() { 
  39. return $this->properties;