Example #1
0
File: Join.php Project: ejoful/bicy
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRoute()
 {
     return $this->hasOne(Route::className(), ['id' => 'route_id']);
 }
Example #2
0
 public static function getRoutes()
 {
     if (static::$routes === null) {
         $cacheKey = "Routes:all";
         static::$routes = Yii::$app->cache->get($cacheKey);
         if (!is_array(static::$routes)) {
             static::$routes = Route::find()->all();
             foreach (static::$routes as $key => $route) {
                 static::$routes[$key]['template'] = json_decode($route->url_template, true);
             }
             Yii::$app->cache->set($cacheKey, static::$routes, 86400, new TagDependency(['tags' => [\devgroup\TagDependencyHelper\ActiveRecordHelper::getCommonTag(Route::className())]]));
         }
     }
     return static::$routes;
 }
Example #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRoutes()
 {
     return $this->hasMany(Route::className(), ['author_id' => 'id']);
 }