PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 1.5.21
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v1.5.21
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
fluent-booking / vendor / wpfluent / framework / src / WPFluent / Database / Orm / ModelNotFoundException.php

ModelNotFoundException.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution 1.5.21, at vendor/wpfluent/framework/src/WPFluent/Database/Orm/ModelNotFoundException.php

67 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBooking\Framework\Database\Orm;
4
5 use FluentBooking\Framework\Support\Arr;
6 use FluentBooking\Framework\Database\RecordsNotFoundException;
7
8 class ModelNotFoundException extends RecordsNotFoundException
9 {
10 /**
11 * Name of the affected Orm model.
12 *
13 * @var string
14 */
15 protected $model;
16
17 /**
18 * The affected model IDs.
19 *
20 * @var int|array
21 */
22 protected $ids;
23
24 /**
25 * Set the affected Orm model and instance ids.
26 *
27 * @param string $model
28 * @param int|array $ids
29 * @return $this
30 */
31 public function setModel($model, $ids = [])
32 {
33 $this->model = $model;
34 $this->ids = Arr::wrap($ids);
35
36 $this->message = "No query results for model [{$model}]";
37
38 if (count($this->ids) > 0) {
39 $this->message .= ' '.implode(', ', $this->ids);
40 } else {
41 $this->message .= '.';
42 }
43
44 return $this;
45 }
46
47 /**
48 * Get the affected Orm model.
49 *
50 * @return string
51 */
52 public function getModel()
53 {
54 return $this->model;
55 }
56
57 /**
58 * Get the affected Orm model IDs.
59 *
60 * @return int|array
61 */
62 public function getIds()
63 {
64 return $this->ids;
65 }
66 }
67