<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writing custom validation rules</title>
	<atom:link href="http://cakebaker.42dh.com/2008/05/04/writing-custom-validation-rules/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/05/04/writing-custom-validation-rules/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Thu, 11 Mar 2010 10:26:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/05/04/writing-custom-validation-rules/comment-page-1/#comment-88635</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 14 May 2008 16:54:25 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=600#comment-88635</guid>
		<description>@John: You could use the &lt;a href=&quot;http://bakery.cakephp.org/articles/view/conditinalvalidation-behavior&quot; rel=&quot;nofollow&quot;&gt;ConditionalValidation behavior&lt;/a&gt; for this purpose. Or you could do the validation manually in the beforeValidate() method of your model. 

Hope that help!</description>
		<content:encoded><![CDATA[<p>@John: You could use the <a href="http://bakery.cakephp.org/articles/view/conditinalvalidation-behavior" rel="nofollow">ConditionalValidation behavior</a> for this purpose. Or you could do the validation manually in the beforeValidate() method of your model. </p>
<p>Hope that help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JohnP</title>
		<link>http://cakebaker.42dh.com/2008/05/04/writing-custom-validation-rules/comment-page-1/#comment-88489</link>
		<dc:creator>JohnP</dc:creator>
		<pubDate>Tue, 13 May 2008 22:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=600#comment-88489</guid>
		<description>How would you write a custom validation that looks at more than one value in the model?  For example if your model has the following:
User
    role
    email

And you wanted to write a validation to ensure (for example) users with the role of &quot;ACADEMIC&quot; had an email address that ended in &quot;.edu&quot;.  As far as I can tell, the custom validations only pass in the field being tested.</description>
		<content:encoded><![CDATA[<p>How would you write a custom validation that looks at more than one value in the model?  For example if your model has the following:<br />
User<br />
    role<br />
    email</p>
<p>And you wanted to write a validation to ensure (for example) users with the role of &#8220;ACADEMIC&#8221; had an email address that ended in &#8220;.edu&#8221;.  As far as I can tell, the custom validations only pass in the field being tested.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
