-
Notifications
You must be signed in to change notification settings - Fork 3
Home
- Installation
- Configuring a Datasource 0.1.0+
- Accessing Collections 0.2.0+
- Query Logging 0.3.0+
- Roadmap and Contributors
I had the idea to build this project at the very inception of CakePHP 3.x. A MongoDB datasource was readily available for version 2.x, but after the CakePHP core team settled on more of a object-relational model for 3.x, a lot of developers were left scratching their heads as to how to implement such a beast. I'd seen a few implementations created that attempted to model themselves after 3.x's repository and entity interfaces only to see them die out and lose support over time. This is where this plugin comes in.
I initially toyed with the idea of developing a plugin that implements the repo and entity interfaces, I have since shyed away from this idea. The point of this plugin is not to reinvent the wheel and repackage the same data access methods that have been rehashed over and over again. Instead, this plugin is a wrapper for the Monga library, provided by the League of Extraordinary Packages. Monga does a fantastic job of implementing PHP's native Mongo drivers. This plugin was developed to take Monga and bring it in line with some of the standards and design patterns presented by CakePHP so that transitioning to using a NoSQL datasource can be made simple, elegant, and efficient.
This plugin is a wrapper for the popular Monga library provided by The League of Extraordinary packages. In it's current form, this plugin is intended to get you quickly set up and running with access to a MongoDB instance so that you can access your data in your application. This plugin provides all of the same functionality that the Monga library provides in terms of building queries and retrieving your data.
This plugin is not currently intended as a drop in replacement for the SQL ORM provided by CakePHP core. While you could theoretically build an entire application using cakephp-monga as the data layer, this plugin does not have the kind of application level integration (Events, Logging, etc) that the current ORM does. Additionally, there is not abstraction layer for Database level, Collection level, or Entity level objects (EG - Defining methods on a supposed UserCollection.php, or creating a Mongo Entity at User.php), although this is on the roadmap for a future version very soon.
Additionally, it's important to recognize that while certain relational features can be emulated within a MongoDB dataset, Mongo is still not an ACID compliant database. In the future, Collection level classes will be built for object abstraction that will implement CakePHP's Repository interface, but it should be noted that full ORM features will not be supported as Mongo is not a true object relational database.