Skip to content

Commit

Permalink
Improve error and use count() instead of empty().
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 17, 2018
1 parent f21c436 commit 9abaeb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ORM/Table.php
Expand Up @@ -1989,10 +1989,10 @@ protected function _update($entity, $data)
return $entity;
}

if (empty($primaryColumns)) {
if (count($primaryColumns) === 0) {
$entityClass = get_class($entity);
$table = $this->getTable();
$message = "Cannot update `$entityClass` the `$table` has no primary key.";
$message = "Cannot update `$entityClass`. The `$table` has no primary key.";
throw new InvalidArgumentException($message);
}

Expand Down

0 comments on commit 9abaeb2

Please sign in to comment.