Code Duplication    Length = 20-21 lines in 3 locations

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

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

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

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