Newscoop\Service\Resource\ResourceRepository::getInstance PHP Method

getInstance() public static method

Provides the singletone of the resource repository.
public static getInstance ( ) : Newscoop\Service\Resource\ResourceRespository
return Newscoop\Service\Resource\ResourceRespository The singletone.
    public static function getInstance()
    {
        if (self::$instance === NULL) {
            self::$instance = new self();
        }
        return self::$instance;
    }

Usage Example

Beispiel #1
0
 /**
  * Provides the properties for the current resource id.
  *
  * @return array
  *		The array containing all the properties, not null can be empty.
  */
 public function getProperties()
 {
     return ResourceRepository::getInstance()->getResourceFor($this);
 }