‪TYPO3CMS  ‪main
TYPO3Tests\BlogExample\Domain\Model\Post Class Reference
Inheritance diagram for TYPO3Tests\BlogExample\Domain\Model\Post:
TYPO3\CMS\Extbase\DomainObject\AbstractEntity TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface

Public Member Functions

 __construct ()
 
 setBlog (Blog $blog)
 
 getBlog ()
 
 setTitle (string $title)
 
 getTitle ()
 
 setDate (\DateTime $date)
 
 getDate ()
 
 setTags (ObjectStorage $tags)
 
 addTag (Tag $tag)
 
 removeTag (Tag $tag)
 
 removeAllTags ()
 
ObjectStorage< TaggetTags ()
 
 addCategory (Category $category)
 
 setCategories (ObjectStorage $categories)
 
ObjectStorage< CategorygetCategories ()
 
 removeCategory (Category $category)
 
 setAuthor (Person $author)
 
 getAuthor ()
 
 getSecondAuthor ()
 
 setSecondAuthor (Person $secondAuthor)
 
 getReviewer ()
 
 setReviewer (Person $reviewer)
 
 setContent ($content)
 
 getContent ()
 
 setComments (ObjectStorage $comments)
 
 addComment (Comment $comment)
 
 removeComment (Comment $commentToDelete)
 
 removeAllComments ()
 
ObjectStorage< CommentgetComments ()
 
 setRelatedPosts (ObjectStorage $relatedPosts)
 
 addRelatedPost (Post $post)
 
 removeAllRelatedPosts ()
 
ObjectStorage< PostgetRelatedPosts ()
 
 getAdditionalName ()
 
 setAdditionalName (Info $additionalName)
 
 getAdditionalInfo ()
 
 setAdditionalInfo (Info $additionalInfo)
 
ObjectStorage< CommentgetAdditionalComments ()
 
 setAdditionalComments (ObjectStorage $additionalComments)
 
 addAdditionalComment (Comment $comment)
 
 removeAllAdditionalComments ()
 
 removeAdditionalComment (Comment $comment)
 
 __toString ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
 setPid (int $pid)
 
 _setProperty (string $propertyName, mixed $value)
 
 _getProperty (string $propertyName)
 
 _memorizeCleanState (?string $propertyName=null)
 
 _memorizePropertyCleanState (string $propertyName)
 
 _getCleanProperty (string $propertyName)
 
 _isDirty (?string $propertyName=null)
 
 _isClone ()
 
 _setClone (bool $clone)
 
 __clone ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface
 getUid ()
 
 getPid ()
 
 _isNew ()
 
 _hasProperty (string $propertyName)
 

Protected Attributes

Blog $blog = null
 
string $title = ''
 
DateTime $date
 
Person $author = null
 
Person $secondAuthor = null
 
Person $reviewer = null
 
string $content = ''
 
ObjectStorage $tags
 
ObjectStorage $categories
 
ObjectStorage $comments
 
ObjectStorage $relatedPosts
 
Info $additionalName = null
 
Info $additionalInfo = null
 
ObjectStorage $additionalComments
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
int $uid = null
 
int $_localizedUid = null
 
int $_languageUid = null
 
int $_versionedUid = null
 
int $pid = null
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
const PROPERTY_UID = 'uid'
 
const PROPERTY_PID = 'pid'
 
const PROPERTY_LOCALIZED_UID = '_localizedUid'
 
const PROPERTY_LANGUAGE_UID = '_languageUid'
 
const PROPERTY_VERSIONED_UID = '_versionedUid'
 
