Exemplo n.º 1
0
 /**
  * A Collection is an array of objects
  *
  * Some assumptions:
  * * The `Collection` class assumes that there exists on its service
  *   a factory method with the same name of the class. For example, if
  *   you create a Collection of class `Foobar`, it will attempt to call
  *   the method `parent::Foobar()` to create instances of that class.
  * * It assumes that the factory method can take an array of values, and
  *   it passes that to the method.
  *
  * @param Service $service   - the service associated with the collection
  * @param string  $itemclass - the Class of each item in the collection
  *                           (assumed to be the name of the factory method)
  * @param array   $arr       - the input array
  */
 public function __construct($service, $class, array $array = array())
 {
     $service->getLogger()->warning(Logger::deprecated(__METHOD__, 'OpenCloud\\Common\\Collection\\CollectionBuilder'));
     $this->setService($service);
     $this->setNextPageClass($class);
     // If they've supplied a FQCN, only get the last part
     $class = false !== ($classNamePos = strrpos($class, '\\')) ? substr($class, $classNamePos + 1) : $class;
     $this->setItemClass($class);
     // Set data
     $this->setItemList($array);
 }
Exemplo n.º 2
0
 /**
  * @deprecated
  */
 public function connectionLogging()
 {
     $this->getLogger()->warning(Logger::deprecated(__METHOD__, 'hasConnectionLogging or enableConnectionLogging'));
 }
Exemplo n.º 3
0
 /**
  * @deprecated Please use {@see batchDelete()} instead.
  */
 public function bulkDelete(array $paths)
 {
     $this->getLogger()->warning(Logger::deprecated(__METHOD__, '::batchDelete()'));
     return $this->executeBatchDeleteRequest($paths);
 }
Exemplo n.º 4
0
 /**
  * @deprecated
  */
 public function billableLoadBalancer($id = null)
 {
     $this->getLogger()->warning(Logger::deprecated(__METHOD__, 'loadBalancer'));
     return $this->resource('LoadBalancer', $id);
 }
Exemplo n.º 5
0
 /**
  * @deprecated
  */
 public function hasExpired()
 {
     $this->getLogger()->warning(Logger::deprecated(__METHOD__, 'getTokenObject()->hasExpired()'));
     return $this->getTokenObject() && $this->getTokenObject()->hasExpired();
 }
Exemplo n.º 6
0
 /**
  * @deprecated
  */
 public function first()
 {
     Logger::newInstance()->warning(Logger::deprecated(__METHOD__, 'getElement'));
     return $this->getElement(0);
 }