Skip to content

Commit

Permalink
Adding cakeError calls to ModelBehavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 27, 2009
1 parent c2db059 commit 7ca1ef2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cake/libs/model/model_behavior.php
Expand Up @@ -292,6 +292,21 @@ function attach($behavior, $config = array()) {
$class = $name . 'Behavior';

if (!App::import('Behavior', $behavior)) {
$this->cakeError('missingBehaviorFile', array(array(
'behavior' => $behavior,
'file' => Inflector::underscore($behavior) . '.php',
'code' => 500,
'base' => '/'
)));
return false;
}
if (!class_exists($behavior . 'Behavior')) {
$this->cakeError('missingBehaviorClass', array(array(
'behavior' => $behavior,
'file' => Inflector::underscore($behavior) . '.php',
'code' => 500,
'base' => '/'
)));
return false;
}

Expand Down

0 comments on commit 7ca1ef2

Please sign in to comment.