Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing smart loading of entity class for table
- Loading branch information
Showing
7 changed files
with
166 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* MissingModelException class | ||
This comment has been minimized.
Sorry, something went wrong. |
||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\ORM\Error; | ||
|
||
use Cake\Error\Exception; | ||
|
||
/** | ||
* Exception raised when an Entity could not be found. | ||
* | ||
*/ | ||
class MissingEntityException extends Exception { | ||
|
||
protected $_messageTemplate = 'Entity class %s could not be found.'; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,7 @@ | |
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @copyright Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
This comment has been minimized.
Sorry, something went wrong.
dereuromark
Member
|
||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
|
@@ -20,11 +19,11 @@ | |
use Cake\Error\Exception; | ||
|
||
/** | ||
* Exception raised when a Model could not be found. | ||
* Exception raised when an Entity could not be found. | ||
* | ||
*/ | ||
class MissingTableClassException extends Exception { | ||
class MissingEntityException extends Exception { | ||
|
||
protected $_messageTemplate = 'Table class %s could not be found.'; | ||
protected $_messageTemplate = 'Entity class %s could not be found.'; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace TestApp\Model\Entity; | ||
|
||
use Cake\ORM\Entity; | ||
|
||
/** | ||
* Tests entity class used for asserting correct loading | ||
* | ||
*/ | ||
class Article extends Entity { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html> | ||
* Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice | ||
* | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace TestApp\Model\Repository; | ||
|
||
use Cake\ORM\Table; | ||
|
||
/** | ||
* Article class | ||
* | ||
*/ | ||
class ArticleTable extends Table { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This text is wrong, and could be removed really.