Code Duplication    Length = 20-21 lines in 3 locations

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 1 location

@@ 942-961 (lines=20) @@
939
     *
940
     * @return array
941
     */
942
    public function loadVersionInfo($contentId, $versionNo)
943
    {
944
        $query = $this->queryBuilder->createVersionInfoFindQuery();
945
        $query->where(
946
            $query->expr->lAnd(
947
                $query->expr->eq(
948
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_version'),
949
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
950
                ),
951
                $query->expr->eq(
952
                    $this->dbHandler->quoteColumn('version', 'ezcontentobject_version'),
953
                    $query->bindValue($versionNo, null, \PDO::PARAM_INT)
954
                )
955
            )
956
        );
957
        $statement = $query->prepare();
958
        $statement->execute();
959
960
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
961
    }
962
963
    /**
964
     * Returns data for all versions with given status created by the given $userId.

eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabase.php 1 location

@@ 79-99 (lines=21) @@
76
     *
77
     * @return array
78
     */
79
    public function loadObjectStateDataByIdentifier($identifier, $groupId)
80
    {
81
        $query = $this->createObjectStateFindQuery();
82
        $query->where(
83
            $query->expr->lAnd(
84
                $query->expr->eq(
85
                    $this->dbHandler->quoteColumn('identifier', 'ezcobj_state'),
86
                    $query->bindValue($identifier, null, \PDO::PARAM_STR)
87
                ),
88
                $query->expr->eq(
89
                    $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'),
90
                    $query->bindValue($groupId, null, \PDO::PARAM_INT)
91
                )
92
            )
93
        );
94
95
        $statement = $query->prepare();
96
        $statement->execute();
97
98
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
99
    }
100
101
    /**
102
     * Loads data for all object states belonging to group with $groupId ID.

eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php 1 location

@@ 886-905 (lines=20) @@
883
     *
884
     * @return array Data rows.
885
     */
886
    public function loadTypeData($typeId, $status)
887
    {
888
        $q = $this->getLoadTypeQuery();
889
        $q->where(
890
            $q->expr->lAnd(
891
                $q->expr->eq(
892
                    $this->dbHandler->quoteColumn('id', 'ezcontentclass'),
893
                    $q->bindValue($typeId, null, \PDO::PARAM_INT)
894
                ),
895
                $q->expr->eq(
896
                    $this->dbHandler->quoteColumn('version', 'ezcontentclass'),
897
                    $q->bindValue($status, null, \PDO::PARAM_INT)
898
                )
899
            )
900
        );
901
        $stmt = $q->prepare();
902
        $stmt->execute();
903
904
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
905
    }
906
907
    /**
908
     * Loads an array with data about the type referred to by $identifier in