Skip to content

Commit f6c75fd

Browse files
committed
YParent metot uyumluluğu sağlandı
1 parent a257936 commit f6c75fd

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/Model.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ModelCallbacksException,
1919
ModelException,
2020
ModelRelationsException,
21+
QueryBuilderException,
22+
QueryGeneratorException,
2123
ReadableException,
2224
UpdatableException,
2325
WritableException};
@@ -243,7 +245,7 @@ final public function withPrimaryKey(string $column): self
243245
* @param array $set
244246
* @return array|false
245247
*/
246-
final public function create(array $set)
248+
final public function create(?array $set = null)
247249
{
248250
return $this->insert($set);
249251
}
@@ -252,16 +254,16 @@ final public function create(array $set)
252254
* @param array $set
253255
* @return array|false
254256
*/
255-
final public function createBatch(array $set)
257+
final public function createBatch(?array $set = null)
256258
{
257259
return $this->insertBatch($set);
258260
}
259261

260262
/**
261263
* @param array $set
262-
* @return array|false
264+
* @return array|bool
263265
*/
264-
final public function insert(array $set)
266+
final public function insert(?array $set = null)
265267
{
266268
if($this->isWritable() === FALSE){
267269
throw new WritableException('"' . \get_called_class() . '" is not a writable model.');
@@ -361,7 +363,7 @@ final public function readOne(array $selector = [], array $conditions = [], arra
361363
* @param array $set
362364
* @return array|bool
363365
*/
364-
final public function update(array $set)
366+
final public function update(?array $set = null)
365367
{
366368
if($this->isUpdatable() === FALSE){
367369
throw new UpdatableException('"' . \get_called_class() . '" is not a updatable model.');
@@ -378,11 +380,13 @@ final public function update(array $set)
378380
}
379381

380382
/**
381-
* @param array $set
382383
* @param string $referenceColumn
384+
* @param array|null $set
383385
* @return array|false
386+
* @throws QueryBuilderException
387+
* @throws QueryGeneratorException
384388
*/
385-
final public function updateBatch(array $set, string $referenceColumn)
389+
final public function updateBatch(string $referenceColumn, ?array $set = null)
386390
{
387391
if($this->isUpdatable() === FALSE){
388392
throw new UpdatableException('"' . \get_called_class() . '" is not a updatable model.');
@@ -397,7 +401,7 @@ final public function updateBatch(array $set, string $referenceColumn)
397401
}
398402
}
399403

400-
if(parent::updateBatch($set, $referenceColumn) === FALSE){
404+
if(parent::updateBatch($referenceColumn, $set) === FALSE){
401405
return false;
402406
}
403407

0 commit comments

Comments
 (0)