April 26, 2011

Yii’s default validator Aliases

Below is the complete list of predefined validator aliases: boolean: alias of CBooleanValidator, ensuring the attribute has a value that is either CBooleanValidator::trueValue or CBooleanValidator::falseValue. captcha: alias of CCaptchaValidator, ensuring the attribute is equal to the verification code displayed in […]
April 12, 2011

Specifying nested relations for eager loading

Eager loading can be nested. For example, if for every comment, we also want to know its author, we could use the following ‘with’ find:   // find all posts together with their author and the author's profile Post::model()->with('author','author.profile')->findAll();  
Specifying nested relations for eager loading
This website uses cookies to provide necessary website functionality, improve your experience and analyze our traffic. By using our website, you agree to our Privacy Policy and our cookies usage.