src/Entity/ProductPage.php line 1214

Open in your IDE?
  1. <?php
  2. namespace EADPlataforma\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\Collection;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use EADPlataforma\Validator\Constraints as EADAssert;
  8. use EADPlataforma\Services\FileService;
  9. use EADPlataforma\Util\StringUtil;
  10. use EADPlataforma\Util\DateTimeUtil;
  11. use EADPlataforma\Enum\ProductPageEnum;
  12. use \DateTime;
  13. /**
  14.  * ProductPage
  15.  *
  16.  * @ORM\Table(name="product_page", indexes={
  17.  *      @ORM\Index(name="fk_product_page_product_id", columns={"product_id"}),
  18.  *      @ORM\Index(name="fk_product_page_library_id", columns={"library_id"}),
  19.  *      @ORM\Index(name="fk_product_page_user_delete_id", columns={"user_delete_id"})
  20.  *})
  21.  *
  22.  * @ORM\Entity(repositoryClass="EADPlataforma\Repository\ProductPageRepository")
  23.  */
  24. class ProductPage
  25. {
  26.     /**
  27.      * @var int
  28.      *
  29.      * @ORM\Column(name="id", type="integer", nullable=false)
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue(strategy="IDENTITY")
  32.      */
  33.     private $id;
  34.     /**
  35.      * @Assert\NotBlank(
  36.      *      message = "Deleted not informed"
  37.      * )
  38.      *
  39.      * @Assert\Choice(
  40.      *      choices = { 
  41.      *                      ProductPageEnum::ITEM_NO_DELETED, 
  42.      *                      ProductPageEnum::ITEM_ON_TRASH,
  43.      *                      ProductPageEnum::ITEM_DELETED
  44.      *                },
  45.      *      message = "Delete Option Invalid"
  46.      * )
  47.      *
  48.      * @var int
  49.      *
  50.      * @ORM\Column(name="deleted", type="integer", nullable=false, options={"default"="0"})
  51.      */
  52.     private $deleted ProductPageEnum::ITEM_NO_DELETED;
  53.     /**
  54.      * @Assert\NotBlank(
  55.      *      message = "Status not informed"
  56.      * )
  57.      *
  58.      * @Assert\Choice(
  59.      *      choices = { ProductPageEnum::DRAFT, ProductPageEnum::PUBLISHED },
  60.      *      message = "Status Invalid"
  61.      * )
  62.      *
  63.      * @var int
  64.      *
  65.      * @ORM\Column(name="status", type="integer", nullable=false, options={"default"="0"})
  66.      */
  67.     private $status ProductPageEnum::DRAFT;
  68.     /**
  69.      * @Assert\NotBlank(
  70.      *      message = "Default not informed"
  71.      * )
  72.      *
  73.      * @Assert\Choice(
  74.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  75.      *      message = "Default Invalid"
  76.      * )
  77.      *
  78.      * @var int
  79.      *
  80.      * @ORM\Column(name="`default`", type="integer", nullable=false, options={"default"="0"})
  81.      */
  82.     private $default ProductPageEnum::NO;
  83.     /**
  84.      * @Assert\NotBlank(
  85.      *      message = "Type not informed"
  86.      * )
  87.      *
  88.      * @Assert\Choice(
  89.      *      choices = { 
  90.      *                      ProductPageEnum::TYPE_DEFAULT,
  91.      *                      ProductPageEnum::TYPE_EXTERNAL,
  92.      *                      ProductPageEnum::TYPE_LAND_PAGE
  93.      *                },
  94.      *      message = "Type Invalid"
  95.      * )
  96.      *
  97.      * @var int
  98.      *
  99.      * @ORM\Column(name="type", type="integer", nullable=false)
  100.      */
  101.     private $type;
  102.     /**
  103.      * @Assert\NotBlank(
  104.      *      message = "Name not informed"
  105.      * )
  106.      * 
  107.      * @Assert\Length(
  108.      *      min = 0,
  109.      *      max = 250
  110.      * )
  111.      *
  112.      * @var string
  113.      *
  114.      * @ORM\Column(name="name", type="string", length=255, nullable=false)
  115.      */
  116.     private $name;
  117.     /**
  118.      * @Assert\NotBlank(
  119.      *      message = "Title not informed"
  120.      * )
  121.      * 
  122.      * @Assert\Length(
  123.      *      min = 0,
  124.      *      max = 250
  125.      * )
  126.      *
  127.      * @var string
  128.      *
  129.      * @ORM\Column(name="title", type="string", length=255, nullable=false)
  130.      */
  131.     private $title;
  132.     /**
  133.      * @var string|null
  134.      *
  135.      * @ORM\Column(name="description", type="text", length=0, nullable=true)
  136.      */
  137.     private $description;
  138.     /**
  139.      * @var string|null
  140.      *
  141.      * @ORM\Column(name="about", type="text", length=0, nullable=true)
  142.      */
  143.     private $about;
  144.     /**
  145.      * @var string|null
  146.      * 
  147.      * @Assert\Length(
  148.      *      min = 0,
  149.      *      max = 250
  150.      * )
  151.      *
  152.      * @ORM\Column(name="overview", type="string", length=255, nullable=true)
  153.      */
  154.     private $overview;
  155.     /**
  156.      * @var string|null
  157.      *
  158.      * @ORM\Column(name="target", type="text", nullable=true)
  159.      */
  160.     private $target;
  161.     /**
  162.      * @var string|null
  163.      *
  164.      * @ORM\Column(name="about_certificate", type="text", nullable=true)
  165.      */
  166.     private $aboutCertificate;
  167.     /**
  168.      * @Assert\Length(
  169.      *      min = 0,
  170.      *      max = 250
  171.      * )
  172.      * 
  173.      * @var string|null
  174.      *
  175.      * @ORM\Column(name="video", type="string", length=255, nullable=true)
  176.      */
  177.     private $video;
  178.     /**
  179.      * @Assert\NotBlank(
  180.      *      message = "Autoplay not informed"
  181.      * )
  182.      *
  183.      * @Assert\Choice(
  184.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  185.      *      message = "Autoplay Invalid"
  186.      * )
  187.      *
  188.      * @var int
  189.      *
  190.      * @ORM\Column(name="autoplay", type="integer", nullable=false, options={"default"="0"})
  191.      */
  192.     private $autoplay ProductPageEnum::NO;
  193.     /**
  194.      * @Assert\Length(
  195.      *      min = 0,
  196.      *      max = 250
  197.      * )
  198.      * 
  199.      * @var string|null
  200.      *
  201.      * @ORM\Column(name="photo", type="string", length=255, nullable=true)
  202.      */
  203.     private $photo;
  204.     /**
  205.      * @Assert\Length(
  206.      *      min = 0,
  207.      *      max = 250
  208.      * )
  209.      * 
  210.      * @var string|null
  211.      *
  212.      * @ORM\Column(name="photo_stand", type="string", length=255, nullable=true)
  213.      */
  214.     private $photoStand;
  215.     /**
  216.      * @Assert\Length(
  217.      *      min = 0,
  218.      *      max = 250
  219.      * )
  220.      * 
  221.      * @var string|null
  222.      *
  223.      * @ORM\Column(name="photo_expand", type="string", length=255, nullable=true)
  224.      */
  225.     private $photoExpand;
  226.     /**
  227.      * @Assert\Length(
  228.      *      min = 0,
  229.      *      max = 250
  230.      * )
  231.      * 
  232.      * @var string|null
  233.      *
  234.      * @ORM\Column(name="cover", type="string", length=255, nullable=true)
  235.      */
  236.     private $cover;
  237.     /**
  238.      * @var string|null
  239.      *
  240.      * @ORM\Column(name="page_color_text", type="string", length=20, nullable=true)
  241.      */
  242.     private $pageColorText;
  243.     /**
  244.      * @var string|null
  245.      *
  246.      * @ORM\Column(name="background_color", type="string", length=20, nullable=true)
  247.      */
  248.     private $backgroundColor;
  249.     /**
  250.      * @var int
  251.      *
  252.      * @Assert\NotBlank(
  253.      *      message = "External Page not informed"
  254.      * )
  255.      *
  256.      * @Assert\Choice(
  257.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  258.      *      message = "External Page Invalid"
  259.      * )
  260.      *
  261.      * @var int
  262.      *
  263.      * @ORM\Column(name="external_page", type="integer", nullable=false, options={"default"="0"})
  264.      */
  265.     private $externalPage ProductPageEnum::NO;
  266.     /**
  267.      * @Assert\Length(
  268.      *      min = 0,
  269.      *      max = 250
  270.      * )
  271.      * 
  272.      * @var string|null
  273.      *
  274.      * @ORM\Column(name="external_page_link", type="string", length=255, nullable=true)
  275.      */
  276.     private $externalPageLink;
  277.     /**
  278.      * @var int
  279.      *
  280.      * @Assert\NotBlank(
  281.      *      message = "External Conclusion not informed"
  282.      * )
  283.      *
  284.      * @Assert\Choice(
  285.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  286.      *      message = "External Conclusion Invalid"
  287.      * )
  288.      *
  289.      * @var int
  290.      *
  291.      * @ORM\Column(name="allow_external_conclusion", type="integer", nullable=false, options={"default"="0"})
  292.      */
  293.     private $allowExternalConclusion ProductPageEnum::NO;
  294.     /**
  295.      * @Assert\Length(
  296.      *      min = 0,
  297.      *      max = 250
  298.      * )
  299.      * 
  300.      * @var string|null
  301.      *
  302.      * @ORM\Column(name="external_conclusion_link", type="string", length=255, nullable=true)
  303.      */
  304.     private $externalConclusionLink;
  305.     /**
  306.      * @var int
  307.      *
  308.      * @Assert\NotBlank(
  309.      *      message = "Show Module Coupon not informed"
  310.      * )
  311.      *
  312.      * @Assert\Choice(
  313.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  314.      *      message = "Show Module Coupon Invalid"
  315.      * )
  316.      *
  317.      * @var int
  318.      *
  319.      * @ORM\Column(name="show_module_coupon", type="integer", nullable=false, options={"default"="1"})
  320.      */
  321.     private $showModuleCoupon ProductPageEnum::YES;
  322.     /**
  323.      * @var int
  324.      *
  325.      * @Assert\NotBlank(
  326.      *      message = "Show Module Testimonials not informed"
  327.      * )
  328.      *
  329.      * @Assert\Choice(
  330.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  331.      *      message = "Show Module Testimonials Invalid"
  332.      * )
  333.      *
  334.      * @var int
  335.      *
  336.      * @ORM\Column(name="show_module_testimonials", type="integer", nullable=false, options={"default"="1"})
  337.      */
  338.     private $showModuleTestimonials ProductPageEnum::YES;
  339.     /**
  340.      * @var int
  341.      *
  342.      * @Assert\NotBlank(
  343.      *      message = "Show Module Data Billing not informed"
  344.      * )
  345.      *
  346.      * @Assert\Choice(
  347.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  348.      *      message = "Show Module Data Billing Invalid"
  349.      * )
  350.      *
  351.      * @var int
  352.      *
  353.      * @ORM\Column(name="show_module_data_billing", type="integer", nullable=false, options={"default"="1"})
  354.      */
  355.     private $showModuleDataBilling ProductPageEnum::YES;
  356.     /**
  357.      * @var int
  358.      *
  359.      * @Assert\NotBlank(
  360.      *      message = "Show Module Option Foreign not informed"
  361.      * )
  362.      *
  363.      * @Assert\Choice(
  364.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  365.      *      message = "Show Module Option Foreign Invalid"
  366.      * )
  367.      *
  368.      * @var int
  369.      *
  370.      * @ORM\Column(name="show_module_option_foreign", type="integer", nullable=false, options={"default"="1"})
  371.      */
  372.     private $showModuleOptionForeign ProductPageEnum::YES;
  373.     /**
  374.      * @var int
  375.      *
  376.      * @Assert\NotBlank(
  377.      *      message = "Show Module Header not informed"
  378.      * )
  379.      *
  380.      * @Assert\Choice(
  381.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  382.      *      message = "Show Header Invalid"
  383.      * )
  384.      *
  385.      * @var int
  386.      *
  387.      * @ORM\Column(name="show_module_header", type="integer", nullable=false, options={"default"="1"})
  388.      */
  389.     private $showModuleHeader ProductPageEnum::YES;
  390.     /**
  391.      * @var int
  392.      *
  393.      * @Assert\NotBlank(
  394.      *      message = "Show Module Contracts not informed"
  395.      * )
  396.      *
  397.      * @Assert\Choice(
  398.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  399.      *      message = "Show Contracts Invalid"
  400.      * )
  401.      *
  402.      * @var int
  403.      *
  404.      * @ORM\Column(name="show_module_contracts", type="integer", nullable=false, options={"default"="1"})
  405.      */
  406.     private $showModuleContracts ProductPageEnum::YES;
  407.     /**
  408.      * @var int
  409.      *
  410.      * @Assert\NotBlank(
  411.      *      message = "Show Shortage Control Time not informed"
  412.      * )
  413.      *
  414.      * @Assert\Choice(
  415.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  416.      *      message = "Show Shortage Control Time Invalid"
  417.      * )
  418.      *
  419.      * @var int
  420.      *
  421.      * @ORM\Column(name="show_shortage_control_time", type="integer", nullable=false, options={"default"="0"})
  422.      */
  423.     private $showShortageControlTime ProductPageEnum::NO;
  424.     /**
  425.      * @var int
  426.      *
  427.      * @Assert\NotBlank(
  428.      *      message = "Show Shortage Control Visualization not informed"
  429.      * )
  430.      *
  431.      * @Assert\Choice(
  432.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  433.      *      message = "Show Shortage Control Visualization Invalid"
  434.      * )
  435.      *
  436.      * @var int
  437.      *
  438.      * @ORM\Column(name="show_shortage_control_visualization", type="integer", nullable=false, options={"default"="0"})
  439.      */
  440.     private $showShortageControlVisualization ProductPageEnum::NO;
  441.     /**
  442.      * @var int
  443.      *
  444.      * @Assert\NotBlank(
  445.      *      message = "Show Shortage Control Buyers not informed"
  446.      * )
  447.      *
  448.      * @Assert\Choice(
  449.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  450.      *      message = "Show Shortage Control Buyers Invalid"
  451.      * )
  452.      *
  453.      * @var int
  454.      *
  455.      * @ORM\Column(name="show_shortage_control_buyers", type="integer", nullable=false, options={"default"="0"})
  456.      */
  457.     private $showShortageControlBuyers ProductPageEnum::NO;
  458.     /**
  459.      * @var int
  460.      *
  461.      * @Assert\NotBlank(
  462.      *      message = "Show Shortage Control Vacancies not informed"
  463.      * )
  464.      *
  465.      * @Assert\Choice(
  466.      *      choices = { ProductPageEnum::NO, ProductPageEnum::YES },
  467.      *      message = "Show Shortage Control Vacancies Invalid"
  468.      * )
  469.      *
  470.      * @var int
  471.      *
  472.      * @ORM\Column(name="show_shortage_control_vacancies", type="integer", nullable=false, options={"default"="0"})
  473.      */
  474.     private $showShortageControlVacancies ProductPageEnum::NO;
  475.     /**
  476.      * @var string
  477.      *
  478.      * @ORM\Column(name="shortage_time_number", type="string", length=10, nullable=true)
  479.      */
  480.     private $shortageTimeNumber;
  481.     /**
  482.      * @var int
  483.      *
  484.      * @ORM\Column(name="shortage_visualization_number", type="integer", nullable=true)
  485.      */
  486.     private $shortageVisualizationNumber;
  487.     /**
  488.      * @var int
  489.      *
  490.      * @ORM\Column(name="shortage_buyers_number", type="integer", nullable=true)
  491.      */
  492.     private $shortageBuyersNumber;
  493.     /**
  494.      * @var int
  495.      *
  496.      * @ORM\Column(name="shortage_vacancies_number", type="integer", nullable=true)
  497.      */
  498.     private $shortageVacanciesNumber;
  499.     /**
  500.      * @Assert\Valid
  501.      *
  502.      * @var \Library
  503.      *
  504.      * @ORM\ManyToOne(targetEntity="Library")
  505.      * @ORM\JoinColumns({
  506.      *   @ORM\JoinColumn(name="library_id", referencedColumnName="id", nullable=true)
  507.      * })
  508.      */
  509.     private $library;
  510.     /**
  511.      * @Assert\NotBlank(
  512.      *      message = "Product not informed"
  513.      * )
  514.      *
  515.      * @Assert\Valid
  516.      *
  517.      * @var \Product
  518.      *
  519.      * @ORM\ManyToOne(targetEntity="Product")
  520.      * @ORM\JoinColumns({
  521.      *   @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=false)
  522.      * })
  523.      */
  524.     private $product;
  525.     /**
  526.      * @Assert\Valid
  527.      *
  528.      * @var \EADPlataforma\Entity\User
  529.      *
  530.      * @ORM\ManyToOne(targetEntity="User")
  531.      * @ORM\JoinColumns({
  532.      *   @ORM\JoinColumn(name="user_delete_id", referencedColumnName="id", nullable=true)
  533.      * })
  534.      */
  535.     private $userDelete;
  536.     /**
  537.      * @Assert\Choice(
  538.      *      choices = { 
  539.      *                      ProductPageEnum::INDIVIDUAL, 
  540.      *                      ProductPageEnum::CASCADE
  541.      *                },
  542.      *      message = "Type Delete Invalid"
  543.      * )
  544.      *
  545.      * @var int
  546.      *
  547.      * @ORM\Column(name="type_delete", type="integer", nullable=true)
  548.      */
  549.     private $typeDelete;
  550.     /**
  551.      * @EADAssert\DateTimeEAD(
  552.      *      message = "Date Delete Invalid"
  553.      * )
  554.      *
  555.      * @var \DateTime|null
  556.      *
  557.      * @ORM\Column(name="date_delete", type="datetime", nullable=true)
  558.      */
  559.     private $dateDelete;
  560.     /**
  561.      * Constructor
  562.      */
  563.     public function __construct()
  564.     {
  565.     }
  566.     public function getId(): ?int
  567.     {
  568.         return $this->id;
  569.     }
  570.     public function getStatus(): ?int
  571.     {
  572.         return $this->status;
  573.     }
  574.     public function setStatus(int $status): self
  575.     {
  576.         $this->status $status;
  577.         return $this;
  578.     }
  579.     public function getDefault(): ?int
  580.     {
  581.         return $this->default;
  582.     }
  583.     public function setDefault(int $default): self
  584.     {
  585.         $this->default $default;
  586.         return $this;
  587.     }
  588.     public function getType(): ?int
  589.     {
  590.         return $this->type;
  591.     }
  592.     public function setType(int $type): self
  593.     {
  594.         $this->type $type;
  595.         return $this;
  596.     }
  597.     public function getName(): ?string
  598.     {
  599.         $this->name StringUtil::removeScriptsStatic($this->name);
  600.         return StringUtil::encodeStringStatic($this->name);
  601.     }
  602.     public function setName(string $name): self
  603.     {
  604.         $name StringUtil::removeScriptsStatic($name);
  605.         $this->name $name;
  606.         return $this;
  607.     }
  608.     public function getTitle(): ?string
  609.     {
  610.         $this->title StringUtil::removeScriptsStatic($this->title);
  611.         return StringUtil::encodeStringStatic($this->title);
  612.     }
  613.     public function setTitle(?string $title): self
  614.     {
  615.         $title StringUtil::removeScriptsStatic($title);
  616.         $this->title $title;
  617.         return $this;
  618.     }
  619.     public function getDescription(): ?string
  620.     {
  621.         $this->description StringUtil::removeScriptsStatic($this->description);
  622.         return StringUtil::encodeStringStatic($this->description);
  623.     }
  624.     public function setDescription(?string $description): self
  625.     {
  626.         $description StringUtil::removeScriptsStatic($description);
  627.         $this->description $description;
  628.         return $this;
  629.     }
  630.     public function getAbout(): ?string
  631.     {
  632.         $this->about StringUtil::removeScriptsStatic($this->about);
  633.         return html_entity_decode(StringUtil::encodeStringStatic($this->about));
  634.     }
  635.     public function setAbout(?string $about): self
  636.     {
  637.         $about StringUtil::removeScriptsStatic($about);
  638.         $this->about $about;
  639.         return $this;
  640.     }
  641.     public function getOverview(): ?string
  642.     {
  643.         $this->overview StringUtil::removeScriptsStatic($this->overview);
  644.         return StringUtil::encodeStringStatic($this->overview);
  645.     }
  646.     public function setOverview(?string $overview): self
  647.     {
  648.         $overview StringUtil::removeScriptsStatic($overview);
  649.         $this->overview $overview;
  650.         return $this;
  651.     }
  652.     public function getTarget(): ?string
  653.     {
  654.         $this->target StringUtil::removeScriptsStatic($this->target);
  655.         return html_entity_decode(StringUtil::encodeStringStatic($this->target));
  656.     }
  657.     public function setTarget(?string $target): self
  658.     {
  659.         $target StringUtil::removeScriptsStatic($target);
  660.         $this->target $target;
  661.         return $this;
  662.     }
  663.     public function getAboutCertificate(): ?string
  664.     {
  665.         $this->aboutCertificate StringUtil::removeScriptsStatic($this->aboutCertificate);
  666.         return html_entity_decode(StringUtil::encodeStringStatic($this->aboutCertificate));
  667.     }
  668.     public function setAboutCertificate(?string $aboutCertificate): self
  669.     {
  670.         $aboutCertificate StringUtil::removeScriptsStatic($aboutCertificate);
  671.         $this->aboutCertificate $aboutCertificate;
  672.         return $this;
  673.     }
  674.     public function getVideo(): ?string
  675.     {
  676.         $this->video StringUtil::removeScriptsStatic($this->video);
  677.         if(!empty($this->video)){
  678.             $url str_replace('http:'''$this->video);
  679.             $url str_replace('https:'''$url);
  680.             return "https:{$url}";
  681.         }
  682.         return $this->video;
  683.     }
  684.     public function setVideo(?string $video): self
  685.     {
  686.         $video StringUtil::removeScriptsStatic($video);
  687.         $this->video $video;
  688.         return $this;
  689.     }
  690.     public function getAutoplay(): ?int
  691.     {
  692.         return (int)$this->autoplay;
  693.     }
  694.     public function setAutoplay(?int $autoplay): self
  695.     {
  696.         $this->autoplay = (int)$autoplay;
  697.         return $this;
  698.     }
  699.     public function getPhoto(): ?string
  700.     {
  701.         return $this->photo;
  702.     }
  703.     public function setPhoto(?string $photo): self
  704.     {
  705.         $this->photo $photo;
  706.         return $this;
  707.     }
  708.     public function getPhotoStand(): ?string
  709.     {
  710.         return $this->photoStand;
  711.     }
  712.     public function setPhotoStand(?string $photoStand): self
  713.     {
  714.         $this->photoStand $photoStand;
  715.         return $this;
  716.     }
  717.     public function getPhotoExpand(): ?string
  718.     {
  719.         return $this->photoExpand;
  720.     }
  721.     public function setPhotoExpand(?string $photoExpand): self
  722.     {
  723.         $this->photoExpand $photoExpand;
  724.         return $this;
  725.     }
  726.     public function getCover(): ?string
  727.     {
  728.         return $this->cover;
  729.     }
  730.     public function setCover(?string $cover): self
  731.     {
  732.         $this->cover $cover;
  733.         return $this;
  734.     }
  735.     public function getPageColorText(): ?string
  736.     {
  737.         return $this->pageColorText;
  738.     }
  739.     public function setPageColorText(?string $pageColorText): self
  740.     {
  741.         $this->pageColorText $pageColorText;
  742.         return $this;
  743.     }
  744.     public function getBackgroundColor(): ?string
  745.     {
  746.         return $this->backgroundColor;
  747.     }
  748.     public function setBackgroundColor(?string $backgroundColor): self
  749.     {
  750.         $this->backgroundColor $backgroundColor;
  751.         return $this;
  752.     }
  753.     public function getExternalPage(): ?int
  754.     {
  755.         return $this->externalPage;
  756.     }
  757.     public function setExternalPage(?int $externalPage): self
  758.     {
  759.         $this->externalPage $externalPage;
  760.         return $this;
  761.     }
  762.     public function getExternalPageLink(): ?string
  763.     {
  764.         return $this->externalPageLink;
  765.     }
  766.     public function setExternalPageLink(?string $externalPageLink): self
  767.     {
  768.         $this->externalPageLink $externalPageLink;
  769.         return $this;
  770.     }
  771.     public function getAllowExternalConclusion(): ?int
  772.     {
  773.         return $this->allowExternalConclusion;
  774.     }
  775.     public function setAllowExternalConclusion(?int $allowExternalConclusion): self
  776.     {
  777.         $this->allowExternalConclusion $allowExternalConclusion;
  778.         return $this;
  779.     }
  780.     
  781.     public function getExternalConclusionLink(): ?string
  782.     {
  783.         return $this->externalConclusionLink;
  784.     }
  785.     public function setExternalConclusionLink(?string $externalConclusionLink): self
  786.     {
  787.         $this->externalConclusionLink $externalConclusionLink;
  788.         return $this;
  789.     }
  790.     public function getShowModuleCoupon(): ?int
  791.     {
  792.         return $this->showModuleCoupon;
  793.     }
  794.     public function setShowModuleCoupon(?int $showModuleCoupon): self
  795.     {
  796.         $this->showModuleCoupon $showModuleCoupon;
  797.         return $this;
  798.     }
  799.     public function getShowModuleTestimonials(): ?int
  800.     {
  801.         return $this->showModuleTestimonials;
  802.     }
  803.     public function setShowModuleTestimonials(?int $showModuleTestimonials): self
  804.     {
  805.         $this->showModuleTestimonials $showModuleTestimonials;
  806.         return $this;
  807.     }
  808.     public function getShowModuleDataBilling(): ?int
  809.     {
  810.         return $this->showModuleDataBilling;
  811.     }
  812.     public function setShowModuleDataBilling(?int $showModuleDataBilling): self
  813.     {
  814.         $this->showModuleDataBilling $showModuleDataBilling;
  815.         return $this;
  816.     }
  817.     public function getShowModuleOptionForeign(): ?int
  818.     {
  819.         return $this->showModuleOptionForeign;
  820.     }
  821.     public function setShowModuleOptionForeign(?int $showModuleOptionForeign): self
  822.     {
  823.         $this->showModuleOptionForeign $showModuleOptionForeign;
  824.         return $this;
  825.     }
  826.     public function getShowModuleHeader(): ?int
  827.     {
  828.         return $this->showModuleHeader;
  829.     }
  830.     public function setShowModuleHeader(?int $showModuleHeader): self
  831.     {
  832.         $this->showModuleHeader $showModuleHeader;
  833.         return $this;
  834.     }
  835.     public function getShowModuleContracts(): ?int
  836.     {
  837.         return $this->showModuleContracts;
  838.     }
  839.     public function setShowModuleContracts(?int $showModuleContracts): self
  840.     {
  841.         $this->showModuleContracts $showModuleContracts;
  842.         return $this;
  843.     }
  844.     public function getShowShortageControlTime(): ?int
  845.     {
  846.         return $this->showShortageControlTime;
  847.     }
  848.     public function setShowShortageControlTime(?int $showShortageControlTime): self
  849.     {
  850.         $this->showShortageControlTime $showShortageControlTime;
  851.         return $this;
  852.     }
  853.     public function getShowShortageControlVisualization(): ?int
  854.     {
  855.         return $this->showShortageControlVisualization;
  856.     }
  857.     public function setShowShortageControlVisualization(?int $showShortageControlVisualization): self
  858.     {
  859.         $this->showShortageControlVisualization $showShortageControlVisualization;
  860.         return $this;
  861.     }
  862.     public function getShowShortageControlBuyers(): ?int
  863.     {
  864.         return $this->showShortageControlBuyers;
  865.     }
  866.     public function setShowShortageControlBuyers(?int $showShortageControlBuyers): self
  867.     {
  868.         $this->showShortageControlBuyers $showShortageControlBuyers;
  869.         return $this;
  870.     }
  871.     public function getShowShortageControlVacancies(): ?int
  872.     {
  873.         return $this->showShortageControlVacancies;
  874.     }
  875.     public function setShowShortageControlVacancies(?int $showShortageControlVacancies): self
  876.     {
  877.         $this->showShortageControlVacancies $showShortageControlVacancies;
  878.         return $this;
  879.     }
  880.     
  881.     public function getShortageTimeNumber(?bool $seconds false): ?string
  882.     {
  883.         if($seconds && !empty($this->shortageTimeNumber)){
  884.             return DateTimeUtil::timeToSecStatic($this->shortageTimeNumber);
  885.         }
  886.         return $this->shortageTimeNumber;
  887.     }
  888.     public function setShortageTimeNumber(?string $shortageTimeNumber): self
  889.     {
  890.         $this->shortageTimeNumber $shortageTimeNumber;
  891.         return $this;
  892.     }
  893.     public function getShortageVisualizationNumber(): ?int
  894.     {
  895.         return $this->shortageVisualizationNumber;
  896.     }
  897.     public function setShortageVisualizationNumber(?int $shortageVisualizationNumber): self
  898.     {
  899.         $this->shortageVisualizationNumber $shortageVisualizationNumber;
  900.         return $this;
  901.     }
  902.     
  903.     public function getShortageBuyersNumber(): ?int
  904.     {
  905.         return $this->shortageBuyersNumber;
  906.     }
  907.     public function setShortageBuyersNumber(?int $shortageBuyersNumber): self
  908.     {
  909.         $this->shortageBuyersNumber $shortageBuyersNumber;
  910.         return $this;
  911.     }
  912.     public function getShortageVacanciesNumber(): ?int
  913.     {
  914.         return $this->shortageVacanciesNumber;
  915.     }
  916.     public function setShortageVacanciesNumber(?int $shortageVacanciesNumber): self
  917.     {
  918.         $this->shortageVacanciesNumber $shortageVacanciesNumber;
  919.         return $this;
  920.     }
  921.     public function getLibrary(): ?Library
  922.     {
  923.         return $this->library;
  924.     }
  925.     public function setLibrary(?Library $library): self
  926.     {
  927.         $this->library $library;
  928.         return $this;
  929.     }
  930.     public function getProduct(): ?Product
  931.     {
  932.         return $this->product;
  933.     }
  934.     public function setProduct(?Product $product): self
  935.     {
  936.         $this->product $product;
  937.         return $this;
  938.     }
  939.     public function getUserDelete(): ?User
  940.     {
  941.         return $this->userDelete;
  942.     }
  943.     public function setUserDelete(?User $userDelete): self
  944.     {
  945.         $this->userDelete $userDelete;
  946.         return $this;
  947.     }
  948.     public function getDateDelete($dateFormat 'Y-m-d H:i:s')
  949.     {
  950.         if($this->dateDelete){
  951.             return $this->dateDelete->format($dateFormat);
  952.         }
  953.         return $this->dateDelete;
  954.     }
  955.     public function setDateDelete($dateDelete): self
  956.     {
  957.         if(!empty($dateDelete)){
  958.             $dateDelete DateTime::createFromFormat('Y-m-d H:i:s'$dateDelete);
  959.         }
  960.         
  961.         $this->dateDelete $dateDelete;
  962.         return $this;
  963.     }
  964.     public function isDisable(): bool
  965.     {
  966.         if($this->deleted != ProductPageEnum::ITEM_NO_DELETED){
  967.             return true;
  968.         }
  969.         if($this->status == ProductPageEnum::DRAFT){
  970.             return true;
  971.         }
  972.         return false;
  973.     }
  974.     public function isLive(): bool
  975.     {
  976.         return ($this->deleted == ProductPageEnum::ITEM_NO_DELETED);
  977.     }
  978.     public function individual(): self
  979.     {
  980.         $this->typeDelete ProductPageEnum::INDIVIDUAL;
  981.         return $this;
  982.     }
  983.     public function cascade(): self
  984.     {
  985.         $this->typeDelete ProductPageEnum::CASCADE;
  986.         return $this;
  987.     }
  988.     public function isOnTrash(): bool
  989.     {
  990.         return ($this->deleted == ProductPageEnum::ITEM_ON_TRASH);
  991.     }
  992.     public function isDeleted(): bool
  993.     {
  994.         return ($this->deleted == ProductPageEnum::ITEM_DELETED);
  995.     }
  996.     public function restore(): self
  997.     {
  998.         $this->deleted ProductPageEnum::ITEM_NO_DELETED;
  999.         return $this;
  1000.     }
  1001.     public function trash(): self
  1002.     {
  1003.         $this->deleted ProductPageEnum::ITEM_ON_TRASH;
  1004.         return $this;
  1005.     }
  1006.     public function delete(): self
  1007.     {
  1008.         $this->deleted ProductPageEnum::ITEM_DELETED;
  1009.         return $this;
  1010.     }
  1011.     public function toReturn(){
  1012.         $data = [
  1013.             "id" => $this->id,
  1014.             "deleted" => $this->deleted,
  1015.             "status" => $this->status,
  1016.             "default" => $this->default,
  1017.             "type" => $this->type,
  1018.             "name" => $this->getName(),
  1019.             "title" => $this->getTitle(),
  1020.             "description" => $this->getDescription(),
  1021.             "about" => $this->getAbout(),
  1022.             "overview" => $this->getOverview(),
  1023.             "target" => $this->getTarget(),
  1024.             "aboutCertificate" => $this->getAboutCertificate(),
  1025.             "video" => $this->getVideo(),
  1026.             "autoplay" => $this->autoplay,
  1027.             "photo" => FileService::getFilePathComplete(
  1028.                 $this->photo
  1029.                 ProductPageEnum::PATH_PRODUCT_PHOTO
  1030.                 true,
  1031.                 true
  1032.             ),
  1033.             "photoStand" => FileService::getFilePathComplete(
  1034.                 $this->photoStand
  1035.                 ProductPageEnum::PATH_PRODUCT_PHOTO
  1036.                 true,
  1037.                 true
  1038.             ),
  1039.             "photoExpand" => FileService::getFilePathComplete(
  1040.                 $this->photoExpand
  1041.                 ProductPageEnum::PATH_PRODUCT_PHOTO
  1042.                 true,
  1043.                 true
  1044.             ),
  1045.             "cover" => FileService::getFilePathComplete(
  1046.                 $this->cover
  1047.                 ProductPageEnum::PATH_PRODUCT_COVER
  1048.                 true,
  1049.                 true
  1050.             ),
  1051.             "pageColorText" => $this->pageColorText,
  1052.             "backgroundColor" => $this->backgroundColor,
  1053.             "externalPage" => $this->externalPage,
  1054.             "externalPageLink" => $this->externalPageLink,
  1055.             "showModuleCoupon" => $this->showModuleCoupon,
  1056.             "showModuleTestimonials" => $this->showModuleTestimonials,
  1057.             "showModuleDataBilling" => $this->showModuleDataBilling,
  1058.             "showModuleOptionForeign" => $this->showModuleOptionForeign,
  1059.             "showShortageControlTime" => $this->showShortageControlTime,
  1060.             "showShortageControlVisualization" => $this->showShortageControlVisualization,
  1061.             "showShortageControlBuyers" => $this->showShortageControlBuyers,
  1062.             "showShortageControlVacancies" => $this->showShortageControlVacancies,
  1063.             "allowExternalConclusion" => $this->allowExternalConclusion,
  1064.             "externalConclusionLink" => $this->externalConclusionLink,
  1065.             "showModuleHeader" => $this->showModuleHeader,
  1066.             "showModuleContracts" => $this->showModuleContracts,
  1067.             "shortageTimeNumber" => $this->shortageTimeNumber,
  1068.             "shortageVisualizationNumber" => $this->shortageVisualizationNumber,
  1069.             "shortageBuyersNumber" => $this->shortageBuyersNumber,
  1070.             "shortageVacanciesNumber" => $this->shortageVacanciesNumber,
  1071.             "library" => ( $this->library $this->library->getId() : null ),
  1072.             "product" => ( $this->product $this->product->getId() : null ),
  1073.             "userDelete" => ( $this->userDelete $this->userDelete->getId() : null ),
  1074.             "typeDelete" => $this->typeDelete,
  1075.             "dateDelete" => $this->getDateDelete()
  1076.         ];
  1077.         return $data;
  1078.     }
  1079. }