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

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