You are here

public function gapiAccountEntry::__call in Google Analytics Statistics 7.x

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

Call method to find a matching parameter to return

Parameters

$name String name of function called:

Return value

String

Throws

Exception if not a valid parameter, or not a 'get' function

File

inc/gapi.class.php, line 710

Class

gapiAccountEntry
Class gapiAccountEntry

Code

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 . '"');
}