Hello i have a code where i check for a Uniqueness on a field, i do :
$user = new User();
$user->save(array(
'username' => $username,
'password' => $password
));
And in my User model i have :
public function validation()
{
$this->validate(new Uniqueness(
'field' => 'username',
'message' => 'User already exists'
))
return $this->validationHasFailed() != true;
}
But when it goes through validation and fails, the code doesn't go past the save function called a above. I added an echo 'test'; after save codea above and it never shows up