TYPO3 CMS  TYPO3_7-6
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 
59  public function setDate(\DateTime $date)
60  {
61  $this->date = $date;
62  }
63 
69  public function getDate()
70  {
71  return $this->date;
72  }
73 
80  public function setAuthor($author)
81  {
82  $this->author = $author;
83  }
84 
90  public function getAuthor()
91  {
92  return $this->author;
93  }
94 
101  public function setEmail($email)
102  {
103  $this->email = $email;
104  }
105 
111  public function getEmail()
112  {
113  return $this->email;
114  }
115 
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 }