Total Complexity | 1 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class ModelPostTypeMismatchException extends \RuntimeException |
||
8 | { |
||
9 | const MESSAGE_FORMAT = '{modelClass} instantiated with post of type "{givenPostType}", but requires a post of type "{modelPostType}".'; |
||
10 | |||
11 | /** |
||
12 | * The model's full class name |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $modelClass; |
||
16 | |||
17 | /** |
||
18 | * The post object |
||
19 | * @var WP_Post |
||
20 | */ |
||
21 | protected $post; |
||
22 | |||
23 | /** |
||
24 | * ModelPostTypeMismatchException Constructor. |
||
25 | * |
||
26 | * @param string $modelClass The model's full class name |
||
27 | * @param WP_Post $post The post object |
||
28 | */ |
||
29 | public function __construct($modelClass, WP_Post $post) |
||
44 |