Skip to content

Commit

Permalink
use static instead of self to override methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar authored Aug 18, 2021
1 parent 4f133e6 commit 77dd97f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ActiveEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ public function save(Client $client, array $attributes = [])
}

if ($this->isNewRecord) {
$request = self::insert($values);
$request = static::insert($values);
} else {
$request = self::update($this->getPrimaryKeyValue(), $values);
$request = static::update($this->getPrimaryKeyValue(), $values);
}
$response = $request->response($client);

Expand All @@ -326,7 +326,7 @@ public function save(Client $client, array $attributes = [])
*/
public function erase(Client $client)
{
return self::remove($this->getPrimaryKeyValue())->response($client)->isSuccess();
return static::remove($this->getPrimaryKeyValue())->response($client)->isSuccess();
}

/**
Expand All @@ -353,7 +353,7 @@ public static function iterator(array $data, $keyColumn = null)
*/
public function reload(Client $client, array $expand = [])
{
$reload = self::view($this->getPrimaryKeyValue())->setExpand($expand)->response($client);
$reload = static::view($this->getPrimaryKeyValue())->setExpand($expand)->response($client);

$this->refresh($reload->getContent());
}
Expand Down

0 comments on commit 77dd97f

Please sign in to comment.