| @@ 970-983 (lines=14) @@ | ||
| 967 | * |
|
| 968 | * @return array |
|
| 969 | */ |
|
| 970 | public function loadContentInfo($contentId) |
|
| 971 | { |
|
| 972 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 973 | $queryBuilder |
|
| 974 | ->where('c.id = :id') |
|
| 975 | ->setParameter('id', $contentId, ParameterType::INTEGER); |
|
| 976 | ||
| 977 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 978 | if (empty($results)) { |
|
| 979 | throw new NotFound('content', "id: $contentId"); |
|
| 980 | } |
|
| 981 | ||
| 982 | return $results[0]; |
|
| 983 | } |
|
| 984 | ||
| 985 | public function loadContentInfoList(array $contentIds) |
|
| 986 | { |
|
| @@ 1006-1019 (lines=14) @@ | ||
| 1003 | * |
|
| 1004 | * @return array |
|
| 1005 | */ |
|
| 1006 | public function loadContentInfoByRemoteId($remoteId) |
|
| 1007 | { |
|
| 1008 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1009 | $queryBuilder |
|
| 1010 | ->where('c.remote_id = :id') |
|
| 1011 | ->setParameter('id', $remoteId, ParameterType::STRING); |
|
| 1012 | ||
| 1013 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1014 | if (empty($results)) { |
|
| 1015 | throw new NotFound('content', "remote_id: $remoteId"); |
|
| 1016 | } |
|
| 1017 | ||
| 1018 | return $results[0]; |
|
| 1019 | } |
|
| 1020 | ||
| 1021 | /** |
|
| 1022 | * Loads info for a content object identified by its location ID (node ID). |
|
| @@ 1032-1045 (lines=14) @@ | ||
| 1029 | * |
|
| 1030 | * @return array |
|
| 1031 | */ |
|
| 1032 | public function loadContentInfoByLocationId($locationId) |
|
| 1033 | { |
|
| 1034 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1035 | $queryBuilder |
|
| 1036 | ->where('t.main_node_id = :id') |
|
| 1037 | ->setParameter('id', $locationId, ParameterType::INTEGER); |
|
| 1038 | ||
| 1039 | $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE); |
|
| 1040 | if (empty($results)) { |
|
| 1041 | throw new NotFound('content', "main_node_id: $locationId"); |
|
| 1042 | } |
|
| 1043 | ||
| 1044 | return $results[0]; |
|
| 1045 | } |
|
| 1046 | ||
| 1047 | /** |
|
| 1048 | * Loads version info for content identified by $contentId and $versionNo. |
|