JaquelineBrandao / yii

Automatically exported from code.google.com/p/yii
0 stars 0 forks source link

[Request] Binding extra parameters in CUniqueValidator #966

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As discussed here 
http://www.yiiframework.com/forum/index.php?/topic/7524-extension-for-
cuniquevalidator/

Original issue reported on code.google.com by pieter.debaets on 27 Feb 2010 at 3:13

GoogleCodeExporter commented 9 years ago
Set for next release.

Original comment by qiang.xue on 13 Mar 2010 at 2:18

GoogleCodeExporter commented 9 years ago
Move to 1.1.3 release.

Original comment by qiang.xue on 2 May 2010 at 2:19

GoogleCodeExporter commented 9 years ago
I don't quite understand the issue. If you want to bind parameters to the query 
criteria, you can do so via CUniqueValidator.criteria['params']. I guess the 
problem you met was related with a bug in merging criteria parameters. I think 
we have a fix related to that recently.

Could you please re-test this with the latest code from SVN trunk? Please let 
me know if the issue still exists (perhaps with better description on what the 
issue is.) Thanks.

Original comment by qiang.xue on 16 Jun 2010 at 9:10

GoogleCodeExporter commented 9 years ago
The issue is that I want to bind extra params with values from the model, this 
cannot be done afaik in the rules() method.

Original comment by pieter.debaets on 16 Jun 2010 at 9:22

GoogleCodeExporter commented 9 years ago
I think you should be able to use $this->attributeName in rules() method to 
refer to the param value.

Original comment by qiang.xue on 16 Jun 2010 at 9:30

GoogleCodeExporter commented 9 years ago
Aha, I was operating under the assumption that the rules-method was only run 
once, but if it runs before every validation-call that makes sense. Thanks for 
clarifying this!

Original comment by pieter.debaets on 16 Jun 2010 at 10:11