diff --git a/src/ORM/Table.php b/src/ORM/Table.php index 895510e70cd..78d3963636c 100644 --- a/src/ORM/Table.php +++ b/src/ORM/Table.php @@ -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); }