232,077 Installs and Counting! Get Sparks Now!
Hey! Keep up to date with the project through its beta and public launch by following @getsparks.
Tweet
A Quick Looks At Sparks (EllisLab Official Post)
March 11, 2012
from: codeigniter.com
The Top Sparks of 2011
December 31, 2011
from: codefury.net
CodeIgniter Starter Project − A Starting Point for Any CI Dev
December 12, 2011
from: github.com
NetTuts+ Tutorial for GetSparks
November 24, 2011
from: net.tutsplus.com
Easily add Doctrine2 ORM horsepower to your ignited code!
| Contributor | : stickgrinder |
| : Log in to view | |
| Author Website | : http://www.agavee.com |
| Spark Website | : https://github.com/stickgrinder/doctrine2-spark |
| Repository Type | : git |
| Number of Installs | : 1,355 |
php tools/spark install -v1.0.0 doctrine2
Or download this version manually:
Get doctrine2-v1.0.zip
This Spark seamlessly integrates Doctrine2 ORM in CI2. Doctrine2 is a powerful ORM based on DataMapper pattern, providing database abstraction, entities-based ORM complete with an entity manager, and a powerful command line tool to automate many tasks. This spark contains both Doctrine2 library and the CLI tool, but to make it work you'll have to copy some files by hand.
After installing this Spark, create a directory called proxies inside your application/models folder and make it writable:
$ cd /path/to/your/ci2/installation
$ mkdir ./application/models/proxies
$ chmod a+w ./application/models/proxies
You could use this Spark as any other, by loading it in your controller:
$this->load->sparks('doctrine2');
// entity manager is loaded
$this->doctrine2->em(...);
To make access to entity manager more comfortable, use this:
$this->load->sparks('doctrine2');
$this->em = $this->doctrine2->em;
// your Entity Manager is now quickly available
$this->em(...);
To enable CLI tool, follow these instructions:
Copy tools folder from Spark directory to your CI2 installation path (if you're using Sparks you should already have a tools directory in your installation path):
$ cd /path/to/your/ci2/installation
$ cp ./sparks/doctrine2/
Use the CLI tool from your tools directory:
$ tools/doctrine COMMAND PARAMS
Remember that your model entities will have to be placed in application/models directory, while generated proxies will be put in application/models/proxies directory.
There is no known bugs so far, but some feature is missing from a "standard" application/libraries-based installation.
$this->load->spark() is unavailable at this stage. I also tried with a post_controller_constructor hook but: 1) something didn't work and 2) this is an awful workaround and the right way is to getting sparks autoloading functionality to work as intended. This will therefore be addressed in a future release.$this->em if Doctrine2 spark is autoloaded, but I'll have to solve previous point, obviously.If you could find solutions to above problems, please contact me or send a pull request on GitHub project page: https://github.com/stickgrinder/doctrine2-spark
This Spark has been "sponsored" by Agavee Team, written by Paolo Pustorino (hey, that's me! :) follow @stickgrinder tweets) and it's hosted on GitHub.
Thanks to Joseph Wynn for his clear tutorial, and thanks to all that will find (and fix!) bugs, send me nice twits and offer me some beer&pizza! :)