This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Felix Geisendörfer (author)
Thu Mar 05 18:09:24 -0800 2009
| name | age | message | |
|---|---|---|---|
| .. | |||
| |
lookupable.php | Sat Aug 30 05:15:00 -0700 2008 | |
| |
readme.textile | Sat Aug 30 05:15:00 -0700 2008 |
cakephp/behaviors/lookupable/readme.textile
CakePHP Lookupable Behavior
A CakePHP behavior to easily look up the id’s of records or create them if they do not exist yet. Useful when working with lots of lookup / status tables.
Installing
1. Copy lookupable.php to app/models/behaviors/
2. Open / create app/app_model.php and add the following:
class AppModel extends Model{
var $actsAs = array('Lookupable');
}
Usage / Docs
To lookup the id of lets say your ‘Admin’ group, you can simply do:
$group_id = $this->Group->lookup('Admin');
If the group does not exist yet, the behavior will automatically create it and return the id of the newly created record.
Known Bugs
None







