| @@ 22-36 (lines=15) @@ | ||
| 19 | if (is_object($model) === false) { |
|
| 20 | $model = static::findOne($id); |
|
| 21 | ||
| 22 | if (is_object($model)) { |
|
| 23 | ||
| 24 | Yii::$app->cache->set( |
|
| 25 | static::className() . ":" . $id, |
|
| 26 | $model, |
|
| 27 | 86400, |
|
| 28 | new TagDependency( |
|
| 29 | [ |
|
| 30 | 'tags' => [ |
|
| 31 | \devgroup\TagDependencyHelper\ActiveRecordHelper::getObjectTag(static::className(), $model->id), |
|
| 32 | ], |
|
| 33 | ] |
|
| 34 | ) |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | return $model; |
|
| @@ 76-87 (lines=12) @@ | ||
| 73 | $items[] = self::getTree($child, $this->depth - 1); |
|
| 74 | } |
|
| 75 | } |
|
| 76 | if (count($items) > 0) { |
|
| 77 | \Yii::$app->cache->set( |
|
| 78 | $cacheKey, |
|
| 79 | $items, |
|
| 80 | 86400, |
|
| 81 | new TagDependency([ |
|
| 82 | 'tags' => [ |
|
| 83 | \devgroup\TagDependencyHelper\ActiveRecordHelper::getCommonTag(Navigation::className()) |
|
| 84 | ] |
|
| 85 | ]) |
|
| 86 | ); |
|
| 87 | } |
|
| 88 | } |
|
| 89 | $items = ArrayHelper::merge((array) $this->prependItems, $items, (array) $this->appendItems); |
|
| 90 | $currentUri = Yii::$app->request->url; |
|