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

@@ 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

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

@@ 1077-1096 (lines=20) @@
1074
     *
1075
     * @return array
1076
     */
1077
    public function loadVersionInfo($contentId, $versionNo)
1078
    {
1079
        $query = $this->queryBuilder->createVersionInfoFindQuery();
1080
        $query->where(
1081
            $query->expr->lAnd(
1082
                $query->expr->eq(
1083
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_version'),
1084
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
1085
                ),
1086
                $query->expr->eq(
1087
                    $this->dbHandler->quoteColumn('version', 'ezcontentobject_version'),
1088
                    $query->bindValue($versionNo, null, \PDO::PARAM_INT)
1089
                )
1090
            )
1091
        );
1092
        $statement = $query->prepare();
1093
        $statement->execute();
1094
1095
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
1096
    }
1097
1098
    /**
1099
     * Returns data for all versions with given status created by the given $userId.