<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Customize\Form\Type\Front;
use Eccube\Common\EccubeConfig;
use Eccube\Form\Type\AddressType;
use Eccube\Form\Type\KanaType;
use Eccube\Form\Type\NameType;
use Eccube\Form\Type\PhoneNumberType;
use Eccube\Form\Type\PostalType;
use Eccube\Form\Validator\Email;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; //選択肢
class Contact2Type extends AbstractType
{
/**
* @var EccubeConfig
*/
protected $eccubeConfig;
/**
* ContactType constructor.
*
* @param EccubeConfig $eccubeConfig
*/
public function __construct(EccubeConfig $eccubeConfig)
{
$this->eccubeConfig = $eccubeConfig;
}
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', NameType::class, [
'required' => true,
])
->add('postal_code', PostalType::class, [
'required' => true,
])
->add('address', AddressType::class, [
'required' => true,
])
->add('phone_number', PhoneNumberType::class, [
'required' => true,
])
->add('email', EmailType::class, [
'constraints' => [
new Assert\NotBlank(),
new Email(null, null, $this->eccubeConfig['eccube_rfc_email_check'] ? 'strict' : null),
],
])
->add('contents', TextareaType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => $this->eccubeConfig['eccube_lltext_len'],
])
],
])
// カスタマイズ項目 ここから
// メニュー1
->add('menu_1', ChoiceType::class, [
'required' => true,
'choices' => [
"出品のみ" => "出品のみ",
"預け入れ出品" => "預け入れ出品",
],
])
// cpu
->add('cpu_head', ChoiceType::class, [
'required' => false,
'placeholder' => 'CPUモデル',
'choices' => [
"intel corei3" => "intel corei3",
"intel corei5" => "intel corei5",
"intel corei7" => "intel corei7",
"intel corei9" => "intel corei9",
"AMD Ryzen3" => "AMD Ryzen3",
"AMD Ryzen5" => "AMD Ryzen5",
"AMD Ryzen7" => "AMD Ryzen7",
"AMD Ryzen9" => "AMD Ryzen9",
],
])
// 型番(例:i7 13700Fやryzen5 3600XTなど
->add('cpu_body', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// cpuクーラー
->add('cool', ChoiceType::class, [
'required' => false,
'placeholder' => 'CPUモデル',
'choices' => [
"空冷" => "空冷",
"水冷" => "水冷",
],
])
// ラジエーター長やメーカーなど
->add('cool_body', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// メモリの型番
->add('ram_head', ChoiceType::class, [
'required' => false,
'placeholder' => 'メモリモデル',
'choices' => [
"DDR4" => "DDR4",
"DDR5" => "DDR5",
],
])
// メモリの容量
->add('ram_body', ChoiceType::class, [
'required' => false,
'placeholder' => 'メモリの容量',
'choices' => [
"4GB" => "4GB",
"8GB" => "8GB",
"12GB" => "12GB",
"16GB" => "16GB",
"20GB" => "20GB",
"24GB" => "24GB",
"28GB" => "28GB",
"32GB" => "32GB",
"40GB" => "40GB",
"64GB" => "64GB",
"128GB" => "128GB",
"これ以外は空欄へ記入" => "これ以外は空欄へ記入",
],
])
// GB容量、定格周波数など
->add('ram_other', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// チップセット等わかる範囲
->add('m_b', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// グラフィックボード 型番(text):
->add('gpu', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// グラフィックメモリの容量(select):
->add('g_ram', ChoiceType::class, [
'required' => false,
'placeholder' => 'グラフィクメモリの容量',
'choices' => [
"4GB" => "4GB",
"6GB" => "6GB",
"8GB" => "8GB",
"10GB" => "10GB",
"12GB" => "12GB",
"16GB" => "16GB",
"18GB" => "18GB",
"20GB" => "20GB",
"22GB" => "22GB",
"24GB" => "24GB",
],
])
// ストレージタイプ
->add('storage1_type', ChoiceType::class, [
'required' => false,
'placeholder' => 'ストレージ形式',
'choices' => [
"SSD" => "SSD",
"HDD" => "HDD",
],
])
// ストレージ容量
->add('storage1_vol', ChoiceType::class, [
'required' => false,
'placeholder' => 'ストレージ容量',
'choices' => [
"120GB以下" => "120GB以下",
"200-256GB" => "200-256GB",
"400-512GB" => "400-512GB",
"850GB-1TB" => "850GB-1TB",
"2TB" => "2TB",
"4TB" => "4TB",
"6TB" => "6TB",
],
])
// ストレージタイプ
->add('storage2_type', ChoiceType::class, [
'required' => false,
'placeholder' => 'ストレージ形式',
'choices' => [
"SSD" => "SSD",
"HDD" => "HDD",
],
])
// ストレージ容量
->add('storage2_vol', ChoiceType::class, [
'required' => false,
'placeholder' => 'ストレージ容量',
'choices' => [
"120GB以下" => "120GB以下",
"200-256GB" => "200-256GB",
"400-512GB" => "400-512GB",
"850GB-1TB" => "850GB-1TB",
"2TB" => "2TB",
"4TB" => "4TB",
"6TB" => "6TB",
],
])
// ストレージその他
->add('storage_other', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// 電源容量
->add('psu_vol', ChoiceType::class, [
'required' => false,
'placeholder' => '電源容量',
'choices' => [
"500W以下" => "500W以下",
"550W" => "550W",
"600W" => "600W",
"650W" => "650W",
"700W" => "700W",
"750W" => "750W",
"800W" => "800W",
"850W" => "850W",
"1000-1050W" => "1000-1050W",
"1200W" => "1200W",
"その他" => "その他",
],
])
// 電源認証
->add('psu_auth', ChoiceType::class, [
'required' => false,
'placeholder' => '認証',
'choices' => [
"80+Standard" => "80+Standard",
"Bronze" => "Bronze",
"Silver" => "Silver",
"Gold" => "Gold",
"Platinum" => "Platinum",
"Titan" => "Titan",
"わからない・その他" => "わからない・その他",
],
])
// 電源(その他)
->add('psu_other', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
//PCケース
->add('pc_case', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// OS(タイプ)
->add('os_type', ChoiceType::class, [
'required' => false,
'placeholder' => 'OS',
'choices' => [
"Windows10" => "Windows10",
"Windows11" => "Windows11",
],
])
->add('os_edi', ChoiceType::class, [
'required' => false,
'placeholder' => 'エディション',
'choices' => [
"Home 64bit" => "Home 64bit",
"Pro 64bit" => "Pro 64bit",
],
])
->add('os_other', TextType::class, [
'required' => false,
'constraints' => [
// new Assert\NotBlank(),
new Assert\Length([
'max' => 200,
])
],
])
// ペットの有無(ラジオボタン)
//->add('pet_1', ChoiceType::class, [
// 'required' => true,
// 'choices' => [
// "有り" => "有り",
// "無し" => "無し",
// "職場等で接する" => "職場等で接する",
// ],
// 'expanded' => true,
// 'multiple' => false,
// 'constraints' => [
// new Assert\NotBlank(),
// ],
//])
// ペットの種類
->add('pet_1', ChoiceType::class, [
'required' => true,
'choices' => [
"無し" => "無し",
"有り" => "有り",
"その他(職業柄等)" => "その他(職業柄等)",
],
])
// ペットの種類
->add('pet_2', ChoiceType::class, [
'required' => false,
'placeholder' => '有・その他の場合選択',
'choices' => [
"犬・猫" => "犬・猫",
"鳥類" => "鳥類",
"爬虫類" => "爬虫類",
],
])
// 喫煙環境
->add('smoke', ChoiceType::class, [
'required' => true,
'choices' => [
"なし" => "なし",
"あり" => "あり",
],
])
// 希望販売価格
->add('price', ChoiceType::class, [
'required' => true,
'choices' => [
"おまかせ" => "おまかせ",
"自分で決める" => "自分で決める",
],
])
->add('hope_price', TextType::class, [
'required' => false,
'constraints' => [
new Assert\Length([
'max' => 200,
])
],
])
// 買取同時見積もり(select):しない・する
->add('hope_quote', ChoiceType::class, [
'required' => true,
'choices' => [
"しない" => "しない",
"する" => "する",
],
])
// ペットの有無(ラジオボタン)
->add('consent', ChoiceType::class, [
'required' => true,
'choices' => [
"同意する" => "同意する",
],
'expanded' => true,
'multiple' => false,
'constraints' => [
new Assert\NotBlank(),
],
]);
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'contact2';
}
}