PHPackages                             josegonzalez/cakephp-simple-scope - 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-simple-scope

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

josegonzalez/cakephp-simple-scope
=================================

A simple cakephp behavior for scoping finds.

1.1.0(12y ago)135781MITPHP

Since Feb 11Pushed 10y ago2 watchersCompare

[ Source](https://github.com/josegonzalez/cakephp-simple-scope)[ Packagist](https://packagist.org/packages/josegonzalez/cakephp-simple-scope)[ Docs](http://github.com/josegonzalez/cakephp-simple-scope)[ RSS](/packages/josegonzalez-cakephp-simple-scope/feed)WikiDiscussions master Synced 4w ago

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

[![Build Status](https://camo.githubusercontent.com/ebd9e266b1dfb8f3e9fd298a8d2c3fbadac82040fe3d195b3572faaff33a8912/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a6f7365676f6e7a616c657a2f63616b657068702d73696d706c652d73636f70652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/josegonzalez/cakephp-simple-scope)[![Coverage Status](https://camo.githubusercontent.com/40556794784b811250e139129a7c0820abb23f7640dd60437957c8d720d06c54/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a6f7365676f6e7a616c657a2f63616b657068702d73696d706c652d73636f70652e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/josegonzalez/cakephp-simple-scope?branch=master)[![Total Downloads](https://camo.githubusercontent.com/200a3ab150cd22a094dd0b644bb6a4fe8115f07d915e763c96ec10e0b913d37f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f7365676f6e7a616c657a2f63616b657068702d73696d706c652d73636f70652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josegonzalez/cakephp-simple-scope)[![Latest Stable Version](https://camo.githubusercontent.com/6b968ed18d44c24188bb39bf2317d0d15196d8e9b2c059f2125ef2894d540d9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f7365676f6e7a616c657a2f63616b657068702d73696d706c652d73636f70652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josegonzalez/cakephp-simple-scope)[![Documentation Status](https://camo.githubusercontent.com/9b54b7859c0a404c47b3b836d50ac53ada2012876ed9fdaadadc3056901a9a97/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f63616b657068702d73696d706c652d73636f70652f62616467652f3f76657273696f6e3d6c6174657374267374796c653d666c61742d737175617265)](https://readthedocs.org/projects/cakephp-simple-scope/?badge=latest)[![Gratipay](https://camo.githubusercontent.com/40a48c7b3fc02e9d39dd715fe09e404c4cb2e89288c6ace0773d2aab6913b46f/68747470733a2f2f696d672e736869656c64732e696f2f67726174697061792f6a6f7365676f6e7a616c657a2e7376673f7374796c653d666c61742d737175617265)](https://gratipay.com/~josegonzalez/)

cakephp-simple-scope
====================

[](#cakephp-simple-scope)

A simple cakephp behavior for scoping finds

Background
----------

[](#background)

I didn't want to write a bunch of custom finds so I just defined an array and made a behavior to interact with that array. Yep.

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

[](#requirements)

- CakePHP 2.x

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

[](#installation)

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

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

```
{
	"require": {
		"josegonzalez/cakephp-simple-scope": "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/SimpleScope` 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 `SimpleScope`

*\[GIT Submodule\]*

In your app directory type:

```
git submodule add git://github.com/josegonzalez/cakephp-simple-scope.git Plugin/SimpleScope
git submodule init
git submodule update

```

*\[GIT Clone\]*

In your plugin directory type

```
git clone git://github.com/josegonzalez/cakephp-simple-scope.git SancSimpleScopetion

```

### Enable plugin

[](#enable-plugin)

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

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

```

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

Usage
-----

[](#usage)

Attach the behavior to your AppModel:

```
