From e21af741a42f006b9474700f2bff3de252e7ca36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 11 Dec 2019 04:25:11 +0100 Subject: [PATCH] Remove Title entity short field and related methods Add __toString magic method --- Entity/Title.php | 36 +++++++------------------ Resources/config/doctrine/Title.orm.yml | 3 --- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/Entity/Title.php b/Entity/Title.php index 5a2b685..bcaf785 100644 --- a/Entity/Title.php +++ b/Entity/Title.php @@ -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; + } } diff --git a/Resources/config/doctrine/Title.orm.yml b/Resources/config/doctrine/Title.orm.yml index 389e89d..85354a0 100644 --- a/Resources/config/doctrine/Title.orm.yml +++ b/Resources/config/doctrine/Title.orm.yml @@ -8,9 +8,6 @@ Rapsys\UserBundle\Entity\Title: options: unsigned: true fields: - short: - type: string - length: 4 title: type: string length: 16 -- 2.41.1