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

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