Skip to content

Commit

Permalink
Added missing MissingModelException class.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 17, 2014
1 parent 4155163 commit a1cdf96
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions src/Model/Error/MissingModelException.php
@@ -0,0 +1,27 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Model\Error;

use Cake\Error\Exception;

/**
* Used when a model cannot be found.
*
*/
class MissingModelException extends Exception {

protected $_messageTemplate = 'Model class %s could not be found.';

}
2 changes: 1 addition & 1 deletion src/Model/ModelAwareTrait.php
Expand Up @@ -70,7 +70,7 @@ protected function _setModelClass($name) {
* @param string $type The type of repository to load. Defaults to 'Table' which
* delegates to Cake\ORM\TableRegistry.
* @return bool True when single repository found and instance created.
* @throws \Cake\Model\Error\MissingModelException if the model class cannot be found.
* @throws \Cake\Model\Error\MissingModelException If the model class cannot be found.
* @throws \Cake\Error\Exception When using a type that has not been registered.
*/
public function loadModel($modelClass = null, $type = 'Table') {
Expand Down
2 changes: 1 addition & 1 deletion src/TestSuite/Fixture/TestFixture.php
Expand Up @@ -112,7 +112,7 @@ public function __construct() {
* Initialize the fixture.
*
* @return void
* @throws \Cake\Error\MissingModelException Whe importing from a model that does not exist.
* @throws \Cake\ORM\Error\MissingTableException When importing from a table that does not exist.
*/
public function init() {
if ($this->table === null) {
Expand Down

0 comments on commit a1cdf96

Please sign in to comment.