| @@ 994-1007 (lines=14) @@ | ||
| 991 | * |
|
| 992 | * @return array |
|
| 993 | */ |
|
| 994 | public function loadContentInfo($contentId) |
|
| 995 | { |
|
| 996 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 997 | $queryBuilder |
|
| 998 | ->where('c.id = :id') |
|
| 999 | ->setParameter('id', $contentId, PDO::PARAM_INT); |
|
| 1000 | ||
| 1001 | $results = $queryBuilder->execute()->fetchAll(PDO::FETCH_ASSOC); |
|
| 1002 | if (empty($results)) { |
|
| 1003 | throw new NotFound('content', "id: $contentId"); |
|
| 1004 | } |
|
| 1005 | ||
| 1006 | return $results[0]; |
|
| 1007 | } |
|
| 1008 | ||
| 1009 | public function loadContentInfoList(array $contentIds) |
|
| 1010 | { |
|
| @@ 1030-1043 (lines=14) @@ | ||
| 1027 | * |
|
| 1028 | * @return array |
|
| 1029 | */ |
|
| 1030 | public function loadContentInfoByRemoteId($remoteId) |
|
| 1031 | { |
|
| 1032 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1033 | $queryBuilder |
|
| 1034 | ->where('c.remote_id = :id') |
|
| 1035 | ->setParameter('id', $remoteId, PDO::PARAM_STR); |
|
| 1036 | ||
| 1037 | $results = $queryBuilder->execute()->fetchAll(PDO::FETCH_ASSOC); |
|
| 1038 | if (empty($results)) { |
|
| 1039 | throw new NotFound('content', "remote_id: $remoteId"); |
|
| 1040 | } |
|
| 1041 | ||
| 1042 | return $results[0]; |
|
| 1043 | } |
|
| 1044 | ||
| 1045 | /** |
|
| 1046 | * Loads info for a content object identified by its location ID (node ID). |
|
| @@ 1056-1069 (lines=14) @@ | ||
| 1053 | * |
|
| 1054 | * @return array |
|
| 1055 | */ |
|
| 1056 | public function loadContentInfoByLocationId($locationId) |
|
| 1057 | { |
|
| 1058 | $queryBuilder = $this->createLoadContentInfoQueryBuilder(); |
|
| 1059 | $queryBuilder |
|
| 1060 | ->where('t.main_node_id = :id') |
|
| 1061 | ->setParameter('id', $locationId, PDO::PARAM_INT); |
|
| 1062 | ||
| 1063 | $results = $queryBuilder->execute()->fetchAll(PDO::FETCH_ASSOC); |
|
| 1064 | if (empty($results)) { |
|
| 1065 | throw new NotFound('content', "main_node_id: $locationId"); |
|
| 1066 | } |
|
| 1067 | ||
| 1068 | return $results[0]; |
|
| 1069 | } |
|
| 1070 | ||
| 1071 | /** |
|
| 1072 | * Loads version info for content identified by $contentId and $versionNo. |
|