@@ 136-146 (lines=11) @@ | ||
133 | * @param string $imageId |
|
134 | * @return void |
|
135 | */ |
|
136 | protected function removeImageRelation(AbstractModel $object, string $imageId) |
|
137 | { |
|
138 | $connection = $this->resourceConnection->getConnection(ResourceConnection::DEFAULT_CONNECTION); |
|
139 | $connection->delete( |
|
140 | Catalogue::CATALOGUE_IMAGE_TABLE, |
|
141 | [ |
|
142 | CatalogueInterface::CATALOGUE_ID . ' = ' . $object->getId(), |
|
143 | ImageInterface::IMAGE_ID . ' = ' . $imageId, |
|
144 | ] |
|
145 | ); |
|
146 | } |
|
147 | ||
148 | /** |
|
149 | * @param string $imageId |
|
@@ 153-165 (lines=13) @@ | ||
150 | * @param string $position |
|
151 | * @return void |
|
152 | */ |
|
153 | protected function updateImagePosition(string $imageId, string $position) |
|
154 | { |
|
155 | $connection = $this->resourceConnection->getConnection(ResourceConnection::DEFAULT_CONNECTION); |
|
156 | $connection->update( |
|
157 | Catalogue::CATALOGUE_IMAGE_TABLE, |
|
158 | [ |
|
159 | ImageInterface::SORT_ORDER => $position, |
|
160 | ], |
|
161 | [ |
|
162 | ImageInterface::IMAGE_ID . ' = ' . $imageId |
|
163 | ] |
|
164 | ); |
|
165 | } |
|
166 | ||
167 | /** |
|
168 | * @param string $input |