int< 1, function getUid():?int { if( $this->uid !==null) { return(int) $this-> uid
 
return null
 
int< 0, function getPid():int|null { if( $this->pid===null) { return null;} return(int) $this-> pid
 
array< non-empty-string, function _getProperties():array { $properties=get_object_vars( $this);foreach( $properties as $propertyName=> $propertyValue) { if(str_starts_with( $propertyName, '_')) { unset( $properties[ $propertyName]);} } return $properties;} public function _hasProperty(string $propertyName):bool { return property_exists( $this, $propertyName);} public function _isNew():bool { return $this-> uid === null
 
array< non-empty-string, function _getCleanProperties():array { return $this-> _cleanProperties
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
 isPropertyDirty (mixed $previousValue, mixed $currentValue)
 

Detailed Description

A blog post

Definition at line 27 of file Post.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3Tests\BlogExample\Domain\Model\Post::__construct ( )

Definition at line 89 of file Post.php.

Member Function Documentation

◆ __toString()

TYPO3Tests\BlogExample\Domain\Model\Post::__toString ( )

Returns this post as a formatted string

Reimplemented from TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject.

Definition at line 380 of file Post.php.

◆ addAdditionalComment()

TYPO3Tests\BlogExample\Domain\Model\Post::addAdditionalComment ( Comment  $comment)

Definition at line 361 of file Post.php.

◆ addCategory()

TYPO3Tests\BlogExample\Domain\Model\Post::addCategory ( Category  $category)

Definition at line 169 of file Post.php.

◆ addComment()

TYPO3Tests\BlogExample\Domain\Model\Post::addComment ( Comment  $comment)

Adds a comment to this post

Definition at line 256 of file Post.php.

◆ addRelatedPost()

TYPO3Tests\BlogExample\Domain\Model\Post::addRelatedPost ( Post  $post)

Adds a related post

Definition at line 301 of file Post.php.

◆ addTag()

TYPO3Tests\BlogExample\Domain\Model\Post::addTag ( Tag  $tag)

Definition at line 143 of file Post.php.

◆ getAdditionalComments()

ObjectStorage<Comment> TYPO3Tests\BlogExample\Domain\Model\Post::getAdditionalComments ( )
Returns
‪ObjectStorage<Comment>

Definition at line 348 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$additionalComments.

◆ getAdditionalInfo()

TYPO3Tests\BlogExample\Domain\Model\Post::getAdditionalInfo ( )

◆ getAdditionalName()

TYPO3Tests\BlogExample\Domain\Model\Post::getAdditionalName ( )

◆ getAuthor()

TYPO3Tests\BlogExample\Domain\Model\Post::getAuthor ( )

Definition at line 200 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$author.

◆ getBlog()

TYPO3Tests\BlogExample\Domain\Model\Post::getBlog ( )

◆ getCategories()

ObjectStorage<Category> TYPO3Tests\BlogExample\Domain\Model\Post::getCategories ( )
Returns
‪ObjectStorage<Category>

Definition at line 185 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$categories.

◆ getComments()

ObjectStorage<Comment> TYPO3Tests\BlogExample\Domain\Model\Post::getComments ( )

Returns the comments to this post

Returns
‪ObjectStorage<Comment> holding instances of Comment

Definition at line 283 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$comments.

◆ getContent()

TYPO3Tests\BlogExample\Domain\Model\Post::getContent ( )

Getter for content

Definition at line 238 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$content.

◆ getDate()

◆ getRelatedPosts()

ObjectStorage<Post> TYPO3Tests\BlogExample\Domain\Model\Post::getRelatedPosts ( )

Returns the related posts

Returns
‪ObjectStorage<Post> holding instances of Post

Definition at line 320 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$relatedPosts.

◆ getReviewer()

TYPO3Tests\BlogExample\Domain\Model\Post::getReviewer ( )

Definition at line 215 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$reviewer.

◆ getSecondAuthor()

TYPO3Tests\BlogExample\Domain\Model\Post::getSecondAuthor ( )

Definition at line 205 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$secondAuthor.

◆ getTags()

ObjectStorage<Tag> TYPO3Tests\BlogExample\Domain\Model\Post::getTags ( )

Getter for tags Note: We return a clone of the tags because they must not be modified as they are Value Objects

Returns
‪ObjectStorage<Tag> A storage holding objects

Definition at line 164 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$tags.

◆ getTitle()

◆ removeAdditionalComment()

TYPO3Tests\BlogExample\Domain\Model\Post::removeAdditionalComment ( Comment  $comment)

Definition at line 372 of file Post.php.

◆ removeAllAdditionalComments()

TYPO3Tests\BlogExample\Domain\Model\Post::removeAllAdditionalComments ( )

◆ removeAllComments()

TYPO3Tests\BlogExample\Domain\Model\Post::removeAllComments ( )

Remove all comments from this post

Definition at line 272 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$comments, and TYPO3\CMS\Extbase\Persistence\ObjectStorage\removeAll().

◆ removeAllRelatedPosts()

TYPO3Tests\BlogExample\Domain\Model\Post::removeAllRelatedPosts ( )

◆ removeAllTags()

TYPO3Tests\BlogExample\Domain\Model\Post::removeAllTags ( )

Definition at line 153 of file Post.php.

◆ removeCategory()

TYPO3Tests\BlogExample\Domain\Model\Post::removeCategory ( Category  $category)

Definition at line 190 of file Post.php.

◆ removeComment()

TYPO3Tests\BlogExample\Domain\Model\Post::removeComment ( Comment  $commentToDelete)

Removes Comment from this post

Definition at line 264 of file Post.php.

◆ removeTag()

TYPO3Tests\BlogExample\Domain\Model\Post::removeTag ( Tag  $tag)

Definition at line 148 of file Post.php.

◆ setAdditionalComments()

TYPO3Tests\BlogExample\Domain\Model\Post::setAdditionalComments ( ObjectStorage  $additionalComments)
Parameters
ObjectStorage<Comment>‪$additionalComments

Definition at line 356 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$additionalComments.

◆ setAdditionalInfo()

TYPO3Tests\BlogExample\Domain\Model\Post::setAdditionalInfo ( Info  $additionalInfo)

◆ setAdditionalName()

TYPO3Tests\BlogExample\Domain\Model\Post::setAdditionalName ( Info  $additionalName)

◆ setAuthor()

TYPO3Tests\BlogExample\Domain\Model\Post::setAuthor ( Person  $author)

Definition at line 195 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$author.

◆ setBlog()

TYPO3Tests\BlogExample\Domain\Model\Post::setBlog ( Blog  $blog)

Sets the blog this post is part of

Definition at line 102 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$blog.

◆ setCategories()

TYPO3Tests\BlogExample\Domain\Model\Post::setCategories ( ObjectStorage  $categories)
Parameters
ObjectStorage<Category>‪$categories

Definition at line 177 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$categories.

◆ setComments()

TYPO3Tests\BlogExample\Domain\Model\Post::setComments ( ObjectStorage  $comments)

Setter for the comments to this post

Parameters
ObjectStorage<Comment>‪$comments An Object Storage of related Comment instances

Definition at line 248 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$comments.

◆ setContent()

TYPO3Tests\BlogExample\Domain\Model\Post::setContent (   $content)

Sets the content for this post

Parameters
string$content

Definition at line 230 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$content.

◆ setDate()

TYPO3Tests\BlogExample\Domain\Model\Post::setDate ( \DateTime  $date)

Definition at line 125 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$date.

◆ setRelatedPosts()

TYPO3Tests\BlogExample\Domain\Model\Post::setRelatedPosts ( ObjectStorage  $relatedPosts)

Setter for the related posts

Parameters
ObjectStorage<Post>‪$relatedPosts An Object Storage containing related Posts instances

Definition at line 293 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$relatedPosts.

◆ setReviewer()

TYPO3Tests\BlogExample\Domain\Model\Post::setReviewer ( Person  $reviewer)

Definition at line 220 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$reviewer.

◆ setSecondAuthor()

TYPO3Tests\BlogExample\Domain\Model\Post::setSecondAuthor ( Person  $secondAuthor)

Definition at line 210 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$secondAuthor.

◆ setTags()

TYPO3Tests\BlogExample\Domain\Model\Post::setTags ( ObjectStorage  $tags)
Parameters
ObjectStorage<Tag>‪$tags

Definition at line 138 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$tags.

◆ setTitle()

TYPO3Tests\BlogExample\Domain\Model\Post::setTitle ( string  $title)

Definition at line 115 of file Post.php.

References TYPO3Tests\BlogExample\Domain\Model\Post\$title.

Member Data Documentation

◆ $additionalComments

◆ $additionalInfo

Info TYPO3Tests\BlogExample\Domain\Model\Post::$additionalInfo = null
protected

1:1 relation stored as foreign key in Info class

Definition at line 80 of file Post.php.

Referenced by TYPO3Tests\BlogExample\Domain\Model\Post\getAdditionalInfo(), and TYPO3Tests\BlogExample\Domain\Model\Post\setAdditionalInfo().

◆ $additionalName

Info TYPO3Tests\BlogExample\Domain\Model\Post::$additionalName = null
protected

1:1 relation stored as CSV value in this class

Definition at line 75 of file Post.php.

Referenced by TYPO3Tests\BlogExample\Domain\Model\Post\getAdditionalName(), and TYPO3Tests\BlogExample\Domain\Model\Post\setAdditionalName().

◆ $author

Person TYPO3Tests\BlogExample\Domain\Model\Post::$author = null
protected

◆ $blog

Blog TYPO3Tests\BlogExample\Domain\Model\Post::$blog = null
protected

◆ $categories

ObjectStorage TYPO3Tests\BlogExample\Domain\Model\Post::$categories
protected

◆ $comments

◆ $content

string TYPO3Tests\BlogExample\Domain\Model\Post::$content = ''
protected

@Extbase\Validate("StringLength", options={"minimum": 3})

Definition at line 47 of file Post.php.

Referenced by TYPO3Tests\BlogExample\Domain\Model\Post\getContent(), and TYPO3Tests\BlogExample\Domain\Model\Post\setContent().

◆ $date

DateTime TYPO3Tests\BlogExample\Domain\Model\Post::$date
protected

◆ $relatedPosts

◆ $reviewer

Person TYPO3Tests\BlogExample\Domain\Model\Post::$reviewer = null
protected

◆ $secondAuthor

Person TYPO3Tests\BlogExample\Domain\Model\Post::$secondAuthor = null
protected

◆ $tags

ObjectStorage TYPO3Tests\BlogExample\Domain\Model\Post::$tags
protected

◆ $title

string TYPO3Tests\BlogExample\Domain\Model\Post::$title = ''
protected

@Extbase\Validate("StringLength", options={"minimum": 3, "maximum": 50})

Definition at line 34 of file Post.php.

Referenced by TYPO3Tests\BlogExample\Domain\Model\Post\getTitle(), and TYPO3Tests\BlogExample\Domain\Model\Post\setTitle().