@@ -147,6 +147,9 @@ |
||
| 147 | 147 | return $refs; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | + /** |
|
| 151 | + * @param integer $status |
|
| 152 | + */ |
|
| 150 | 153 | protected function versionStatusToHash($status) |
| 151 | 154 | { |
| 152 | 155 | foreach(ContentVersionMatcher::STATUS_MAP as $own => $ez) { |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | |
| 150 | 150 | protected function versionStatusToHash($status) |
| 151 | 151 | { |
| 152 | - foreach(ContentVersionMatcher::STATUS_MAP as $own => $ez) { |
|
| 152 | + foreach (ContentVersionMatcher::STATUS_MAP as $own => $ez) { |
|
| 153 | 153 | if ($status == $ez) { |
| 154 | 154 | return $own; |
| 155 | 155 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Like match, but will throw an exception if there are 0 or more than 1 items matching |
| 57 | 57 | * |
| 58 | - * @param array $conditions |
|
| 58 | + * @param array $contentConditions |
|
| 59 | 59 | * @return mixed |
| 60 | 60 | * @throws \Exception |
| 61 | 61 | */ |
@@ -107,6 +107,9 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | + /** |
|
| 111 | + * @param Content $content |
|
| 112 | + */ |
|
| 110 | 113 | protected function matchAnd(array $conditionsArray, $content) |
| 111 | 114 | { |
| 112 | 115 | /// @todo introduce proper re-validation of all child conditions |
@@ -126,6 +129,9 @@ discard block |
||
| 126 | 129 | return $results; |
| 127 | 130 | } |
| 128 | 131 | |
| 132 | + /** |
|
| 133 | + * @param Content $content |
|
| 134 | + */ |
|
| 129 | 135 | protected function matchOr(array $conditionsArray, $content) |
| 130 | 136 | { |
| 131 | 137 | /// @todo introduce proper re-validation of all child conditions |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use eZ\Publish\API\Repository\Repository; |
| 6 | 6 | use eZ\Publish\API\Repository\Values\Content\Content; |
| 7 | 7 | use \eZ\Publish\API\Repository\Values\Content\VersionInfo; |
| 8 | -use eZ\Publish\Core\Base\Exceptions\NotFoundException; |
|
| 9 | 8 | use Kaliop\eZMigrationBundle\API\MatcherInterface; |
| 10 | 9 | use Kaliop\eZMigrationBundle\API\Collection\VersionInfoCollection; |
| 11 | 10 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $versions = array(); |
| 46 | 46 | |
| 47 | 47 | $contentCollection = $this->contentMatcher->match($contentConditions, $sort, $offset, $limit); |
| 48 | - foreach($contentCollection as $content) { |
|
| 48 | + foreach ($contentCollection as $content) { |
|
| 49 | 49 | $versions = array_merge($versions, $this->matchContentVersions($versionConditions, $content)); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $versions = array(); |
| 153 | 153 | foreach ($this->findAllContentVersions($content) as $versionKey => $versionInfo) { |
| 154 | - foreach($values as $acceptedStatus) { |
|
| 154 | + foreach ($values as $acceptedStatus) { |
|
| 155 | 155 | if ($versionInfo->status == self::STATUS_MAP[$acceptedStatus]) { |
| 156 | 156 | $versions[$versionKey] = $versionInfo; |
| 157 | 157 | break; |
@@ -173,15 +173,15 @@ discard block |
||
| 173 | 173 | $contentVersionsCount = count($contentVersions); |
| 174 | 174 | $i = 0; |
| 175 | 175 | foreach ($contentVersions as $versionKey => $versionInfo) { |
| 176 | - foreach($values as $acceptedVersionNo) { |
|
| 177 | - if ($acceptedVersionNo > 0 ) { |
|
| 176 | + foreach ($values as $acceptedVersionNo) { |
|
| 177 | + if ($acceptedVersionNo > 0) { |
|
| 178 | 178 | if ($acceptedVersionNr == $versionInfo->versionNo) { |
| 179 | 179 | $versions[$versionKey] = $versionInfo; |
| 180 | 180 | break; |
| 181 | 181 | } |
| 182 | 182 | } else { |
| 183 | 183 | // negative $acceptedVersionNo means 'leave the last X versions', eg: -1 = leave the last version |
| 184 | - if ($i < $contentVersionsCount + $acceptedVersionNo) { |
|
| 184 | + if ($i < $contentVersionsCount + $acceptedVersionNo) { |
|
| 185 | 185 | $versions[$versionKey] = $versionInfo; |
| 186 | 186 | break; |
| 187 | 187 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $contentVersions = $this->repository->getContentService()->loadVersions($content->contentInfo); |
| 203 | 203 | // different eZ kernels apparently sort versions in different order... |
| 204 | 204 | $sortedVersions = array(); |
| 205 | - foreach($contentVersions as $versionInfo) { |
|
| 205 | + foreach ($contentVersions as $versionInfo) { |
|
| 206 | 206 | $sortedVersions[$content->contentInfo->id . '/' . $versionInfo->versionNo] = $versionInfo; |
| 207 | 207 | } |
| 208 | 208 | ksort($sortedVersions); |