app/Plugin/TabaCustomFields2/Entity/CustomFields.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the TabaCustomFields2 plugin
  4.  *
  5.  * Copyright (C) SPREAD WORKS Inc. All Rights Reserved.
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Plugin\TabaCustomFields2\Entity;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Plugin\TabaCustomFields2\Common\Constants;
  13. /**
  14.  * CustomFields
  15.  *
  16.  * @ORM\Table(name="plg_taba_custom_fields")
  17.  * @ORM\Entity(repositoryClass="Plugin\TabaCustomFields2\Repository\CustomFieldsRepository")
  18.  */
  19. class CustomFields extends \Eccube\Entity\AbstractEntity
  20. {
  21.     /**
  22.      * @var 初期値
  23.      */
  24.     const SHOP_DISPLAYED_DEFAULT true;
  25.     const VALIDATION_NOT_BLANK_DEFAULT false;
  26.     const VALIDATION_IS_NUMBER_DEFAULT false;
  27.     const VALIDATION_UNIQUE_DEFAULT false;
  28.     /**
  29.      * @ORM\Id()
  30.      * @ORM\Column(name="target_entity", type="string", length=64, nullable=false, options={"fixed": false})
  31.      * @ORM\GeneratedValue(strategy="NONE")
  32.      *
  33.      * @var string
  34.      */
  35.     private $targetEntity;
  36.     /**
  37.      * @ORM\Id()
  38.      * @ORM\Column(name="column_id", type="integer", nullable=false, options={"unsigned": true})
  39.      * @ORM\GeneratedValue(strategy="NONE")
  40.      *
  41.      * @var int
  42.      */
  43.     private $columnId;
  44.     /**
  45.      * @ORM\Column(name="field_type", type="string", length=255, nullable=false, options={"fixed": false})
  46.      *
  47.      * @var string
  48.      */
  49.     private $fieldType;
  50.     /**
  51.      * @ORM\Column(name="label", type="string", length=255, nullable=true, options={"fixed": false})
  52.      *
  53.      * @var string
  54.      */
  55.     private $label;
  56.     /**
  57.      * @ORM\Column(name="data_key", type="string", length=255, nullable=false, options={"fixed": false})
  58.      *
  59.      * @var string
  60.      */
  61.     private $dataKey;
  62.     /**
  63.      * @ORM\Column(name="read_allowed", type="integer", nullable=true, options={"unsigned": false})
  64.      *
  65.      * @var int
  66.      */
  67.     private $readAllowed;
  68.     /**
  69.      * @ORM\Column(name="write_allowed", type="integer", nullable=true, options={"unsigned": false})
  70.      *
  71.      * @var int
  72.      */
  73.     private $writeAllowed;
  74.     /**
  75.      * @ORM\Column(name="sort_no", type="integer", nullable=true, options={"unsigned": false})
  76.      *
  77.      * @var int
  78.      */
  79.     private $rank;
  80.     /**
  81.      * @ORM\Column(name="form_properties", type="text", length=65535, nullable=true, options={"fixed": false})
  82.      *
  83.      * @var string
  84.      */
  85.     private $formProperties;
  86.     /**
  87.      * @ORM\Column(name="form_option", type="text", length=65535, nullable=true, options={"fixed": false})
  88.      *
  89.      * @var string
  90.      */
  91.     private $formOption;
  92.     /**
  93.      * @ORM\Column(name="validation_regex", type="string", length=255, nullable=true, options={"fixed": false})
  94.      *
  95.      * @var string
  96.      */
  97.     private $validationRegex;
  98.     /**
  99.      * @ORM\Column(name="validation_not_blank", type="smallint", nullable=true, options={"unsigned": false})
  100.      *
  101.      * @var int
  102.      */
  103.     private $validationNotBlank;
  104.     /**
  105.      * @ORM\Column(name="validation_is_number", type="smallint", nullable=true, options={"unsigned": false})
  106.      *
  107.      * @var int
  108.      */
  109.     private $validationIsNumber;
  110.     /**
  111.      * @ORM\Column(name="validation_max_number", type="integer", nullable=true, options={"unsigned": false})
  112.      *
  113.      * @var int
  114.      */
  115.     private $validationMaxNumber;
  116.     /**
  117.      * @ORM\Column(name="validation_min_number", type="integer", nullable=true, options={"unsigned": false})
  118.      *
  119.      * @var int
  120.      */
  121.     private $validationMinNumber;
  122.     /**
  123.      * @ORM\Column(name="validation_unique", type="smallint", nullable=true, options={"unsigned": false})
  124.      *
  125.      * @var int
  126.      */
  127.     private $validationUnique;
  128.     /**
  129.      * @ORM\Column(name="validation_max_length", type="integer", nullable=true, options={"unsigned": false})
  130.      *
  131.      * @var int
  132.      */
  133.     private $validationMaxLength;
  134.     /**
  135.      * @ORM\Column(name="validation_min_length", type="integer", nullable=true, options={"unsigned": false})
  136.      *
  137.      * @var int
  138.      */
  139.     private $validationMinLength;
  140.     /**
  141.      * @ORM\Column(name="validation_max_checked_number", type="integer", nullable=true, options={"unsigned": false})
  142.      *
  143.      * @var int
  144.      */
  145.     private $validationMaxCheckedNumber;
  146.     /**
  147.      * @ORM\Column(name="validation_min_checked_number", type="integer", nullable=true, options={"unsigned": false})
  148.      *
  149.      * @var int
  150.      */
  151.     private $validationMinCheckedNumber;
  152.     /**
  153.      * @ORM\Column(name="validation_document_file_type", type="array", length=65535, nullable=true, options={"fixed": false})
  154.      *
  155.      * @var string
  156.      */
  157.     private $validationDocumentFileType;
  158.     /**
  159.      * @ORM\Column(name="validation_image_file_type", type="array", length=65535, nullable=true, options={"fixed": false})
  160.      *
  161.      * @var string
  162.      */
  163.     private $validationImageFileType;
  164.     /**
  165.      * @ORM\Column(name="validation_max_file_size", type="integer", nullable=true, options={"unsigned": false})
  166.      *
  167.      * @var int
  168.      */
  169.     private $validationMaxFileSize;
  170.     /**
  171.      * @ORM\Column(name="validation_max_pixel_dimension_width", type="integer", nullable=true, options={"unsigned": false})
  172.      *
  173.      * @var int
  174.      */
  175.     private $validationMaxPixelDimensionWidth;
  176.     /**
  177.      * @ORM\Column(name="validation_min_pixel_dimension_width", type="integer", nullable=true, options={"unsigned": false})
  178.      *
  179.      * @var int
  180.      */
  181.     private $validationMinPixelDimensionWidth;
  182.     /**
  183.      * @ORM\Column(name="validation_max_pixel_dimension_height", type="integer", nullable=true, options={"unsigned": false})
  184.      *
  185.      * @var int
  186.      */
  187.     private $validationMaxPixelDimensionHeight;
  188.     /**
  189.      * @ORM\Column(name="validation_min_pixel_dimension_height", type="integer", nullable=true, options={"unsigned": false})
  190.      *
  191.      * @var int
  192.      */
  193.     private $validationMinPixelDimensionHeight;
  194.     /**
  195.      * @ORM\Column(name="create_date", type="datetime", nullable=false)
  196.      *
  197.      * @var \DateTime
  198.      */
  199.     private $createDate;
  200.     /**
  201.      * @ORM\Column(name="update_date", type="datetime", nullable=false)
  202.      *
  203.      * @var \DateTime
  204.      */
  205.     private $updateDate;
  206.     /**
  207.      * コンストラクタ
  208.      *
  209.      *
  210.      */
  211.     public function __construct()
  212.     {
  213.         $this->shopDisplayed self::SHOP_DISPLAYED_DEFAULT;
  214.         $this->validationNotBlank self::VALIDATION_NOT_BLANK_DEFAULT;
  215.         $this->validationIsNumber self::VALIDATION_IS_NUMBER_DEFAULT;
  216.         $this->validationUnique self::VALIDATION_UNIQUE_DEFAULT;
  217.         $this->validationDocumentFileType Constants::$CUSTOM_FIELDS_FORM_OPTIONS['validation_document_file_type']['choices'];
  218.         $this->validationImageFileType Constants::$CUSTOM_FIELDS_FORM_OPTIONS['validation_image_file_type']['choices'];
  219.     }
  220.     /**
  221.      * Set targetEntity
  222.      *
  223.      * @param string $targetEntity
  224.      * @return CustomFields
  225.      */
  226.     public function setTargetEntity(string $targetEntity): self
  227.     {
  228.         $this->targetEntity $targetEntity;
  229.         return $this;
  230.     }
  231.     /**
  232.      * Get targetEntity
  233.      *
  234.      * @return string
  235.      */
  236.     public function getTargetEntity(): string
  237.     {
  238.         return $this->targetEntity;
  239.     }
  240.     /**
  241.      * Set columnId
  242.      *
  243.      * @param int $columnId
  244.      * @return CustomFields
  245.      */
  246.     public function setColumnId(int $columnId): self
  247.     {
  248.         $this->columnId $columnId;
  249.         return $this;
  250.     }
  251.     /**
  252.      * Get columnId
  253.      *
  254.      * @return int
  255.      */
  256.     public function getColumnId(): ?int
  257.     {
  258.         return $this->columnId;
  259.     }
  260.     /**
  261.      * Set fieldType
  262.      *
  263.      * @param string $fieldType
  264.      * @return CustomFields
  265.      */
  266.     public function setFieldType(string $fieldType): self
  267.     {
  268.         $this->fieldType $fieldType;
  269.         return $this;
  270.     }
  271.     /**
  272.      * Get fieldType
  273.      *
  274.      * @return string
  275.      */
  276.     public function getFieldType(): string
  277.     {
  278.         return $this->fieldType ?? '';
  279.     }
  280.     /**
  281.      * Set label
  282.      *
  283.      * @param string $label
  284.      * @return CustomFields
  285.      */
  286.     public function setLabel(?string $label): self
  287.     {
  288.         $this->label $label;
  289.         return $this;
  290.     }
  291.     /**
  292.      * Get label
  293.      *
  294.      * @return string
  295.      */
  296.     public function getLabel(): ?string
  297.     {
  298.         return $this->label;
  299.     }
  300.     /**
  301.      * Set dataKey
  302.      *
  303.      * @param string $dataKey
  304.      * @return CustomFields
  305.      */
  306.     public function setDataKey(string $dataKey): self
  307.     {
  308.         $this->dataKey $dataKey;
  309.         return $this;
  310.     }
  311.     /**
  312.      * Get dataKey
  313.      *
  314.      * @return string
  315.      */
  316.     public function getDataKey(): string
  317.     {
  318.         return $this->dataKey;
  319.     }
  320.     /**
  321.      * Set readAllowed
  322.      *
  323.      * @param int $readAllowed
  324.      * @return CustomFields
  325.      */
  326.     public function setReadAllowed(?int $readAllowed): self
  327.     {
  328.         $this->readAllowed $readAllowed;
  329.         return $this;
  330.     }
  331.     /**
  332.      * Get readAllowed
  333.      *
  334.      * @return int
  335.      */
  336.     public function getReadAllowed(): ?int
  337.     {
  338.         return $this->readAllowed;
  339.     }
  340.     /**
  341.      * Set writeAllowed
  342.      *
  343.      * @param int $writeAllowed
  344.      * @return CustomFields
  345.      */
  346.     public function setWriteAllowed(int $writeAllowed): self
  347.     {
  348.         $this->writeAllowed $writeAllowed;
  349.         return $this;
  350.     }
  351.     /**
  352.      * Get writeAllowed
  353.      *
  354.      * @return int
  355.      */
  356.     public function getWriteAllowed(): int
  357.     {
  358.         return $this->writeAllowed;
  359.     }
  360.     /**
  361.      * Set rank
  362.      *
  363.      * @param int $rank
  364.      * @return CustomFields
  365.      */
  366.     public function setRank(?int $rank): self
  367.     {
  368.         $this->rank $rank;
  369.         return $this;
  370.     }
  371.     /**
  372.      * Get rank
  373.      *
  374.      * @return int
  375.      */
  376.     public function getRank(): int
  377.     {
  378.         return $this->rank;
  379.     }
  380.     /**
  381.      * Set formProperties
  382.      *
  383.      * @param string $formProperties
  384.      * @return CustomFields
  385.      */
  386.     public function setFormProperties(?string $formProperties): self
  387.     {
  388.         $this->formProperties $formProperties;
  389.         return $this;
  390.     }
  391.     /**
  392.      * Get formProperties
  393.      *
  394.      * @return string
  395.      */
  396.     public function getFormProperties(): ?string
  397.     {
  398.         return $this->formProperties;
  399.     }
  400.     /**
  401.      * Set formOption
  402.      *
  403.      * @param string $formOption
  404.      * @return CustomFields
  405.      */
  406.     public function setFormOption(?string $formOption): self
  407.     {
  408.         $this->formOption $formOption;
  409.         return $this;
  410.     }
  411.     /**
  412.      * Get formOption
  413.      *
  414.      * @return string
  415.      */
  416.     public function getFormOption(): ?string
  417.     {
  418.         return $this->formOption;
  419.     }
  420.     /**
  421.      * Set validationRegex
  422.      *
  423.      * @param string $validationRegex
  424.      * @return CustomFields
  425.      */
  426.     public function setValidationRegex(?string $validationRegex): self
  427.     {
  428.         $this->validationRegex $validationRegex;
  429.         return $this;
  430.     }
  431.     /**
  432.      * Get validationRegex
  433.      *
  434.      * @return string
  435.      */
  436.     public function getValidationRegex(): ?string
  437.     {
  438.         return $this->validationRegex;
  439.     }
  440.     /**
  441.      * Set validationNotBlank
  442.      *
  443.      * @param int $validationNotBlank
  444.      * @return CustomFields
  445.      */
  446.     public function setValidationNotBlank(?int $validationNotBlank): self
  447.     {
  448.         $this->validationNotBlank $validationNotBlank;
  449.         return $this;
  450.     }
  451.     /**
  452.      * Get validationNotBlank
  453.      *
  454.      * @return int
  455.      */
  456.     public function getValidationNotBlank(): ?int
  457.     {
  458.         return $this->validationNotBlank;
  459.     }
  460.     /**
  461.      * Set validationIsNumber
  462.      *
  463.      * @param int $validationIsNumber
  464.      * @return CustomFields
  465.      */
  466.     public function setValidationIsNumber(?int $validationIsNumber): self
  467.     {
  468.         $this->validationIsNumber $validationIsNumber;
  469.         return $this;
  470.     }
  471.     /**
  472.      * Get validationIsNumber
  473.      *
  474.      * @return int
  475.      */
  476.     public function getValidationIsNumber(): ?int
  477.     {
  478.         return $this->validationIsNumber;
  479.     }
  480.     /**
  481.      * Set validationMaxNumber
  482.      *
  483.      * @param int $validationMaxNumber
  484.      * @return CustomFields
  485.      */
  486.     public function setValidationMaxNumber(?int $validationMaxNumber): self
  487.     {
  488.         $this->validationMaxNumber $validationMaxNumber;
  489.         return $this;
  490.     }
  491.     /**
  492.      * Get validationMaxNumber
  493.      *
  494.      * @return int
  495.      */
  496.     public function getValidationMaxNumber(): ?int
  497.     {
  498.         return $this->validationMaxNumber;
  499.     }
  500.     /**
  501.      * Set validationMinNumber
  502.      *
  503.      * @param int $validationMinNumber
  504.      * @return CustomFields
  505.      */
  506.     public function setValidationMinNumber(?int $validationMinNumber): self
  507.     {
  508.         $this->validationMinNumber $validationMinNumber;
  509.         return $this;
  510.     }
  511.     /**
  512.      * Get validationMinNumber
  513.      *
  514.      * @return int
  515.      */
  516.     public function getValidationMinNumber(): ?int
  517.     {
  518.         return $this->validationMinNumber;
  519.     }
  520.     /**
  521.      * Set validationUnique
  522.      *
  523.      * @param int $validationUnique
  524.      * @return CustomFields
  525.      */
  526.     public function setValidationUnique(?int $validationUnique): self
  527.     {
  528.         $this->validationUnique $validationUnique;
  529.         return $this;
  530.     }
  531.     /**
  532.      * Get validationUnique
  533.      *
  534.      * @return int
  535.      */
  536.     public function getValidationUnique(): ?int
  537.     {
  538.         return $this->validationUnique;
  539.     }
  540.     /**
  541.      * Set validationMaxLength
  542.      *
  543.      * @param int $validationMaxLength
  544.      * @return CustomFields
  545.      */
  546.     public function setValidationMaxLength(?int $validationMaxLength): self
  547.     {
  548.         $this->validationMaxLength $validationMaxLength;
  549.         return $this;
  550.     }
  551.     /**
  552.      * Get validationMaxLength
  553.      *
  554.      * @return int
  555.      */
  556.     public function getValidationMaxLength(): ?int
  557.     {
  558.         return $this->validationMaxLength;
  559.     }
  560.     /**
  561.      * Set validationMinLength
  562.      *
  563.      * @param int $validationMinLength
  564.      * @return CustomFields
  565.      */
  566.     public function setValidationMinLength(?int $validationMinLength): self
  567.     {
  568.         $this->validationMinLength $validationMinLength;
  569.         return $this;
  570.     }
  571.     /**
  572.      * Get validationMinLength
  573.      *
  574.      * @return int
  575.      */
  576.     public function getValidationMinLength(): ?int
  577.     {
  578.         return $this->validationMinLength;
  579.     }
  580.     /**
  581.      * Set validationMaxCheckedNumber
  582.      *
  583.      * @param int $validationMaxCheckedNumber
  584.      * @return CustomFields
  585.      */
  586.     public function setValidationMaxCheckedNumber(?int $validationMaxCheckedNumber): self
  587.     {
  588.         $this->validationMaxCheckedNumber $validationMaxCheckedNumber;
  589.         return $this;
  590.     }
  591.     /**
  592.      * Get validationMaxCheckedNumber
  593.      *
  594.      * @return int
  595.      */
  596.     public function getValidationMaxCheckedNumber(): ?int
  597.     {
  598.         return $this->validationMaxCheckedNumber;
  599.     }
  600.     /**
  601.      * Set validationMinCheckedNumber
  602.      *
  603.      * @param int $validationMinCheckedNumber
  604.      * @return CustomFields
  605.      */
  606.     public function setValidationMinCheckedNumber(?int $validationMinCheckedNumber): self
  607.     {
  608.         $this->validationMinCheckedNumber $validationMinCheckedNumber;
  609.         return $this;
  610.     }
  611.     /**
  612.      * Get validationMinCheckedNumber
  613.      *
  614.      * @return int
  615.      */
  616.     public function getValidationMinCheckedNumber(): ?int
  617.     {
  618.         return $this->validationMinCheckedNumber;
  619.     }
  620.     /**
  621.      * Set validationDocumentFileType
  622.      *
  623.      * @param array $validationDocumentFileType
  624.      * @return CustomFields
  625.      */
  626.     public function setValidationDocumentFileType(?array $validationDocumentFileType): self
  627.     {
  628.         $this->validationDocumentFileType $validationDocumentFileType;
  629.         return $this;
  630.     }
  631.     /**
  632.      * Get validationDocumentFileType
  633.      *
  634.      * @return array
  635.      */
  636.     public function getValidationDocumentFileType(): ?array
  637.     {
  638.         return $this->validationDocumentFileType;
  639.     }
  640.     /**
  641.      * Set validationImageFileType
  642.      *
  643.      * @param array $validationImageFileType
  644.      * @return CustomFields
  645.      */
  646.     public function setValidationImageFileType(?array $validationImageFileType): self
  647.     {
  648.         $this->validationImageFileType $validationImageFileType;
  649.         return $this;
  650.     }
  651.     /**
  652.      * Get validationImageFileType
  653.      *
  654.      * @return string
  655.      */
  656.     public function getValidationImageFileType(): ?array
  657.     {
  658.         return $this->validationImageFileType;
  659.     }
  660.     /**
  661.      * Set validationMaxFileSize
  662.      *
  663.      * @param int $validationMaxFileSize
  664.      * @return CustomFields
  665.      */
  666.     public function setValidationMaxFileSize(?int $validationMaxFileSize): self
  667.     {
  668.         $this->validationMaxFileSize $validationMaxFileSize;
  669.         return $this;
  670.     }
  671.     /**
  672.      * Get validationMaxFileSize
  673.      *
  674.      * @return int
  675.      */
  676.     public function getValidationMaxFileSize(): ?int
  677.     {
  678.         return $this->validationMaxFileSize;
  679.     }
  680.     /**
  681.      * Set validationMaxPixelDimensionWidth
  682.      *
  683.      * @param int $validationMaxPixelDimensionWidth
  684.      * @return CustomFields
  685.      */
  686.     public function setValidationMaxPixelDimensionWidth(?int $validationMaxPixelDimensionWidth): self
  687.     {
  688.         $this->validationMaxPixelDimensionWidth $validationMaxPixelDimensionWidth;
  689.         return $this;
  690.     }
  691.     /**
  692.      * Get validationMaxPixelDimensionWidth
  693.      *
  694.      * @return int
  695.      */
  696.     public function getValidationMaxPixelDimensionWidth(): ?int
  697.     {
  698.         return $this->validationMaxPixelDimensionWidth;
  699.     }
  700.     /**
  701.      * Set validationMinPixelDimensionWidth
  702.      *
  703.      * @param int $validationMinPixelDimensionWidth
  704.      * @return CustomFields
  705.      */
  706.     public function setValidationMinPixelDimensionWidth(?int $validationMinPixelDimensionWidth): self
  707.     {
  708.         $this->validationMinPixelDimensionWidth $validationMinPixelDimensionWidth;
  709.         return $this;
  710.     }
  711.     /**
  712.      * Get validationMinPixelDimensionWidth
  713.      *
  714.      * @return int
  715.      */
  716.     public function getValidationMinPixelDimensionWidth(): ?int
  717.     {
  718.         return $this->validationMinPixelDimensionWidth;
  719.     }
  720.     /**
  721.      * Set validationMaxPixelDimensionHeight
  722.      *
  723.      * @param int $validationMaxPixelDimensionHeight
  724.      * @return CustomFields
  725.      */
  726.     public function setValidationMaxPixelDimensionHeight(?int $validationMaxPixelDimensionHeight): self
  727.     {
  728.         $this->validationMaxPixelDimensionHeight $validationMaxPixelDimensionHeight;
  729.         return $this;
  730.     }
  731.     /**
  732.      * Get validationMaxPixelDimensionHeight
  733.      *
  734.      * @return int
  735.      */
  736.     public function getValidationMaxPixelDimensionHeight(): ?int
  737.     {
  738.         return $this->validationMaxPixelDimensionHeight;
  739.     }
  740.     /**
  741.      * Set validationMinPixelDimensionHeight
  742.      *
  743.      * @param int $validationMinPixelDimensionHeight
  744.      * @return CustomFields
  745.      */
  746.     public function setValidationMinPixelDimensionHeight(?int $validationMinPixelDimensionHeight): self
  747.     {
  748.         $this->validationMinPixelDimensionHeight $validationMinPixelDimensionHeight;
  749.         return $this;
  750.     }
  751.     /**
  752.      * Get validationMinPixelDimensionHeight
  753.      *
  754.      * @return int
  755.      */
  756.     public function getValidationMinPixelDimensionHeight(): ?int
  757.     {
  758.         return $this->validationMinPixelDimensionHeight;
  759.     }
  760.     /**
  761.      * Set createDate
  762.      *
  763.      * @param \DateTime $createDate
  764.      * @return CustomFields
  765.      */
  766.     public function setCreateDate(\DateTime $createDate): self
  767.     {
  768.         $this->createDate $createDate;
  769.         return $this;
  770.     }
  771.     /**
  772.      * Get createDate
  773.      *
  774.      * @return \DateTime
  775.      */
  776.     public function getCreateDate(): \DateTime
  777.     {
  778.         return $this->createDate;
  779.     }
  780.     /**
  781.      * Set updateDate
  782.      *
  783.      * @param \DateTime $updateDate
  784.      * @return CustomFields
  785.      */
  786.     public function setUpdateDate(\DateTime $updateDate): self
  787.     {
  788.         $this->updateDate $updateDate;
  789.         return $this;
  790.     }
  791.     /**
  792.      * Get updateDate
  793.      *
  794.      * @return \DateTime
  795.      */
  796.     public function getUpdateDate(): \DateTime
  797.     {
  798.         return $this->updateDate;
  799.     }
  800. }