handle invalid email address
This commit is contained in:
@ -18,6 +18,13 @@ trait Contacts
|
||||
return in_array($type, $this->getVendorTypes());
|
||||
}
|
||||
|
||||
public function isEmployee()
|
||||
{
|
||||
$type = $this->type ?? $this->contact->type ?? $this->model->type ?? 'employee';
|
||||
|
||||
return in_array($type, $this->getEmployeeTypes());
|
||||
}
|
||||
|
||||
public function getCustomerTypes($return = 'array')
|
||||
{
|
||||
return $this->getContactTypes('customer', $return);
|
||||
@ -28,6 +35,11 @@ trait Contacts
|
||||
return $this->getContactTypes('vendor', $return);
|
||||
}
|
||||
|
||||
public function getEmployeeTypes($return = 'array')
|
||||
{
|
||||
return $this->getContactTypes('employee', $return);
|
||||
}
|
||||
|
||||
public function getContactTypes($index, $return = 'array')
|
||||
{
|
||||
$types = (string) setting('contact.type.' . $index);
|
||||
@ -45,6 +57,11 @@ trait Contacts
|
||||
$this->addContactType($new_type, 'vendor');
|
||||
}
|
||||
|
||||
public function addEmployeeType($new_type)
|
||||
{
|
||||
$this->addContactType($new_type, 'employee');
|
||||
}
|
||||
|
||||
public function addContactType($new_type, $index)
|
||||
{
|
||||
$types = explode(',', setting('contact.type.' . $index));
|
||||
|
Reference in New Issue
Block a user