src/Entity/UserMeta.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\UserMetaRepository")
  6.  */
  7. class UserMeta
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="bigint")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="string", length=255)
  17.      */
  18.     private $metakey;
  19.     /**
  20.      * @ORM\Column(type="text")
  21.      */
  22.     private $metavalue;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="usermeta")
  25.      * @ORM\JoinColumn(nullable=true)
  26.      */
  27.     private $user;
  28.     
  29.     public function __construct () {
  30.         $this->metakey "";
  31.         $this->metavalue "";
  32.     }
  33.     public function getId()
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getMetakey(): ?string
  38.     {
  39.         return $this->metakey;
  40.     }
  41.     public function setMetakey(?string $metakey): self
  42.     {
  43.         if (is_null($metakey)) {
  44.             $metakey "";
  45.         }
  46.         
  47.         $this->metakey $metakey;
  48.         return $this;
  49.     }
  50.     public function getMetavalue(): ?string
  51.     {
  52.         return $this->metavalue;
  53.     }
  54.     public function setMetavalue(?string $metavalue): self
  55.     {
  56.         if (is_null($metavalue)) {
  57.             $metavalue "";
  58.         }
  59.         
  60.         $this->metavalue $metavalue;
  61.         return $this;
  62.     }
  63.     public function getUser(): ?User
  64.     {
  65.         return $this->user;
  66.     }
  67.     public function setUser(?User $user): self
  68.     {
  69.         $this->user $user;
  70.         return $this;
  71.     }
  72.     
  73.     public function __toString ()
  74.     {
  75.         return implode(":", [
  76.             $this->id,
  77.             $this->metakey,
  78.             $this->metavalue,
  79.         ]);
  80.     }
  81. }