Code Duplication    Length = 18-18 lines in 3 locations

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

@@ 897-914 (lines=18) @@
894
     *
895
     * @return array
896
     */
897
    public function loadContentInfo($contentId)
898
    {
899
        $query = $this->dbHandler->createSelectQuery();
900
        $query->where(
901
            $query->expr->eq(
902
                $this->dbHandler->quoteColumn('id', 'ezcontentobject'),
903
                $query->bindValue($contentId, null, PDO::PARAM_INT)
904
            )
905
        );
906
907
        $row = $this->internalLoadContentInfo($query);
908
909
        if (empty($row)) {
910
            throw new NotFound('content', "id: $contentId");
911
        }
912
913
        return $row;
914
    }
915
916
    /**
917
     * Loads info for a content object identified by its remote ID.
@@ 927-944 (lines=18) @@
924
     *
925
     * @return array
926
     */
927
    public function loadContentInfoByRemoteId($remoteId)
928
    {
929
        $query = $this->dbHandler->createSelectQuery();
930
        $query->where(
931
            $query->expr->eq(
932
                $this->dbHandler->quoteColumn('remote_id', 'ezcontentobject'),
933
                $query->bindValue($remoteId)
934
            )
935
        );
936
937
        $row = $this->internalLoadContentInfo($query);
938
939
        if (empty($row)) {
940
            throw new NotFound('content', "remote_id: $remoteId");
941
        }
942
943
        return $row;
944
    }
945
946
    /**
947
     * Loads info for a content object identified by its location ID (node ID).
@@ 957-974 (lines=18) @@
954
     *
955
     * @return array
956
     */
957
    public function loadContentInfoByLocationId($locationId)
958
    {
959
        $query = $this->dbHandler->createSelectQuery();
960
        $query->where(
961
            $query->expr->eq(
962
                $this->dbHandler->quoteColumn('main_node_id', 'ezcontentobject_tree'),
963
                $query->bindValue($locationId, null, PDO::PARAM_INT)
964
            )
965
        );
966
967
        $row = $this->internalLoadContentInfo($query);
968
969
        if (empty($row)) {
970
            throw new NotFound('content', "main_node_id: $locationId");
971
        }
972
973
        return $row;
974
    }
975
976
    /**
977
     * Loads version info for content identified by $contentId and $versionNo.