Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertPhoneNumber not work #176

Open
Mapteg34 opened this issue Apr 5, 2018 · 1 comment
Open

AssertPhoneNumber not work #176

Mapteg34 opened this issue Apr 5, 2018 · 1 comment

Comments

@Mapteg34
Copy link

Mapteg34 commented Apr 5, 2018

i use

use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;

    /**
     * @var string
     *
     * @ORM\Column(name="phone", type="text", nullable=false)
     * @AssertPhoneNumber(type="mobile")
     */
    private $phone = '';

but they don't work:`

$user = new User();
$user->setPhone("qwerty");
$userManager->saveUser($user, "qwe");

create user with bad phone...
what i need to validate phone in entity?

@osavchenko
Copy link

Use validator component. It's not triggering automatically on persist or other events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants