04.03
php
Matt
Note
Matt did not leave a note
Matt did not leave a note
- <?php
- /*
- For Containable to work I add:
- $Model->{$name};
- on line 338 of /cake/libs/model/behaviors/containable.php right before
- if (!isset($Model->{$name}) || !is_object($Model->{$name})) {
- Hack for now...there's probably a better way
- */
- class AppModel extends Model {
- var $recursive = -1;
- //back up all the defined associations before calling parent::__construct
- //this way none of the related models are loaded.
- function __construct($id = false, $table = null, $ds = null) {
- foreach($this->__associations as $association) {
- foreach($this-> {$association} as $key => $value) {
- $assocName = $key;
- $assocName = $value;
- }
- $value['type'] = $association;
- $this->__definedAssociations[$assocName] = $value;
- }
- }
- }
- }
- parent::__construct($id, $table, $ds);
- }
- function __get($name) {
- return false;
- }
- $this->bind($name, $this->__definedAssociations[$name]);
- return $this-> {$name};
- }
- }
- ?>
Parsed in 0.050 seconds, using GeSHi 1.0.7.14