Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cake consoleCommand databaseConfig
- class AppModel extends Model
- private function _before() {
- $conn = Configure::read('dbConnection');
- if(!empty($conn))
- $this->setDataSource($conn);
- }
- public function beforeValidate($options = array()) {
- $this->_before();
- parent::beforeValidate();
- }
- public function beforeDelete($bool = true) {
- $this->_before();
- parent::beforeDelete($bool);
- }
- public function beforeFind($queryData) {
- $this->_before();
- parent::beforeFind($queryData);
- }
- public function beforeSave($options=array()) {
- $this->before();
- parent::beforeSave($options);
- }
Add Comment
Please, Sign In to add comment