Hello, i'm implementing a Zend\Form on ZF2, i already got my form working
with my entities, i also attach a InputFilter to the form.

What i want to do know is modify a validator already attached, im not even
sure if this is the best way to accomplish what i want to do.

What i want to do is validate that a field is not already present on my
database when creating a new record, for this, i implement Db\NoRecordExists
on my input. But i also want to exclude certain Row from the validation when
i`m editing that row, so i can store the row with its actual field IE:

Table A
id|name|code
1|Test 1|AB1
2|Test 2|AB2

- When *CREATING* a new row, validate that /code/ doesn't exists in table.
- When *EDITING* row ID 1, i want to validate that /code/ cannot be stored
as AB2 (already used in row ID 2), but allow to save as AB1(its same code)
or AB3 (a new code).

What i want to do is get the validator within my controller and *setExclude*
on the Db\NoRecordExists, but i don't know how to get the validator, or if
this is the best way to this.

Any suggestion is appreciated.




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-Get-validator-instance-from-an-input-filter-tp4658160.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to