spotorm / spot2

Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer
http://phpdatamapper.com
BSD 3-Clause "New" or "Revised" License
601 stars 101 forks source link

Validator executed after unique check (Query fails) #185

Open gregor-tb opened 8 years ago

gregor-tb commented 8 years ago

Mapper::validate is checking uniqueness, followed by if $v->validate().

It should fire validate() first, the Unique-check Query also requires valid entries to succeed. In my case I had a empty string in an integer field and wondered why I got Select Query failure when inserting a fresh object.