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

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