From 52acac3681a42a41761f5913308350ccf9e13454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 5 Mar 2019 13:57:40 +0100 Subject: [PATCH] Renamed getDatetimeAdded so it has the same name as the coloumn name --- src/Entity/Category.php | 4 ++-- src/Entity/NamedDBElement.php | 10 ++++------ templates/show_part_info.html.twig | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Entity/Category.php b/src/Entity/Category.php index 1ae4935c..858b2ef5 100644 --- a/src/Entity/Category.php +++ b/src/Entity/Category.php @@ -50,8 +50,8 @@ class Category extends PartsContainingDBElement protected $parts; /** - * @var bool - * @ORM\Column(type="boolean") + * @var string + * @ORM\Column(type="string") */ protected $partname_hint; diff --git a/src/Entity/NamedDBElement.php b/src/Entity/NamedDBElement.php index 9b92a0a2..0b832855 100644 --- a/src/Entity/NamedDBElement.php +++ b/src/Entity/NamedDBElement.php @@ -69,7 +69,7 @@ abstract class NamedDBElement extends DBElement /** * Returns the last time when the element was modified. - * @return string The time of the last edit. + * @return \DateTime The time of the last edit. */ public function getLastModified() : \DateTime { @@ -78,13 +78,10 @@ abstract class NamedDBElement extends DBElement /** * Returns the date/time when the element was created. - * @param $formatted bool When true, the date gets formatted with the locale and timezone settings. - * When false, the raw value from the DB is returned. - * @return string The creation time of the part. + * @return \DateTime The creation time of the part. */ - public function getDatetimeAdded() : \DateTime + public function getAddedDate() : \DateTime { - //TODO return $this->addedDate; } @@ -102,6 +99,7 @@ abstract class NamedDBElement extends DBElement * So you don't have to do this yourself. * * @param string $new_name the new name + * @return self */ public function setName(string $new_name) : self { diff --git a/templates/show_part_info.html.twig b/templates/show_part_info.html.twig index 0fd69b45..ec075be1 100644 --- a/templates/show_part_info.html.twig +++ b/templates/show_part_info.html.twig @@ -213,7 +213,7 @@
-

{{ part.lastModified | date }} +

{{ part.addedDate | date }} {# {if !empty($last_modified_user)} {% trans %}by{% endtrans %} {if $can_visit_user} {$last_modified_user}