zendframework/zf2 — pull request #3560 by asifjaveduk (2013-01-25 16:46:36+00:00)
Title: Include functionality opposite to Exclude to db validator

Provide Include functionality opposite to Exclude to db validator

$validator = new Zend_Validate_Db_NoRecordExists(
array(
'table' => 'users',
'field' => 'username',
'include' => array(
'field' => 'id',
'value' => $user_id
)
)
);
exclude docs are http://framework.zend.com/manual/1.12/en/zend.validate.set.html#zend.validate.db.excluding-records

Scenario where it is needed http://stackoverflow.com/questions/14502961/zf2-db-recordexists-check-additional-columns/