TYPO3 CMS  TYPO3_8-7
Comment.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
25  protected $date;
26 
31  protected $author = '';
32 
37  protected $email = '';
38 
43  protected $content = '';
44 
48  public function __construct()
49  {
50  $this->date = new \DateTime();
51  }
52 
58  public function setDate(\DateTime $date)
59  {
60  $this->date = $date;
61  }
62 
68  public function getDate()
69  {
70  return $this->date;
71  }
72 
78  public function setAuthor($author)
79  {
80  $this->author = $author;
81  }
82 
88  public function getAuthor()
89  {
90  return $this->author;
91  }
92 
98  public function setEmail($email)
99  {
100  $this->email = $email;
101  }
102 
108  public function getEmail()
109  {
110  return $this->email;
111  }
112 
118  public function setContent($content)
119  {
120  $this->content = $content;
121  }
122 
128  public function getContent()
129  {
130  return $this->content;
131  }
132 
138  public function __toString()
139  {
140  return $this->author . ' (' . $this->email . ') said on ' . $this->date->format('Y-m-d') . ':' . chr(10) .
141  $this->content . chr(10);
142  }
143 }