Skip to content
Permalink
Browse files

Including missing file and improving consistency when throwing

exceptions
  • Loading branch information...
lorenzo committed Dec 21, 2013
1 parent a814d6a commit 28eaab1bf5cdc361cc2c1c0e6b8f506d3fab2ced
Showing with 27 additions and 1 deletion.
  1. +25 −0 Cake/ORM/Error/RecordNotFoundException.php
  2. +2 −1 Cake/ORM/Table.php
@@ -0,0 +1,25 @@
<?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 CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\ORM\Error;
use Cake\Error\NotFoundException;
/**
* Exception raised when a particular record was not found
*
*/
class RecordNotFoundException extends NotFoundException {
}
@@ -28,6 +28,7 @@
use Cake\ORM\BehaviorRegistry;
use Cake\ORM\Entity;
use Cake\ORM\Error\MissingEntityException;
use Cake\ORM\Error\RecordNotFoundException;
use Cake\ORM\Marshaller;
use Cake\Utility\Inflector;
use Cake\Validation\Validator;
@@ -816,7 +817,7 @@ public function get($primaryKey, $options = []) {
$entity = $this->find('all', $options)->where($conditions)->first();
if (!$entity) {
throw new Error\RecordNotFoundException(__d(
throw new RecordNotFoundException(__d(
'cake_dev', 'Record "%s" not found in table "%s"',
implode(',', (array)$primaryKey),
$this->alias()

0 comments on commit 28eaab1

Please sign in to comment.
You can’t perform that action at this time.