]> Raphaël G. Git Repositories - airbundle/commitdiff
Add short field and related methods
authorRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:24:37 +0000 (05:24 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:24:37 +0000 (05:24 +0100)
Add __toString magic method
Cleanup

Entity/Title.php

index 54a6a60b65189fbf71f0308861881f16e4f92dfd..e6cc9e8f93c26890b06d546d00f0a5f8878b635e 100644 (file)
@@ -1,7 +1,41 @@
 <?php
 
-// src/Rapsys/AirBundle/Entity/Title.php
 namespace Rapsys\AirBundle\Entity;
 
 class Title extends \Rapsys\UserBundle\Entity\Title {
+       /**
+        * @var string
+        */
+       private $short;
+
+       /**
+        * 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;
+       }
+
+       /**
+        * Returns a string representation of the title
+        *
+        * @return string
+        */
+       public function __toString(): string {
+               return $this->short;
+       }
 }