| 1 |
<?php |
| 2 |
namespace Depicter\Exception; |
| 3 |
|
| 4 |
|
| 5 |
class EntityException extends \Exception |
| 6 |
{ |
| 7 |
private $where; |
| 8 |
|
| 9 |
public function __construct( $message = "", $code = 0, $where = [] ) |
| 10 |
{ |
| 11 |
parent::__construct( $message, $code, null ); |
| 12 |
$this->where = $where; |
| 13 |
} |
| 14 |
|
| 15 |
public function getStatus(){ |
| 16 |
return $this->getWhereCondition( 'status' ); |
| 17 |
} |
| 18 |
|
| 19 |
public function getWhereCondition( $whereCondition ){ |
| 20 |
if ( isset( $this->where[ $whereCondition ] ) ) { |
| 21 |
return $this->where[ $whereCondition ]; |
| 22 |
} |
| 23 |
return null; |
| 24 |
} |
| 25 |
} |
| 26 |
|