Location: PHPKode > projects > litfass > litfass/doc/propel-irq-question.txt
<tom_> hiho. got a question about validation. it does not behave as expected...
<tom_> this is my ruleset for a table (user):
<tom_>     <validator column="login" translate="none">
<tom_>       <rule
<tom_>         name="unique"
<tom_>         message="this login is already in database." />
<tom_>       <rule
<tom_>         name="required"
<tom_>         message="a login name is required." />
<tom_>     </validator>
<tom_>     <validator column="real_name" translate="none">
<tom_>       <rule
<tom_>         name="required"
<tom_>         message="a real name is required." />
<tom_>     </validator>
<tom_>     <validator column="password" translate="none">
<tom_>       <rule
<tom_>         name="required"
<tom_>         message="a password is required." />
<tom_>     </validator>
<tom_> and here i get confused:
<tom_> $user = new User();
<tom_> $user->setLogin("sepp");
<tom_> $res = $user->validate();
<tom_> if ($res == true) echo "thats not what i expected";
<tom_> $user->save();
<tom_> $user = new User();
<tom_> $user->setLogin("sepp");
<tom_> $res = $user->validate();
<tom_> if ($res == true) echo "thats not what i expected";
<tom_> validate seems to return true in both cases, expected it to return an
          array of ValidationFailed objects
<tom_> anyone out there to tell me something about validate() function of propel?
<tom_> or someone who knows a hint where to ask or look for?
<horros> well, the sources would be a good place I suppose :I
<tom_> ok. think i found the problem. looks like validate() works fine.
<tom_> just didnt realize that $res == true even if $res is an array of
          ValidationFailed. my error...
<horros> ah
<horros> right :)
* horros/#propel makes mental note to remember that
<tom_> :)
<tom_> ok. i got, what i needed. cu

Return current item: litfass