PHP Class MongoCode

Inheritance: implements Alcaeus\MongoDbAdapter\TypeInterface
Show file Open project: alcaeus/mongo-php-adapter Class Usage Examples

Public Methods

Method Description
__construct ( string $code, array $scope = [] )
__toString ( ) : string Returns this code as a string
toBSONType ( ) : MongoDB\BSON\Javascript Converts this MongoCode to the new BSON JavaScript type

Method Details

__construct() public method

public __construct ( string $code, array $scope = [] )
$code string A string of code
$scope array The scope to use for the code

__toString() public method

Returns this code as a string
public __toString ( ) : string
return string

toBSONType() public method

Converts this MongoCode to the new BSON JavaScript type
public toBSONType ( ) : MongoDB\BSON\Javascript
return MongoDB\BSON\Javascript