Skip to content

Commit

Permalink
Check if data is generic binary type
Browse files Browse the repository at this point in the history
  • Loading branch information
anas-srikou committed Sep 12, 2023
1 parent 93561bb commit b170e66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Resources/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use DreamFactory\Core\Exceptions\InternalServerErrorException;
use DreamFactory\Core\Exceptions\NotFoundException;
use DreamFactory\Core\Exceptions\RestException;
use DreamFactory\Core\MongoDb\Enums\BinaryDataTypes;
use DreamFactory\Core\MongoDb\Services\MongoDb;
use DreamFactory\Core\Database\Resources\BaseNoSqlDbTableResource;
use DreamFactory\Core\Utility\DataFormatter;
Expand Down Expand Up @@ -679,10 +680,8 @@ protected static function fromMongoObjects($record)
}
$data = $data->toDateTime();
$data = ['$date' => $data->format($cfgFormat)];
} elseif ($data instanceof Binary) {
if ($data->getType() == 0) {
$data = $data->getData();
}
} elseif ($data instanceof Binary && $data->getType() === BinaryDataTypes::GENERIC) {
$data = $data->getData();
}
}
}
Expand Down

0 comments on commit b170e66

Please sign in to comment.