I tried to play around Expression Language in validation, and I found something strange.
Let's consider Dog model
class Dog
{
/**
* @Assert\Expression("this.getName() != 'aa' ", message="Not good!")
*/
private $name = 'aa';
...
}
'aa' != 'aa' => false so validation service reports error - cool, but lets try to do the same with
class Dog
{
/**
* @Assert\Expression("this.getName() != '' ", message="Not good!")
*/
private $name = '';
...
}
This one does not return any error during validation??? Why?