Some refactoring for PHP 5.3

This commit is contained in:
Frédéric Guillot
2014-11-22 18:49:34 -05:00
parent 77e10d2582
commit c49d46718a
9 changed files with 39 additions and 67 deletions

View File

@@ -260,15 +260,7 @@ class User extends Base
public function create(array $values)
{
$this->prepare($values);
return $this->db->transaction(function($db) use ($values) {
if (! $db->table(User::TABLE)->save($values)) {
return false;
}
return (int) $db->getConnection()->getLastId();
});
return $this->persist(self::TABLE, $values);
}
/**