Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

CakePHP 2.0 plugin to bridge with Doctrine MongoDB ODM in order to use models as objects persisted by Doctrine. This changes the original CakePHP feature of returning arrays of results, and instead returns objects wich are cleaner to manage and extend.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Config
Octocat-spinner-32 Console
Octocat-spinner-32 Controller
Octocat-spinner-32 Lib
Octocat-spinner-32 Test
Octocat-spinner-32 Vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 readme.md
readme.md

Installation

Change into your Plugin directory, and checkout the git repo:

cd Plugin
git clone git://github.com/lorenzo/MongoCake.git
cd MongoCake
git submodule update --init --recursive

Configuration

You first need to activate the plugin in CakePHP after placing it in the correct folder:

CakePlugin::load('MongoCake', array('bootstrap' => true));

Use this MongoCake plugin like any other datasource, with its own configuration options:

// Within Config/database.php
public $default = array(
    'datasource' => 'MongoCake.CakeMongoSource',
    'server' => 'localhost', // Optional
    'database' => 'mydatabase', // Database to use
);

Models

Ensure that your models extend the CakeDocument class.

class User extends CakeDocument {
}
Something went wrong with that request. Please try again.