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