Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

LegacyStorageImageFileList.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger;
8
14 class LegacyStorageImageFileList implements ImageFileList
15 {
21 private $item;
22
28 private $cursor;
29
36 private $prefix;
37
43 private $rowReader;
44
50 public function __construct(ImageFileRowReader $rowReader, $storageDir, $imagesDir)
51 {
52 $this->prefix = $storageDir . '/' . $imagesDir;
53 $this->rowReader = $rowReader;
54 }
55
56 public function current()
57 {
58 return $this->item;
59 }
60
61 public function next()
62 {
63 $this->fetchRow();
64 }
65
66 public function key()
67 {
68 return $this->cursor;
69 }
70
71 public function valid()
72 {
73 return $this->cursor < $this->count();
74 }
75
76 public function rewind()
77 {
78 $this->cursor = -1;
79 $this->rowReader->init();
80 $this->fetchRow();
81 }
82
83 public function count()
84 {
85 return $this->rowReader->getCount();
86 }
87
91 private function fetchRow()
92 {
93 ++$this->cursor;
94 $imageId = $this->rowReader->getRow();
95
96 if (substr($imageId, 0, strlen($this->prefix)) == $this->prefix) {
97 $imageId = ltrim(substr($imageId, strlen($this->prefix)), '/');
98 }
99
100 $this->item = $imageId;
101 }
102 }
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList
Iterator for entries in legacy's ezimagefile table.
Definition: LegacyStorageImageFileList.php:15
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\fetchRow
fetchRow()
Fetches the next item from the resultset, moves the cursor forward, and removes the prefix from the i...
Definition: LegacyStorageImageFileList.php:91
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\$prefix
$prefix
Definition: LegacyStorageImageFileList.php:36
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\next
next()
Definition: LegacyStorageImageFileList.php:61
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\$cursor
$cursor
Definition: LegacyStorageImageFileList.php:28
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\valid
valid()
Definition: LegacyStorageImageFileList.php:71
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\current
current()
Definition: LegacyStorageImageFileList.php:56
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\count
count()
Definition: LegacyStorageImageFileList.php:83
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\$item
$item
Definition: LegacyStorageImageFileList.php:21
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\rewind
rewind()
Definition: LegacyStorageImageFileList.php:76
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\__construct
__construct(ImageFileRowReader $rowReader, $storageDir, $imagesDir)
Definition: LegacyStorageImageFileList.php:50
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\key
key()
Definition: LegacyStorageImageFileList.php:66
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\LegacyStorageImageFileList\$rowReader
$rowReader
Definition: LegacyStorageImageFileList.php:43
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\ImageFileList
Iterates over BinaryFile id entries for original images.
Definition: ImageFileList.php:16
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger\ImageFileRowReader
Reads original image files from a data source.
Definition: ImageFileRowReader.php:13
eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger
Definition: ImageFileList.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.