We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d67edb8 commit e87a781Copy full SHA for e87a781
core/model/Model.php
@@ -12,7 +12,8 @@ abstract class Model extends Database
12
private $sql;
13
private $where;
14
private $fields;
15
- public $count;
+ private $count;
16
+ private $fetch;
17
18
public function __construct()
19
{
@@ -148,6 +149,20 @@ public function findById($id)
148
149
return self::findOne([$this->pk => $id]);
150
}
151
152
+ public function exists($id)
153
+ {
154
+ if (is_array($id)) {
155
+ return (self::findOne($id));
156
+ }
157
+
158
+ return (self::findById($id));
159
160
161
+ public function fetch()
162
163
+ return $this->fetch;
164
165
166
public function query($sql)
167
168
$this->stmt = $this->conn->prepare($sql);
0 commit comments