class InstagramConf in Drupagram 7
Same name and namespace in other branches
- 6 drupagram.lib.php \InstagramConf
Class InstagramConf
Singleton which stores common configuration
Hierarchy
- class \InstagramConf
Expanded class hierarchy of InstagramConf
See also
http://php.net/manual/en/language.oop5.patterns.php
File
- ./
drupagram.lib.php, line 14 - Classes to implement the full Instagram API
View source
class InstagramConf {
private static $instance;
private $attributes = array(
'apibase' => 'https://api.instagram.com',
'apiurl' => 'https://api.instagram.com/v1',
'tiny_url' => 'tinyurl.com',
);
private function __construct() {
}
public static function instance() {
if (!isset(self::$instance)) {
$className = __CLASS__;
self::$instance = new $className();
}
return self::$instance;
}
/**
* Generic getter
*
* @param $attribute
* string attribute name to return
* @return
* mixed value or NULL
*/
public function get($attribute) {
if (array_key_exists($attribute, $this->attributes)) {
return $this->attributes[$attribute];
}
}
/**
* Generic setter
* @param $attribute
* string attribute name to be set
* @param $value
* mixed value
*/
public function set($attribute, $value) {
if (array_key_exists($attribute, $this->attributes)) {
$this->attributes[$attribute] = $value;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InstagramConf:: |
private | property | ||
InstagramConf:: |
private static | property | ||
InstagramConf:: |
public | function | Generic getter | |
InstagramConf:: |
public static | function | ||
InstagramConf:: |
public | function | Generic setter | |
InstagramConf:: |
private | function |