Code Duplication    Length = 20-21 lines in 3 locations

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

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

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

@@ 1223-1243 (lines=21) @@
1220
     *
1221
     * @return array
1222
     */
1223
    public function loadTrashByLocation($locationId)
1224
    {
1225
        $query = $this->handler->createSelectQuery();
1226
        $query
1227
            ->select('*')
1228
            ->from($this->handler->quoteTable('ezcontentobject_trash'))
1229
            ->where(
1230
                $query->expr->eq(
1231
                    $this->handler->quoteColumn('node_id'),
1232
                    $query->bindValue($locationId)
1233
                )
1234
            );
1235
        $statement = $query->prepare();
1236
        $statement->execute();
1237
1238
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
1239
            return $row;
1240
        }
1241
1242
        throw new NotFound('trash', $locationId);
1243
    }
1244
1245
    /**
1246
     * List trashed items.