add missing field to customerCreation field
This commit is contained in:
@@ -48,6 +48,7 @@ class Customer implements EventSubscriberInterface
|
||||
$form->bind($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
|
||||
echo "ok"; exit;
|
||||
} else {
|
||||
|
||||
|
||||
@@ -61,12 +61,24 @@ class CustomerCreation extends BaseForm
|
||||
->add("address3", "text", array(
|
||||
"label" => "Address Line 3"
|
||||
))
|
||||
->add("phone", "text", array(
|
||||
"label" => "phone"
|
||||
))
|
||||
->add("cellphone", "text", array(
|
||||
"label" => "cellphone"
|
||||
))
|
||||
->add("zipcode", "text", array(
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
),
|
||||
"label" => "zipcode"
|
||||
))
|
||||
->add("city", "text", array(
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
),
|
||||
"label" => "city"
|
||||
))
|
||||
->add("country", "text", array(
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
@@ -79,8 +91,8 @@ class CustomerCreation extends BaseForm
|
||||
new Constraints\Email(),
|
||||
new Constraints\Callback(array(
|
||||
"methods" => array(
|
||||
$this,
|
||||
"verifyExistingEmail"
|
||||
array($this,
|
||||
"verifyExistingEmail")
|
||||
)
|
||||
))
|
||||
),
|
||||
@@ -90,8 +102,8 @@ class CustomerCreation extends BaseForm
|
||||
"constraints" => array(
|
||||
new Constraints\Callback(array(
|
||||
"methods" => array(
|
||||
$this,
|
||||
"verifyEmailField"
|
||||
array($this,
|
||||
"verifyEmailField")
|
||||
)
|
||||
))
|
||||
),
|
||||
|
||||
@@ -18,5 +18,30 @@ use Thelia\Model\om\BaseCustomer;
|
||||
*/
|
||||
class Customer extends BaseCustomer
|
||||
{
|
||||
public function create($titleId, $firstname, $lastname, $address1, $address2, $address3, $phone, $cellphone, $zipcode, $countryId, $email, $plainPassword, $reseller = 0, $sponsor = null, $discount = 0 )
|
||||
{
|
||||
$this
|
||||
->setFirstname($firstname)
|
||||
->setLastname($lastname)
|
||||
->setAddress1($address1)
|
||||
->setAddress2($address2)
|
||||
->setAddress3($address3)
|
||||
->setPhone($phone)
|
||||
->setCellphone($cellphone)
|
||||
->setZipcode($zipcode)
|
||||
->setCountryId($countryId)
|
||||
->setEmail($email)
|
||||
->setPassword($plainPassword)
|
||||
->setReseller($reseller)
|
||||
->setSponsor($sponsor)
|
||||
->setDiscount($discount)
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->setAlgo("PASSWORD_BCRYPT");
|
||||
return parent::setPassword(password_hash($password, PASSWORD_BCRYPT));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user