Code Duplication    Length = 13-13 lines in 3 locations

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

@@ 982-994 (lines=13) @@
979
     *
980
     * @return array
981
     */
982
    public function loadContentInfo($contentId)
983
    {
984
        $query = $this->connection->createQueryBuilder();
985
        $query->where('c.id = :id')
986
              ->setParameter('id', $contentId, \PDO::PARAM_INT);
987
988
        $results = $this->internalLoadContentInfo($query);
989
        if (empty($results)) {
990
            throw new NotFound('content', "id: $contentId");
991
        }
992
993
        return $results[0];
994
    }
995
996
    public function loadContentInfoList(array $contentIds)
997
    {
@@ 1016-1028 (lines=13) @@
1013
     *
1014
     * @return array
1015
     */
1016
    public function loadContentInfoByRemoteId($remoteId)
1017
    {
1018
        $query = $this->connection->createQueryBuilder();
1019
        $query->where('c.remote_id = :id')
1020
              ->setParameter('id', $remoteId, \PDO::PARAM_STR);
1021
1022
        $results = $this->internalLoadContentInfo($query);
1023
        if (empty($results)) {
1024
            throw new NotFound('content', "remote_id: $remoteId");
1025
        }
1026
1027
        return $results[0];
1028
    }
1029
1030
    /**
1031
     * Loads info for a content object identified by its location ID (node ID).
@@ 1041-1053 (lines=13) @@
1038
     *
1039
     * @return array
1040
     */
1041
    public function loadContentInfoByLocationId($locationId)
1042
    {
1043
        $query = $this->connection->createQueryBuilder();
1044
        $query->where('t.main_node_id = :id')
1045
              ->setParameter('id', $locationId, \PDO::PARAM_INT);
1046
1047
        $results = $this->internalLoadContentInfo($query);
1048
        if (empty($results)) {
1049
            throw new NotFound('content', "main_node_id: $locationId");
1050
        }
1051
1052
        return $results[0];
1053
    }
1054
1055
    /**
1056
     * Loads version info for content identified by $contentId and $versionNo.