Code Duplication    Length = 20-21 lines in 3 locations

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

@@ 81-101 (lines=21) @@
78
     *
79
     * @return array
80
     */
81
    public function loadObjectStateDataByIdentifier($identifier, $groupId)
82
    {
83
        $query = $this->createObjectStateFindQuery();
84
        $query->where(
85
            $query->expr->lAnd(
86
                $query->expr->eq(
87
                    $this->dbHandler->quoteColumn('identifier', 'ezcobj_state'),
88
                    $query->bindValue($identifier, null, \PDO::PARAM_STR)
89
                ),
90
                $query->expr->eq(
91
                    $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'),
92
                    $query->bindValue($groupId, null, \PDO::PARAM_INT)
93
                )
94
            )
95
        );
96
97
        $statement = $query->prepare();
98
        $statement->execute();
99
100
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
101
    }
102
103
    /**
104
     * Loads data for all object states belonging to group with $groupId ID.

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

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

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

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