| @@ 992-1004 (lines=13) @@ | ||
| 989 | * |
|
| 990 | * @return array |
|
| 991 | */ |
|
| 992 | public function loadContentInfo($contentId) |
|
| 993 | { |
|
| 994 | $query = $this->connection->createQueryBuilder(); |
|
| 995 | $query->where('c.id = :id') |
|
| 996 | ->setParameter('id', $contentId, PDO::PARAM_INT); |
|
| 997 | ||
| 998 | $results = $this->internalLoadContentInfo($query); |
|
| 999 | if (empty($results)) { |
|
| 1000 | throw new NotFound('content', "id: $contentId"); |
|
| 1001 | } |
|
| 1002 | ||
| 1003 | return $results[0]; |
|
| 1004 | } |
|
| 1005 | ||
| 1006 | public function loadContentInfoList(array $contentIds) |
|
| 1007 | { |
|
| @@ 1026-1038 (lines=13) @@ | ||
| 1023 | * |
|
| 1024 | * @return array |
|
| 1025 | */ |
|
| 1026 | public function loadContentInfoByRemoteId($remoteId) |
|
| 1027 | { |
|
| 1028 | $query = $this->connection->createQueryBuilder(); |
|
| 1029 | $query->where('c.remote_id = :id') |
|
| 1030 | ->setParameter('id', $remoteId, PDO::PARAM_STR); |
|
| 1031 | ||
| 1032 | $results = $this->internalLoadContentInfo($query); |
|
| 1033 | if (empty($results)) { |
|
| 1034 | throw new NotFound('content', "remote_id: $remoteId"); |
|
| 1035 | } |
|
| 1036 | ||
| 1037 | return $results[0]; |
|
| 1038 | } |
|
| 1039 | ||
| 1040 | /** |
|
| 1041 | * Loads info for a content object identified by its location ID (node ID). |
|
| @@ 1051-1063 (lines=13) @@ | ||
| 1048 | * |
|
| 1049 | * @return array |
|
| 1050 | */ |
|
| 1051 | public function loadContentInfoByLocationId($locationId) |
|
| 1052 | { |
|
| 1053 | $query = $this->connection->createQueryBuilder(); |
|
| 1054 | $query->where('t.main_node_id = :id') |
|
| 1055 | ->setParameter('id', $locationId, PDO::PARAM_INT); |
|
| 1056 | ||
| 1057 | $results = $this->internalLoadContentInfo($query); |
|
| 1058 | if (empty($results)) { |
|
| 1059 | throw new NotFound('content', "main_node_id: $locationId"); |
|
| 1060 | } |
|
| 1061 | ||
| 1062 | return $results[0]; |
|
| 1063 | } |
|
| 1064 | ||
| 1065 | /** |
|
| 1066 | * Loads version info for content identified by $contentId and $versionNo. |
|