Eccube\Controller\ShoppingController::customerValidation PHP Method

customerValidation() private method

非会員でのお客様情報変更時の入力チェック
private customerValidation ( Application $app, array $data ) : array
$app Eccube\Application
$data array リクエストパラメータ
return array
    private function customerValidation(Application $app, array $data)
    {
        // 入力チェック
        $errors = array();
        $errors[] = $app['validator']->validateValue($data['customer_name01'], array(new Assert\NotBlank(), new Assert\Length(array('max' => $app['config']['name_len'])), new Assert\Regex(array('pattern' => '/^[^\\s ]+$/u', 'message' => 'form.type.name.firstname.nothasspace'))));
        $errors[] = $app['validator']->validateValue($data['customer_name02'], array(new Assert\NotBlank(), new Assert\Length(array('max' => $app['config']['name_len'])), new Assert\Regex(array('pattern' => '/^[^\\s ]+$/u', 'message' => 'form.type.name.firstname.nothasspace'))));
        $errors[] = $app['validator']->validateValue($data['customer_company_name'], array(new Assert\Length(array('max' => $app['config']['stext_len']))));
        $errors[] = $app['validator']->validateValue($data['customer_tel01'], array(new Assert\NotBlank(), new Assert\Type(array('type' => 'numeric', 'message' => 'form.type.numeric.invalid')), new Assert\Length(array('max' => $app['config']['tel_len'], 'min' => $app['config']['tel_len_min']))));
        $errors[] = $app['validator']->validateValue($data['customer_tel02'], array(new Assert\NotBlank(), new Assert\Type(array('type' => 'numeric', 'message' => 'form.type.numeric.invalid')), new Assert\Length(array('max' => $app['config']['tel_len'], 'min' => $app['config']['tel_len_min']))));
        $errors[] = $app['validator']->validateValue($data['customer_tel03'], array(new Assert\NotBlank(), new Assert\Type(array('type' => 'numeric', 'message' => 'form.type.numeric.invalid')), new Assert\Length(array('max' => $app['config']['tel_len'], 'min' => $app['config']['tel_len_min']))));
        $errors[] = $app['validator']->validateValue($data['customer_zip01'], array(new Assert\NotBlank(), new Assert\Type(array('type' => 'numeric', 'message' => 'form.type.numeric.invalid')), new Assert\Length(array('min' => $app['config']['zip01_len'], 'max' => $app['config']['zip01_len']))));
        $errors[] = $app['validator']->validateValue($data['customer_zip02'], array(new Assert\NotBlank(), new Assert\Type(array('type' => 'numeric', 'message' => 'form.type.numeric.invalid')), new Assert\Length(array('min' => $app['config']['zip02_len'], 'max' => $app['config']['zip02_len']))));
        $errors[] = $app['validator']->validateValue($data['customer_addr01'], array(new Assert\NotBlank(), new Assert\Length(array('max' => $app['config']['address1_len']))));
        $errors[] = $app['validator']->validateValue($data['customer_addr02'], array(new Assert\NotBlank(), new Assert\Length(array('max' => $app['config']['address2_len']))));
        $errors[] = $app['validator']->validateValue($data['customer_email'], array(new Assert\NotBlank(), new Assert\Email(array('strict' => true))));
        return $errors;
    }