Skip to content

Commit

Permalink
YParent metot uyumluluğu sağlandı
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammetsafak committed Jul 30, 2023
1 parent a257936 commit f6c75fd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
ModelCallbacksException,
ModelException,
ModelRelationsException,
QueryBuilderException,
QueryGeneratorException,
ReadableException,
UpdatableException,
WritableException};
Expand Down Expand Up @@ -243,7 +245,7 @@ final public function withPrimaryKey(string $column): self
* @param array $set
* @return array|false
*/
final public function create(array $set)
final public function create(?array $set = null)
{
return $this->insert($set);
}
Expand All @@ -252,16 +254,16 @@ final public function create(array $set)
* @param array $set
* @return array|false
*/
final public function createBatch(array $set)
final public function createBatch(?array $set = null)
{
return $this->insertBatch($set);
}

/**
* @param array $set
* @return array|false
* @return array|bool
*/
final public function insert(array $set)
final public function insert(?array $set = null)
{
if($this->isWritable() === FALSE){
throw new WritableException('"' . \get_called_class() . '" is not a writable model.');
Expand Down Expand Up @@ -361,7 +363,7 @@ final public function readOne(array $selector = [], array $conditions = [], arra
* @param array $set
* @return array|bool
*/
final public function update(array $set)
final public function update(?array $set = null)
{
if($this->isUpdatable() === FALSE){
throw new UpdatableException('"' . \get_called_class() . '" is not a updatable model.');
Expand All @@ -378,11 +380,13 @@ final public function update(array $set)
}

/**
* @param array $set
* @param string $referenceColumn
* @param array|null $set
* @return array|false
* @throws QueryBuilderException
* @throws QueryGeneratorException
*/
final public function updateBatch(array $set, string $referenceColumn)
final public function updateBatch(string $referenceColumn, ?array $set = null)
{
if($this->isUpdatable() === FALSE){
throw new UpdatableException('"' . \get_called_class() . '" is not a updatable model.');
Expand All @@ -397,7 +401,7 @@ final public function updateBatch(array $set, string $referenceColumn)
}
}

if(parent::updateBatch($set, $referenceColumn) === FALSE){
if(parent::updateBatch($referenceColumn, $set) === FALSE){
return false;
}

Expand Down

0 comments on commit f6c75fd

Please sign in to comment.