| Conditions | 6 |
| Paths | 14 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function actionRecreateThumbnails($idList = null, $showProgress = false) |
||
| 15 | { |
||
| 16 | /** @var ThumbnailSize[] $sizes */ |
||
| 17 | $sizes = ThumbnailSize::find()->all(); |
||
| 18 | /** @var Image[] $images */ |
||
| 19 | if (is_null($idList)) { |
||
| 20 | $images = Image::find()->all(); |
||
| 21 | } else { |
||
| 22 | $ids = explode(',', $idList); |
||
| 23 | $images = Image::findAll(['id' => $ids]); |
||
| 24 | } |
||
| 25 | foreach ($images as $image) { |
||
| 26 | if ($showProgress) { |
||
| 27 | echo "Image: {$image->id}\n"; |
||
| 28 | } |
||
| 29 | if ($image !== null) { |
||
| 30 | foreach ($sizes as $size) { |
||
| 31 | Thumbnail::getImageThumbnailBySize($image, $size); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 52 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.