Download the PHP package phly/phly-mongo without Composer
On this page you can find all versions of the php package phly/phly-mongo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phly-mongo
PhlyMongo - ZF2 Module for Mongo Integration
PhlyMongo provides the following to assist with Mongo usage in ZF2:
- Hydrating Mongo resultset
- Mongo paginator adapter
- Mongo paginator adapter for hydrating resultsets
- Configurable service factories for the Mongo, MongoDB, and MongoCollection classes
Installation
Simplest is to add the following to composer.json
:
And then run:
Alternately, use git to install this as a submodule:
Usage
Services
In order to remain as flexible as possible, the service factories require that
you pass information to the constructors. As such, you should typically
configure and setup the factories via your Module.php
definition:
If you want the server, server options, database, collection, or any service names to be dynamic, consider wrapping the factories in closures, and passing in configuration:
However, if you need to do this, you might just as easily use the native Mongo classes.
Hydrating Cursor
The hydrating cursor is useful as a way to map result sets to objects.
Pass a MongoCursor
instance to the constructor, along with a hydrator and a
prototype object, and you're set:
Paginator Adapter
The paginator adapter allows you to use a MongoCursor
with Zend\Paginator
.
Pass a MongoCursor
to the constructor, and then pass the adapter to the
paginator instance.
Hydrating Paginator Adapter
This builds on the paginator adapter, and simply alters it to accept
specifically a PhlyMongo\HydratingMongoCursor
in the constructor, allowing
you to return objects of a specific type during iteration.
All versions of phly-mongo with dependencies
ext-mongo Version *
zendframework/zend-i18n Version ~2.0
zendframework/zend-paginator Version ~2.0
zendframework/zend-servicemanager Version ~2.0
zendframework/zend-stdlib Version ~2.0