Skip to content

Instantly share code, notes, and snippets.

@BenjaminBeck
Created January 20, 2014 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenjaminBeck/8519011 to your computer and use it in GitHub Desktop.
Save BenjaminBeck/8519011 to your computer and use it in GitHub Desktop.
<?php
/**
*
*
* @package list
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class Tx_List_Domain_Model_Article extends Tx_Extbase_DomainObject_AbstractEntity {
/**
* user
*
* @var Tx_List_Domain_Model_KundeFrontendUser
*/
protected $user;
/**
* comments
*
* @var Tx_Extbase_Persistence_ObjectStorage<Tx_List_Domain_Model_Comment>
* @cascade remove
*
*/
protected $comments;
/**
* __construct
*
* @return void
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all Tx_Extbase_Persistence_ObjectStorage properties.
*
* @return void
*/
protected function initStorageObjects() {
/**
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*/
$this->comments = new Tx_Extbase_Persistence_ObjectStorage();
}
/**
* Returns the user
*
* @return Tx_List_Domain_Model_KundeFrontendUser $user
*/
public function getUser() {
return $this->user;
}
/**
* Sets the user
*
* @param Tx_List_Domain_Model_KundeFrontendUser $user
* @return void
*/
public function setUser(Tx_List_Domain_Model_KundeFrontendUser $user) {
$this->user = $user;
}
/**
* Adds a Comment
*
* @param Tx_List_Domain_Model_Comment $comment
* @return void
*/
public function addComment(Tx_List_Domain_Model_Comment $comment) {
$this->comments->attach($comment);
}
/**
* Removes a Comment
*
* @param Tx_List_Domain_Model_Comment $commentToRemove The Comment to be removed
* @return void
*/
public function removeComment(Tx_List_Domain_Model_Comment $commentToRemove) {
$this->comments->detach($commentToRemove);
}
/**
* Returns the comments
*
* @return Tx_Extbase_Persistence_ObjectStorage<Tx_List_Domain_Model_Comment> $comments
*/
public function getComments() {
return $this->comments;
}
/**
* Sets the comments
*
* @param Tx_Extbase_Persistence_ObjectStorage<Tx_List_Domain_Model_Comment> $comments
* @return void
*/
public function setComments(Tx_Extbase_Persistence_ObjectStorage $comments) {
$this->comments = $comments;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment