Skip to content

Commit

Permalink
[update] change checkOnlyFieldsField to assertOnlyFieldsField as it t…
Browse files Browse the repository at this point in the history
…hrows exception
  • Loading branch information
georgehristov committed Aug 6, 2020
1 parent 0d962c3 commit 3e9c79b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ public function allFields()
return $this;
}

private function checkOnlyFieldsField(string $fieldName)
private function assertOnlyFieldsField(string $fieldName)
{
$field = $this->getField($fieldName); // test if field exists

Expand All @@ -611,7 +611,7 @@ public function isOnlyFieldsField(string $fieldName)
*/
public function isDirty(string $field): bool
{
$this->checkOnlyFieldsField($field);
$this->assertOnlyFieldsField($field);

if (array_key_exists($field, $this->dirty)) {
return true;
Expand Down Expand Up @@ -691,7 +691,7 @@ public function getFields($filter = null): array
*/
public function set(string $field, $value)
{
$this->checkOnlyFieldsField($field);
$this->assertOnlyFieldsField($field);

$f = $this->getField($field);

Expand Down Expand Up @@ -823,7 +823,7 @@ public function get(string $field = null)
return $data;
}

$this->checkOnlyFieldsField($field);
$this->assertOnlyFieldsField($field);

if (array_key_exists($field, $this->data)) {
return $this->data[$field];
Expand Down Expand Up @@ -890,7 +890,7 @@ public function compare(string $name, $value): bool
*/
public function _isset(string $name): bool
{
$this->checkOnlyFieldsField($name);
$this->assertOnlyFieldsField($name);

return array_key_exists($name, $this->dirty);
}
Expand All @@ -902,7 +902,7 @@ public function _isset(string $name): bool
*/
public function _unset(string $name)
{
$this->checkOnlyFieldsField($name);
$this->assertOnlyFieldsField($name);

if (array_key_exists($name, $this->dirty)) {
$this->data[$name] = $this->dirty[$name];
Expand Down

0 comments on commit 3e9c79b

Please sign in to comment.