| @@ 1040-1053 (lines=14) @@ | ||
| 1037 | * |
|
| 1038 | * @return array |
|
| 1039 | */ |
|
| 1040 | public function loadContentInfo($contentId) |
|
| 1041 | { |
|
| 1042 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1043 | $queryBuilder |
|
| 1044 | ->where('c.id = :id') |
|
| 1045 | ->setParameter('id', $contentId, ParameterType::INTEGER); |
|
| 1046 | ||
| 1047 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1048 | if (empty($results)) { |
|
| 1049 | throw new NotFound('content', "id: $contentId"); |
|
| 1050 | } |
|
| 1051 | ||
| 1052 | return $results[0]; |
|
| 1053 | } |
|
| 1054 | ||
| 1055 | public function loadContentInfoList(array $contentIds) |
|
| 1056 | { |
|
| @@ 1076-1089 (lines=14) @@ | ||
| 1073 | * |
|
| 1074 | * @return array |
|
| 1075 | */ |
|
| 1076 | public function loadContentInfoByRemoteId($remoteId) |
|
| 1077 | { |
|
| 1078 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1079 | $queryBuilder |
|
| 1080 | ->where('c.remote_id = :id') |
|
| 1081 | ->setParameter('id', $remoteId, ParameterType::STRING); |
|
| 1082 | ||
| 1083 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1084 | if (empty($results)) { |
|
| 1085 | throw new NotFound('content', "remote_id: $remoteId"); |
|
| 1086 | } |
|
| 1087 | ||
| 1088 | return $results[0]; |
|
| 1089 | } |
|
| 1090 | ||
| 1091 | /** |
|
| 1092 | * Loads info for a content object identified by its location ID (node ID). |
|
| @@ 1102-1115 (lines=14) @@ | ||
| 1099 | * |
|
| 1100 | * @return array |
|
| 1101 | */ |
|
| 1102 | public function loadContentInfoByLocationId($locationId) |
|
| 1103 | { |
|
| 1104 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(false); |
|
| 1105 | $queryBuilder |
|
| 1106 | ->where('t.node_id = :id') |
|
| 1107 | ->setParameter('id', $locationId, ParameterType::INTEGER); |
|
| 1108 | ||
| 1109 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1110 | if (empty($results)) { |
|
| 1111 | throw new NotFound('content', "node_id: $locationId"); |
|
| 1112 | } |
|
| 1113 | ||
| 1114 | return $results[0]; |
|
| 1115 | } |
|
| 1116 | ||
| 1117 | /** |
|
| 1118 | * Loads version info for content identified by $contentId and $versionNo. |
|