Newscoop\Service\Resource\ResourceRepository::getInstance PHP Метод

getInstance() публичный статический Метод

Provides the singletone of the resource repository.
public static getInstance ( ) : Newscoop\Service\Resource\ResourceRespository
Результат Newscoop\Service\Resource\ResourceRespository The singletone.
    public static function getInstance()
    {
        if (self::$instance === NULL) {
            self::$instance = new self();
        }
        return self::$instance;
    }

Usage Example

Пример #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);
 }