PHPackages                             josegonzalez/cakephp-entity - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. josegonzalez/cakephp-entity

AbandonedArchivedCakephp-plugin[Database &amp; ORM](/categories/database)

josegonzalez/cakephp-entity
===========================

Use model objects/classes instead of arrays in your CakePHP application

3.0.2(10y ago)2935.7k↓38.5%11[1 PRs](https://github.com/josegonzalez/cakephp-entity/pulls)MITPHPPHP &gt;=5.4

Since Aug 27Pushed 7y ago6 watchersCompare

[ Source](https://github.com/josegonzalez/cakephp-entity)[ Packagist](https://packagist.org/packages/josegonzalez/cakephp-entity)[ Docs](https://github.com/josegonzalez/cakephp-entity)[ RSS](/packages/josegonzalez-cakephp-entity/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/5e11955a60699f1f98480de3ae6b155a9eb4d58dc044d0eb20400ddc0523c2c9/68747470733a2f2f7472617669732d63692e6f72672f6a6f7365676f6e7a616c657a2f63616b657068702d656e746974792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/josegonzalez/cakephp-entity) [![Coverage Status](https://camo.githubusercontent.com/36ceafdb1987a3c613da7192bbe5d7d7aa1536a740c56388c7c91e0c9d68aa6b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6a6f7365676f6e7a616c657a2f63616b657068702d656e746974792f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/josegonzalez/cakephp-entity?branch=master) [![Total Downloads](https://camo.githubusercontent.com/614fd53667d84c44463dbbb712e1d73e552e43306d3453d9193191895038edb0/68747470733a2f2f706f7365722e707567782e6f72672f6a6f7365676f6e7a616c657a2f63616b657068702d656e746974792f642f746f74616c2e706e67)](https://packagist.org/packages/josegonzalez/cakephp-entity) [![Latest Stable Version](https://camo.githubusercontent.com/b5fb4c827d4844b3fd4b3baa014fd6175547759b8e611c845e06f1f50cddf20a/68747470733a2f2f706f7365722e707567782e6f72672f6a6f7365676f6e7a616c657a2f63616b657068702d656e746974792f762f737461626c652e706e67)](https://packagist.org/packages/josegonzalez/cakephp-entity)

CakePHP Entity Plugin
=====================

[](#cakephp-entity-plugin)

Background
----------

[](#background)

- find() now returns an array of objects instead of arrays of arrays.
- 100% compatible with the standard Model.
- Open source. Available on GitHub. MIT Lisense.
- CakePHP 2.4+, PHP 5.4+

Originally:

Requirements
------------

[](#requirements)

- CakePHP 2.4
- PHP 5.3
- Patience

Installation
------------

[](#installation)

*\[Using [Composer](http://getcomposer.org/)\]*

Add the plugin to your project's `composer.json` - something like this:

```
{
	"require": {
		"josegonzalez/cakephp-entity": "dev-master"
	}
}

```

Because this plugin has the type `cakephp-plugin` set in it's own `composer.json`, composer knows to install it inside your `/Plugins` directory, rather than in the usual vendors file. It is recommended that you add `/Plugins/Entity` to your .gitignore file. (Why? [read this](http://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).)

*\[Manual\]*

- Download this:
- Unzip that download.
- Copy the resulting folder to `app/Plugin`
- Rename the folder you just copied to `Entity`

*\[GIT Submodule\]*

In your app directory type:

```
git submodule add -b master git://github.com/josegonzalez/cakephp-entity.git Plugin/Entity
git submodule init
git submodule update

```

*\[GIT Clone\]*

In your `Plugin` directory type:

```
git clone -b master git://github.com/josegonzalez/cakephp-entity.git Entity

```

*\[Composer\]*

Add the following to your `composer.json`:

```
"cakephp-entity": "1.0.0"

```

And then run the `composer update` command to install the dependency.

### Enable plugin

[](#enable-plugin)

In 2.0 you need to enable the plugin in your `app/Config/bootstrap.php` file:

```
CakePlugin::load('Entity');

```

If you are already using `CakePlugin::loadAll();`, then this is not necessary.

Usage
-----

[](#usage)

CakeEntity doesn't change anything with your current the installation. You'll have to enable the functionality by indicating it be used. This is for compatibility reasons.

Use `Table` as the super class of models where you'd like to activate the plugin.

```
