Sindbad~EG File Manager

Current Path : /opt/nginxhttpd_/vendor/extensions-cpanel/cpanel-development-lib/src/Entity/
Upload File :
Current File : //opt/nginxhttpd_/vendor/extensions-cpanel/cpanel-development-lib/src/Entity/WafCustomization.php

<?php

namespace O2switch\CpanelLib\Entity;

use O2switch\CpanelLib\Validator\WafRules;
use Doctrine\ORM\Mapping as ORM;
use O2switch\CpanelLib\Repository\WafCustomizationRepository;
use Symfony\Component\Validator\Constraints as Assert;


/**
 * @ORM\Entity(repositoryClass=WafCustomizationRepository::class)
 * @ORM\Table(
 *     name="WafCustomization",
 *     uniqueConstraints={@ORM\UniqueConstraint(columns={"domain"})}
 * )
 */
class WafCustomization
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer", name="id")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=255, name="domain")
     * @Assert\NotBlank()
     * @Assert\NotNull()
     */
    private $domain;

    /**
     * @ORM\Column(type="string", length=255, name="serverName")
     * @Assert\NotBlank()
     * @Assert\NotNull()
     */
    private $serverName;

    /**
     * @ORM\Column(type="string", length=255, name="cpUser")
     * @Assert\NotBlank()
     * @Assert\NotNull()
     */
    private $cpUser;

    /**
     * @ORM\Column(type="json", name="rules")
     * @Assert\Type(type="array")
     * @WafRules()
     */
    private $rules;

    /**
     * @ORM\Column (type="datetime", name="date")
     * @Assert\NotBlank()
     * @Assert\NotNull()
     * @Assert\Type("\DateTime")
     */
    private $date;

    public function __construct(?array $entity = null){
        $this->setDate(new \DateTime('now'));
        if(isset($entity['domain'])){
            $this->setDomain($entity['domain']);
        }
        if(isset($entity['servername']) || isset($entity['serverName'])){
            $this->setServerName($entity['servername'] ?? $entity['serverName']);
        }
        if(isset($entity['rules'])){
            $this->setRules($entity['rules']);
        }
        if(isset($entity['cpUser'])){
            $this->setCpUser($entity['cpUser']);
        }
    }

    /**
     * @return mixed
     */
    public function getDomain()
    {
        return $this->domain;
    }

    /**
     * @param mixed $domain
     * @return WafCustomization
     */
    public function setDomain($domain)
    {
        $this->domain = $domain;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getServerName()
    {
        return $this->serverName;
    }

    /**
     * @param mixed $serverName
     * @return WafCustomization
     */
    public function setServerName($serverName)
    {
        $this->serverName = $serverName;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getCpUser()
    {
        return $this->cpUser;
    }

    /**
     * @param mixed $cpUser
     * @return WafCustomization
     */
    public function setCpUser($cpUser)
    {
        $this->cpUser = $cpUser;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getRules()
    {
        return $this->rules;
    }

    /**
     * @param mixed $rules
     * @return WafCustomization
     */
    public function setRules($rules)
    {
        $this->rules = $rules;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * @param mixed $date
     * @return WafCustomization
     */
    public function setDate($date)
    {
        $this->date = $date;
        return $this;
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists