I wrote a custom hook. If the same phone in the database, it gives an error. I am using the beforeSave function. If I do not change the phone, it still fails. Idont want this. If the phone area changes, it needs to be checked. Could you help me?
Same phone control
Collapse
X
-
Tags: None
-
Okay tanya It's work I have one more simple question. I want to check the phone and its entity. How does this relationship work?
I try this, but it didn't work.
Code:$checkDublicated = $this->getEntityManager()->getRepository('PhoneNumber')->entityPhoneNumber($entityType)->where([ 'name' => $phone ])->findOne();
Comment
Comment