modules/CSI/AccountNotes/src/Model/AccountNotes.php line 27

Open in your IDE?
  1. <?php
  2. /* vim: set ts=4 sw=4 sts=4 et: */
  3. /**
  4.  * Account Notes Module
  5.  *
  6.  * @category  X-Cart_5_5_Module
  7.  * @package   AccountNotes
  8.  * @author    CFL Systems, Inc. <support@cflsystems.com>
  9.  * @copyright 2022 CFL Systems, Inc. All rights reserved.
  10.  * @license   License Agreement - https://www.cflsystems.com/software-license-agreement.html
  11.  * @link      https://www.cflsystems.com/account-notes-for-x-cart-5.html
  12.  */
  13. namespace CSI\AccountNotes\Model;
  14. use XLite\Model\Profile;
  15. use Doctrine\ORM\Mapping as ORM;
  16. /**
  17.  * The "account notes" model class
  18.  *
  19.  * @ORM\Entity
  20.  *
  21.  * @ORM\Table (name="csi_account_notes")
  22.  */
  23. class AccountNotes extends \XLite\Model\AEntity
  24. {
  25.     /**
  26.      * Account Note unique ID
  27.      *
  28.      * @var integer
  29.      *
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue (strategy="AUTO")
  32.      * @ORM\Column         (type="integer")
  33.      */
  34.     protected $id;
  35.     /**
  36.      * The profile id account note applies to
  37.      *
  38.      * @var Profile
  39.      *
  40.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Profile", inversedBy="accountNotes")
  41.      * @ORM\JoinColumn (name="profile_id", referencedColumnName="profile_id")
  42.      */
  43.     protected $profile;
  44.     /**
  45.      * Account Note creator profile id
  46.      *
  47.      * @var integer
  48.      *
  49.      * @ORM\Column (type="integer")
  50.      */
  51.     protected $ownerId;
  52.     /**
  53.      * Account Note title
  54.      *
  55.      * @var string
  56.      *
  57.      * @ORM\Column (type="string", length=255)
  58.      */
  59.     protected $noteTitle '';
  60.     /**
  61.      * Account Note text
  62.      *
  63.      * @var string
  64.      *
  65.      * @ORM\Column (type="text")
  66.      */
  67.     protected $noteText '';
  68.     /**
  69.      * Timestamp of Account Note creation date
  70.      *
  71.      * @var integer
  72.      *
  73.      * @ORM\Column (type="integer")
  74.      */
  75.     protected $dateAdded 0;
  76.     /**
  77.      * Account Note flag
  78.      *
  79.      * @var string
  80.      *
  81.      * @ORM\Column (type="string", length=6)
  82.      */
  83.     protected $noteFlag 'none';
  84.     /**
  85.      * Allow account to see note
  86.      *
  87.      * @var boolean
  88.      *
  89.      * @ORM\Column (type="boolean")
  90.      */
  91.     protected $customerEnabled false;
  92.     /**
  93.      * Allow other admins to modify note
  94.      *
  95.      * @var boolean
  96.      *
  97.      * @ORM\Column (type="boolean")
  98.      */
  99.     protected $adminEnabled true;
  100.     /**
  101.      * Get id
  102.      *
  103.      * @return integer
  104.      */
  105.     public function getId()
  106.     {
  107.         return $this->id;
  108.     }
  109.     /**
  110.      * Set ownerId
  111.      *
  112.      * @param integer $ownerId Note owner Id
  113.      *
  114.      * @return self
  115.      */
  116.     public function setOwnerId(int $ownerId)
  117.     {
  118.         $this->ownerId $ownerId;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get ownerId
  123.      *
  124.      * @return integer
  125.      */
  126.     public function getOwnerId()
  127.     {
  128.         return $this->ownerId;
  129.     }
  130.     /**
  131.      * Set noteTitle
  132.      *
  133.      * @param string $noteTitle Note title
  134.      *
  135.      * @return self
  136.      */
  137.     public function setNoteTitle(string $noteTitle)
  138.     {
  139.         $this->noteTitle $noteTitle;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get noteTitle
  144.      *
  145.      * @return string
  146.      */
  147.     public function getNoteTitle()
  148.     {
  149.         return $this->noteTitle;
  150.     }
  151.     /**
  152.      * Set noteText
  153.      *
  154.      * @param text $noteText Note content
  155.      *
  156.      * @return self
  157.      */
  158.     public function setNoteText(string $noteText)
  159.     {
  160.         $this->noteText $noteText;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Get noteText
  165.      *
  166.      * @return text
  167.      */
  168.     public function getNoteText()
  169.     {
  170.         return $this->noteText;
  171.     }
  172.     /**
  173.      * Set dateAdded
  174.      *
  175.      * @param integer $dateAdded date note is added
  176.      *
  177.      * @return self
  178.      */
  179.     public function setDateAdded(int $dateAdded)
  180.     {
  181.         $this->dateAdded $dateAdded;
  182.         return $this;
  183.     }
  184.     /**
  185.      * Get dateAdded
  186.      *
  187.      * @return integer
  188.      */
  189.     public function getDateAdded()
  190.     {
  191.         return $this->dateAdded;
  192.     }
  193.     /**
  194.      * Set noteFlag
  195.      *
  196.      * @param string $noteFlag Note flag
  197.      *
  198.      * @return self
  199.      */
  200.     public function setNoteFlag(string $noteFlag)
  201.     {
  202.         $this->noteFlag $noteFlag;
  203.         return $this;
  204.     }
  205.     /**
  206.      * Get noteFlag
  207.      *
  208.      * @return string
  209.      */
  210.     public function getNoteFlag()
  211.     {
  212.         return $this->noteFlag;
  213.     }
  214.     /**
  215.      * Set customerEnabled
  216.      *
  217.      * @param boolean $customerEnabled Can customer see the note
  218.      *
  219.      * @return self
  220.      */
  221.     public function setCustomerEnabled(bool $customerEnabled)
  222.     {
  223.         $this->customerEnabled $customerEnabled;
  224.         return $this;
  225.     }
  226.     /**
  227.      * Get customerEnabled
  228.      *
  229.      * @return boolean
  230.      */
  231.     public function getCustomerEnabled()
  232.     {
  233.         return $this->customerEnabled;
  234.     }
  235.     /**
  236.      * Set adminEnabled
  237.      *
  238.      * @param boolean $adminEnabled Can non-owner admin modify the note
  239.      *
  240.      * @return self
  241.      */
  242.     public function setAdminEnabled(bool $adminEnabled)
  243.     {
  244.         $this->adminEnabled $adminEnabled;
  245.         return $this;
  246.     }
  247.     /**
  248.      * Get adminEnabled
  249.      *
  250.      * @return boolean
  251.      */
  252.     public function getAdminEnabled()
  253.     {
  254.         return $this->adminEnabled;
  255.     }
  256.     /**
  257.      * Set profile
  258.      *
  259.      * @param Profile $profile Customer profile the note applies to
  260.      *
  261.      * @return self
  262.      */
  263.     public function setProfile(Profile $profile null)
  264.     {
  265.         $this->profile $profile;
  266.         return $this;
  267.     }
  268.     /**
  269.      * Get profile
  270.      *
  271.      * @return Profile
  272.      */
  273.     public function getProfile()
  274.     {
  275.         return $this->profile;
  276.     }
  277. }