You are here

class gapiAccountEntry in Google Analytics Statistics 7.x

Same name and namespace in other branches
  1. 7.2 includes/gapi.class.php \gapiAccountEntry
  2. 7 includes/gapi.class.php \gapiAccountEntry

Class gapiAccountEntry

Storage for individual gapi account entries

Hierarchy

Expanded class hierarchy of gapiAccountEntry

File

inc/gapi.class.php, line 666

View source
class gapiAccountEntry {
  private $properties = array();
  public function __construct($properties) {
    $this->properties = $properties;
  }

  /**
   * toString function to return the name of the account
   *
   * @return String
   */
  public function __toString() {
    if (isset($this->properties['title'])) {
      return $this->properties['title'];
    }
    else {
      return;
    }
  }

  /**
   * Get an associative array of the properties
   * and the matching values for the current result
   *
   * @return Array
   */
  public function getProperties() {
    return $this->properties;
  }

  /**
   * Call method to find a matching parameter to return
   *
   * @param $name String name of function called
   * @return String
   * @throws Exception if not a valid parameter, or not a 'get' function
   */
  public function __call($name, $parameters) {
    if (!preg_match('/^get/', $name)) {
      throw new Exception('No such function "' . $name . '"');
    }
    $name = preg_replace('/^get/', '', $name);
    $property_key = gapi::array_key_exists_nc($name, $this->properties);
    if ($property_key) {
      return $this->properties[$property_key];
    }
    throw new Exception('No valid property called "' . $name . '"');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
gapiAccountEntry::$properties private property
gapiAccountEntry::getProperties public function Get an associative array of the properties and the matching values for the current result
gapiAccountEntry::__call public function Call method to find a matching parameter to return
gapiAccountEntry::__construct public function
gapiAccountEntry::__toString public function toString function to return the name of the account