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

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