Code Duplication    Length = 20-21 lines in 3 locations

eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php 2 locations

@@ 926-945 (lines=20) @@
923
     *
924
     * @return array(int=>array(string=>mixed)) Data rows.
925
     */
926
    public function loadTypeDataByIdentifier($identifier, $status)
927
    {
928
        $q = $this->getLoadTypeQuery();
929
        $q->where(
930
            $q->expr->lAnd(
931
                $q->expr->eq(
932
                    $this->dbHandler->quoteColumn('identifier', 'ezcontentclass'),
933
                    $q->bindValue($identifier)
934
                ),
935
                $q->expr->eq(
936
                    $this->dbHandler->quoteColumn('version', 'ezcontentclass'),
937
                    $q->bindValue($status)
938
                )
939
            )
940
        );
941
        $stmt = $q->prepare();
942
        $stmt->execute();
943
944
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
945
    }
946
947
    /**
948
     * Loads an array with data about the type referred to by $remoteId in
@@ 956-975 (lines=20) @@
953
     *
954
     * @return array(int=>array(string=>mixed)) Data rows.
955
     */
956
    public function loadTypeDataByRemoteId($remoteId, $status)
957
    {
958
        $q = $this->getLoadTypeQuery();
959
        $q->where(
960
            $q->expr->lAnd(
961
                $q->expr->eq(
962
                    $this->dbHandler->quoteColumn('remote_id', 'ezcontentclass'),
963
                    $q->bindValue($remoteId)
964
                ),
965
                $q->expr->eq(
966
                    $this->dbHandler->quoteColumn('version', 'ezcontentclass'),
967
                    $q->bindValue($status)
968
                )
969
            )
970
        );
971
        $stmt = $q->prepare();
972
        $stmt->execute();
973
974
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
975
    }
976
977
    /**
978
     * Returns a basic query to retrieve Type data.

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

@@ 1206-1226 (lines=21) @@
1203
     *
1204
     * @return array
1205
     */
1206
    public function loadTrashByLocation($locationId)
1207
    {
1208
        $query = $this->handler->createSelectQuery();
1209
        $query
1210
            ->select('*')
1211
            ->from($this->handler->quoteTable('ezcontentobject_trash'))
1212
            ->where(
1213
                $query->expr->eq(
1214
                    $this->handler->quoteColumn('node_id'),
1215
                    $query->bindValue($locationId)
1216
                )
1217
            );
1218
        $statement = $query->prepare();
1219
        $statement->execute();
1220
1221
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
1222
            return $row;
1223
        }
1224
1225
        throw new NotFound('trash', $locationId);
1226
    }
1227
1228
    /**
1229
     * List trashed items.