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

@@ 988-1007 (lines=20) @@
985
     *
986
     * @return array
987
     */
988
    public function loadVersionInfo($contentId, $versionNo)
989
    {
990
        $query = $this->queryBuilder->createVersionInfoFindQuery();
991
        $query->where(
992
            $query->expr->lAnd(
993
                $query->expr->eq(
994
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_version'),
995
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
996
                ),
997
                $query->expr->eq(
998
                    $this->dbHandler->quoteColumn('version', 'ezcontentobject_version'),
999
                    $query->bindValue($versionNo, null, \PDO::PARAM_INT)
1000
                )
1001
            )
1002
        );
1003
        $statement = $query->prepare();
1004
        $statement->execute();
1005
1006
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
1007
    }
1008
1009
    /**
1010
     * Returns data for all versions with given status created by the given $userId.