| @@ 1033-1046 (lines=14) @@ | ||
| 1030 | * |
|
| 1031 | * @return array |
|
| 1032 | */ |
|
| 1033 | public function loadContentInfo($contentId) |
|
| 1034 | { |
|
| 1035 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1036 | $queryBuilder |
|
| 1037 | ->where('c.id = :id') |
|
| 1038 | ->setParameter('id', $contentId, ParameterType::INTEGER); |
|
| 1039 | ||
| 1040 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1041 | if (empty($results)) { |
|
| 1042 | throw new NotFound('content', "id: $contentId"); |
|
| 1043 | } |
|
| 1044 | ||
| 1045 | return $results[0]; |
|
| 1046 | } |
|
| 1047 | ||
| 1048 | public function loadContentInfoList(array $contentIds) |
|
| 1049 | { |
|
| @@ 1069-1082 (lines=14) @@ | ||
| 1066 | * |
|
| 1067 | * @return array |
|
| 1068 | */ |
|
| 1069 | public function loadContentInfoByRemoteId($remoteId) |
|
| 1070 | { |
|
| 1071 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1072 | $queryBuilder |
|
| 1073 | ->where('c.remote_id = :id') |
|
| 1074 | ->setParameter('id', $remoteId, ParameterType::STRING); |
|
| 1075 | ||
| 1076 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1077 | if (empty($results)) { |
|
| 1078 | throw new NotFound('content', "remote_id: $remoteId"); |
|
| 1079 | } |
|
| 1080 | ||
| 1081 | return $results[0]; |
|
| 1082 | } |
|
| 1083 | ||
| 1084 | /** |
|
| 1085 | * Loads info for a content object identified by its location ID (node ID). |
|
| @@ 1095-1108 (lines=14) @@ | ||
| 1092 | * |
|
| 1093 | * @return array |
|
| 1094 | */ |
|
| 1095 | public function loadContentInfoByLocationId($locationId) |
|
| 1096 | { |
|
| 1097 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(false); |
|
| 1098 | $queryBuilder |
|
| 1099 | ->where('t.node_id = :id') |
|
| 1100 | ->setParameter('id', $locationId, ParameterType::INTEGER); |
|
| 1101 | ||
| 1102 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1103 | if (empty($results)) { |
|
| 1104 | throw new NotFound('content', "node_id: $locationId"); |
|
| 1105 | } |
|
| 1106 | ||
| 1107 | return $results[0]; |
|
| 1108 | } |
|
| 1109 | ||
| 1110 | /** |
|
| 1111 | * Loads version info for content identified by $contentId and $versionNo. |
|