diff --git a/README.md b/README.md index bf7e4e0..82e4ca3 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ SimpleCrud has the following classes: Create a new entity for each table in the database in a common namespace: -``` +```php namespace MyApp\Entities; use SimpleCrud\Entity; @@ -298,4 +298,4 @@ $post->comments; //Access to the cached result instead execute getComments() aga $post->lowercaseTitle; //Execute getLowercaseTitle() and save the result in $post->lowercaseTitle; ``` -Check the commented code to know full API. \ No newline at end of file +Check the commented code to know full API. diff --git a/SimpleCrud/Entity.php b/SimpleCrud/Entity.php index d0c032a..e542652 100644 --- a/SimpleCrud/Entity.php +++ b/SimpleCrud/Entity.php @@ -490,10 +490,10 @@ public function update (array $data, $where = '', $marks = null, $limit = null, unset($data['id']); - if (empty($data)) { + if (!$data) { return $data; } - + $quoted = $this->manager->quote($data, $this->getFields(self::FIELDS_DATA_TYPE)); $set = [];