‪TYPO3CMS  10.4
Comment.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
25 {
29  protected ‪$date;
30 
35  protected ‪$author = '';
36 
41  protected ‪$email = '';
42 
47  protected ‪$content = '';
48 
52  public function ‪__construct()
53  {
54  $this->date = new \DateTime();
55  }
56 
62  public function ‪setDate(\DateTime ‪$date)
63  {
64  $this->date = ‪$date;
65  }
66 
72  public function ‪getDate()
73  {
74  return ‪$this->date;
75  }
76 
82  public function ‪setAuthor(‪$author)
83  {
84  $this->author = ‪$author;
85  }
86 
92  public function ‪getAuthor()
93  {
94  return ‪$this->author;
95  }
96 
102  public function ‪setEmail(‪$email)
103  {
104  $this->email = ‪$email;
105  }
106 
112  public function ‪getEmail()
113  {
114  return ‪$this->email;
115  }
116 
122  public function ‪setContent(‪$content)
123  {
124  $this->content = ‪$content;
125  }
126 
132  public function ‪getContent()
133  {
134  return ‪$this->content;
135  }
136 
142  public function ‪__toString()
143  {
144  return $this->author . ' (' . $this->email . ') said on ' . $this->date->format('Y-m-d') . ':' . chr(10) .
145  $this->content . chr(10);
146  }
147 }
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\__toString
‪string __toString()
Definition: Comment.php:138
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\setAuthor
‪setAuthor($author)
Definition: Comment.php:78
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:18
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\setContent
‪setContent($content)
Definition: Comment.php:118
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\getContent
‪string getContent()
Definition: Comment.php:128
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\$email
‪string $email
Definition: Comment.php:38
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\setEmail
‪setEmail($email)
Definition: Comment.php:98
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\$date
‪DateTime $date
Definition: Comment.php:28
‪TYPO3\CMS\Extbase\DomainObject\AbstractEntity
Definition: AbstractEntity.php:23
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\setDate
‪setDate(\DateTime $date)
Definition: Comment.php:58
‪ExtbaseTeam\BlogExample\Domain\Model\Comment
Definition: Comment.php:25
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\$content
‪string $content
Definition: Comment.php:43
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\getDate
‪DateTime getDate()
Definition: Comment.php:68
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\getEmail
‪string getEmail()
Definition: Comment.php:108
‪ExtbaseTeam\BlogExample\Domain\Model
Definition: Administrator.php:16
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\$author
‪string $author
Definition: Comment.php:33
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\getAuthor
‪string getAuthor()
Definition: Comment.php:88
‪ExtbaseTeam\BlogExample\Domain\Model\Comment\__construct
‪__construct()
Definition: Comment.php:48