]> Raphaël G. Git Repositories - userbundle/commitdiff
Remove Title entity short field and related methods
authorRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 03:25:11 +0000 (04:25 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 03:25:11 +0000 (04:25 +0100)
Add __toString magic method

Entity/Title.php
Resources/config/doctrine/Title.orm.yml

index 5a2b68515e3c0261d3ae0c285352c4fd90c32e1f..bcaf7858c56a82db19f2b4492045abb58b4a2d3c 100644 (file)
@@ -11,11 +11,6 @@ class Title {
         */
        protected $id;
 
-       /**
-        * @var string
-        */
-       protected $short;
-
        /**
         * @var string
         */
@@ -52,28 +47,6 @@ class Title {
                return $this->id;
        }
 
-       /**
-        * Set short
-        *
-        * @param string $short
-        *
-        * @return Title
-        */
-       public function setShort($short) {
-               $this->short = $short;
-
-               return $this;
-       }
-
-       /**
-        * Get short
-        *
-        * @return string
-        */
-       public function getShort() {
-               return $this->short;
-       }
-
        /**
         * Set title
         *
@@ -170,4 +143,13 @@ class Title {
        public function getUsers() {
                return $this->users;
        }
+
+       /**
+        * Returns a string representation of the title
+        *
+        * @return string
+        */
+       public function __toString(): string {
+               return $this->title;
+       }
 }
index 389e89d85441cb7b926e239d2700bef54d4233d3..85354a0120d6fa2928109a25e2e7561012171ea7 100644 (file)
@@ -8,9 +8,6 @@ Rapsys\UserBundle\Entity\Title:
             options:
                 unsigned: true
     fields:
-        short:
-            type: string
-            length: 4
         title:
             type: string
             length: 16