Code Duplication    Length = 14-14 lines in 3 locations

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 3 locations

@@ 965-978 (lines=14) @@
962
     *
963
     * @return array
964
     */
965
    public function loadContentInfo($contentId)
966
    {
967
        $queryBuilder = $this->createLoadContentInfoQueryBuilder();
968
        $queryBuilder
969
            ->where('c.id = :id')
970
            ->setParameter('id', $contentId, ParameterType::INTEGER);
971
972
        $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE);
973
        if (empty($results)) {
974
            throw new NotFound('content', "id: $contentId");
975
        }
976
977
        return $results[0];
978
    }
979
980
    public function loadContentInfoList(array $contentIds)
981
    {
@@ 1001-1014 (lines=14) @@
998
     *
999
     * @return array
1000
     */
1001
    public function loadContentInfoByRemoteId($remoteId)
1002
    {
1003
        $queryBuilder = $this->createLoadContentInfoQueryBuilder();
1004
        $queryBuilder
1005
            ->where('c.remote_id = :id')
1006
            ->setParameter('id', $remoteId, ParameterType::STRING);
1007
1008
        $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE);
1009
        if (empty($results)) {
1010
            throw new NotFound('content', "remote_id: $remoteId");
1011
        }
1012
1013
        return $results[0];
1014
    }
1015
1016
    /**
1017
     * Loads info for a content object identified by its location ID (node ID).
@@ 1027-1040 (lines=14) @@
1024
     *
1025
     * @return array
1026
     */
1027
    public function loadContentInfoByLocationId($locationId)
1028
    {
1029
        $queryBuilder = $this->createLoadContentInfoQueryBuilder();
1030
        $queryBuilder
1031
            ->where('t.main_node_id = :id')
1032
            ->setParameter('id', $locationId, ParameterType::INTEGER);
1033
1034
        $results = $queryBuilder->execute()->fetchAll(FetchMode::ASSOCIATIVE);
1035
        if (empty($results)) {
1036
            throw new NotFound('content', "main_node_id: $locationId");
1037
        }
1038
1039
        return $results[0];
1040
    }
1041
1042
    /**
1043
     * Loads version info for content identified by $contentId and $versionNo.