src/Filesystem/Adapter/GridFS.php
protected function writeObject($path, $content, array $metadata)
	{
		try {
			if (\is_resource($content)) {
				$id = $this->client->storeFile($content, $metadata);
			} else {
				$id = $this->client->storeBytes($content, $metadata);
			}
		} catch (MongoGridFSException $e) {
			return false;
		}

		$file = $this->client->findOne(['_id' => $id]);

		return $this->normalizeGridFSFile($file, $path);
	}
protected function writeObject($path, $content, array $metadata)
	{
		try {
			if (\is_resource($content)) {
				$id = $this->client->storeFile($content, $metadata);
			} else {
				$id = $this->client->storeBytes($content, $metadata);
			}
		} catch (MongoGridFSException $e) {
			return false;
		}

		$file = $this->client->findOne(['_id' => $id]);

		return $this->normalizeGridFSFile($file, $path);
	}
protected function writeObject ( $ path , $ content , array $ metadata ) { try { if ( \ is_resource ( $ content ) ) { $ id = $ this -> client -> storeFile ( $ content , $ metadata ) ; } else { $ id = $ this -> client -> storeBytes ( $ content , $ metadata ) ; } } catch ( MongoGridFSException $ e ) { return false ; } $ file = $ this -> client -> findOne ( [ '_id' => $ id ] ) ; return $ this -> normalizeGridFSFile ( $ file , $ path ) ; }
Write an object to GridFS.

@param array $metadata

@return array|false normalized file representation
Write an object to GridFS .