TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
PostRepository Class Reference
Inheritance diagram for PostRepository:
Repository RepositoryInterface SingletonInterface

Public Member Functions

 findAllByBlog (\ExtbaseTeam\BlogExample\Domain\Model\Blog $blog)
 
 findByTagAndBlog ($tag,\ExtbaseTeam\BlogExample\Domain\Model\Blog $blog)
 
 findRemaining (\ExtbaseTeam\BlogExample\Domain\Model\Post $post)
 
 findPrevious (\ExtbaseTeam\BlogExample\Domain\Model\Post $post)
 
 findNext (\ExtbaseTeam\BlogExample\Domain\Model\Post $post)
 
 findRecentByBlog (\ExtbaseTeam\BlogExample\Domain\Model\Blog $blog, $limit=5)
 
 findByCategory ($categoryUid)
 
- Public Member Functions inherited from Repository
 injectPersistenceManager (\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager)
 
 __construct (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 add ($object)
 
 remove ($object)
 
 update ($modifiedObject)
 
 findAll ()
 
 countAll ()
 
 removeAll ()
 
 findByUid ($uid)
 
 findByIdentifier ($identifier)
 
 setDefaultOrderings (array $defaultOrderings)
 
 setDefaultQuerySettings (\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $defaultQuerySettings)
 
 createQuery ()
 
 __call ($methodName, $arguments)
 

Protected Attributes

 $defaultOrderings = ['date' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING]
 
- Protected Attributes inherited from Repository
 $persistenceManager
 
 $objectManager
 
 $objectType
 
 $defaultOrderings = []
 
 $defaultQuerySettings = null
 

Additional Inherited Members

- Protected Member Functions inherited from Repository
 getRepositoryClassName ()
 

Detailed Description

A repository for blog posts

findByUid($uid)

Definition at line 22 of file PostRepository.php.

Member Function Documentation

findAllByBlog ( \ExtbaseTeam\BlogExample\Domain\Model\Blog  $blog)

Finds all posts by the specified blog

Parameters
\ExtbaseTeam\BlogExample\Domain\Model\Blog$blogThe blog the post must refer to
Returns
The posts

Definition at line 32 of file PostRepository.php.

References Repository\createQuery().

findByCategory (   $categoryUid)

Find posts by category

Parameters
int$categoryUid
Returns

Definition at line 142 of file PostRepository.php.

References Repository\createQuery().

findByTagAndBlog (   $tag,
\ExtbaseTeam\BlogExample\Domain\Model\Blog  $blog 
)

Finds posts by the specified tag and blog

Parameters
string$tag
\ExtbaseTeam\BlogExample\Domain\Model\Blog$blogThe blog the post must refer to
Returns
The posts

Definition at line 49 of file PostRepository.php.

References Repository\createQuery().

Finds the post next to the given post

Parameters
\ExtbaseTeam\BlogExample\Domain\Model\Post$postThe reference post
Returns

Definition at line 107 of file PostRepository.php.

References Repository\createQuery().

Finds the previous of the given post

Parameters
\ExtbaseTeam\BlogExample\Domain\Model\Post$postThe reference post
Returns

Definition at line 90 of file PostRepository.php.

References Repository\createQuery().

findRecentByBlog ( \ExtbaseTeam\BlogExample\Domain\Model\Blog  $blog,
  $limit = 5 
)

Finds most recent posts by the specified blog

Parameters
\ExtbaseTeam\BlogExample\Domain\Model\Blog$blogThe blog the post must refer to
int$limitThe number of posts to return at max
Returns
The posts

Definition at line 125 of file PostRepository.php.

References Repository\createQuery().

findRemaining ( \ExtbaseTeam\BlogExample\Domain\Model\Post  $post)

Finds all remaining posts of the blog

Parameters
\ExtbaseTeam\BlogExample\Domain\Model\Post$postThe reference post
Returns
The posts

Definition at line 68 of file PostRepository.php.

References Repository\createQuery().

Member Data Documentation

$defaultOrderings = ['date' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING]
protected

Definition at line 24 of file PostRepository.php.