Пример #1
0
 /**
  * Returns the EactiveResourceConnection used to talk to the service.
  * @return EActiveResourceConnection The connection component as pecified in the config
  */
 public function getConnection()
 {
     if (isset(self::$_connection)) {
         return self::$_connection;
     } else {
         self::$_connection = Yii::app()->getComponent($this->connectionName());
         if (self::$_connection instanceof EActiveResourceConnection) {
             return self::$_connection;
         } else {
             throw new EActiveResourceException('No ' . $this->connectionName() . ' component specified!');
         }
     }
 }
Пример #2
0
 /**
  * Returns the EactiveResourceConnection used to talk to the service.
  * @return EActiveResourceConnection The connection component as pecified in the config
  */
 public function getConnection()
 {
     if (isset(self::$_connection)) {
         return self::$_connection;
     } else {
         self::$_connection = Yii::app()->getComponent('activeresource');
         if (self::$_connection instanceof EActiveResourceConnection) {
             return self::$_connection;
         } else {
             throw new EActiveResourceException('No "activeresource" component specified!');
         }
     }
 }