| @@ 981-994 (lines=14) @@ | ||
| 978 | * |
|
| 979 | * @return array |
|
| 980 | */ |
|
| 981 | public function loadContentInfo($contentId) |
|
| 982 | { |
|
| 983 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 984 | $queryBuilder |
|
| 985 | ->where('c.id = :id') |
|
| 986 | ->setParameter('id', $contentId, ParameterType::INTEGER); |
|
| 987 | ||
| 988 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 989 | if (empty($results)) { |
|
| 990 | throw new NotFound('content', "id: $contentId"); |
|
| 991 | } |
|
| 992 | ||
| 993 | return $results[0]; |
|
| 994 | } |
|
| 995 | ||
| 996 | public function loadContentInfoList(array $contentIds) |
|
| 997 | { |
|
| @@ 1017-1030 (lines=14) @@ | ||
| 1014 | * |
|
| 1015 | * @return array |
|
| 1016 | */ |
|
| 1017 | public function loadContentInfoByRemoteId($remoteId) |
|
| 1018 | { |
|
| 1019 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1020 | $queryBuilder |
|
| 1021 | ->where('c.remote_id = :id') |
|
| 1022 | ->setParameter('id', $remoteId, ParameterType::STRING); |
|
| 1023 | ||
| 1024 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1025 | if (empty($results)) { |
|
| 1026 | throw new NotFound('content', "remote_id: $remoteId"); |
|
| 1027 | } |
|
| 1028 | ||
| 1029 | return $results[0]; |
|
| 1030 | } |
|
| 1031 | ||
| 1032 | /** |
|
| 1033 | * Loads info for a content object identified by its location ID (node ID). |
|
| @@ 1043-1056 (lines=14) @@ | ||
| 1040 | * |
|
| 1041 | * @return array |
|
| 1042 | */ |
|
| 1043 | public function loadContentInfoByLocationId($locationId) |
|
| 1044 | { |
|
| 1045 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(false); |
|
| 1046 | $queryBuilder |
|
| 1047 | ->where('t.node_id = :id') |
|
| 1048 | ->setParameter('id', $locationId, ParameterType::INTEGER); |
|
| 1049 | ||
| 1050 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1051 | if (empty($results)) { |
|
| 1052 | throw new NotFound('content', "node_id: $locationId"); |
|
| 1053 | } |
|
| 1054 | ||
| 1055 | return $results[0]; |
|
| 1056 | } |
|
| 1057 | ||
| 1058 | /** |
|
| 1059 | * Loads version info for content identified by $contentId and $versionNo. |
|