TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\Persistence\Repository Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Repository:
TYPO3\CMS\Extbase\Persistence\RepositoryInterface TYPO3\CMS\Core\SingletonInterface ExtbaseTeam\BlogExample\Domain\Repository\BlogRepository ExtbaseTeam\BlogExample\Domain\Repository\PersonRepository ExtbaseTeam\BlogExample\Domain\Repository\PostRepository ExtbaseTeam\BlogExample\Domain\Repository\TtContentRepository OliverHader\IrreTutorial\Domain\Repository\ContentRepository TYPO3\CMS\About\Domain\Repository\ExtensionRepository TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository TYPO3\CMS\Belog\Domain\Repository\WorkspaceRepository TYPO3\CMS\Beuser\Domain\Repository\BackendUserGroupRepository TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository TYPO3\CMS\Extbase\Domain\Repository\BackendUserRepository TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository TYPO3\CMS\Extbase\Domain\Repository\FileMountRepository TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository

Public Member Functions

 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 Member Functions

 getRepositoryClassName ()
 

Protected Attributes

 $persistenceManager
 
 $objectManager
 
 $objectType
 
 $defaultOrderings = []
 
 $defaultQuerySettings = null
 

Detailed Description

The base repository - will usually be extended by a more concrete repository.

Definition at line 24 of file Repository.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Persistence\Repository::__construct ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)

Member Function Documentation

◆ __call()

TYPO3\CMS\Extbase\Persistence\Repository::__call (   $methodName,
  $arguments 
)

Dispatches magic methods (findBy[Property]())

Parameters
string$methodNameThe name of the magic method
string$argumentsThe arguments of the magic method
Exceptions

Definition at line 235 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\createQuery().

◆ add()

TYPO3\CMS\Extbase\Persistence\Repository::add (   $object)

Adds an object to this repository

Parameters
object$objectThe object to add
Exceptions
Exception

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 78 of file Repository.php.

◆ countAll()

TYPO3\CMS\Extbase\Persistence\Repository::countAll ( )

Returns the total number objects of this repository.

Returns
int The object count

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 136 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\createQuery().

◆ createQuery()

TYPO3\CMS\Extbase\Persistence\Repository::createQuery ( )

Returns a query for objects of this repository

Returns

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 214 of file Repository.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Repository\__call(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\countAll(), TYPO3\CMS\Extbase\Persistence\Repository\countAll(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findAll(), TYPO3\CMS\Extbase\Persistence\Repository\findAll(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findAllByBlog(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findAllCommunityDistributions(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findAllOfficialDistributions(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findByCategory(), TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository\findByConstraint(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findByExtensionKeyOrderedByVersion(), TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository\findByPidsAndAuthor(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findByTagAndBlog(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findByVersionRangeAndExtensionKeyOrderedByVersion(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findHighestAvailableVersion(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findNext(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findOneByCurrentVersionByExtensionKey(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findOneByExtensionKeyAndVersion(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findPrevious(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findRecentByBlog(), and ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findRemaining().

◆ findAll()

TYPO3\CMS\Extbase\Persistence\Repository::findAll ( )

◆ findByIdentifier()

TYPO3\CMS\Extbase\Persistence\Repository::findByIdentifier (   $identifier)

Finds an object matching the given identifier.

Parameters
mixed$identifierThe identifier of the object to find
Returns
object The matching object if found, otherwise NULL

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 174 of file Repository.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Repository\findByUid().

◆ findByUid()

TYPO3\CMS\Extbase\Persistence\Repository::findByUid (   $uid)

Finds an object matching the given identifier.

Parameters
int$uidThe identifier of the object to find
Returns
object The matching object if found, otherwise NULL

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 162 of file Repository.php.

References $uid, and TYPO3\CMS\Extbase\Persistence\Repository\findByIdentifier().

Referenced by TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository\updateRepositoryCount().

◆ getRepositoryClassName()

TYPO3\CMS\Extbase\Persistence\Repository::getRepositoryClassName ( )
protected

Returns the class name of this class.

Returns
string Class name of the repository.

Definition at line 266 of file Repository.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Repository\__construct().

◆ injectPersistenceManager()

TYPO3\CMS\Extbase\Persistence\Repository::injectPersistenceManager ( \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface  $persistenceManager)
Parameters
\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface$persistenceManager

Definition at line 54 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\$persistenceManager.

◆ remove()

TYPO3\CMS\Extbase\Persistence\Repository::remove (   $object)

Removes an object from this repository.

Parameters
object$objectThe object to remove
Exceptions
Exception

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 94 of file Repository.php.

◆ removeAll()

TYPO3\CMS\Extbase\Persistence\Repository::removeAll ( )

Removes all objects of this repository as if remove() was called for all of them.

Returns
void

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 148 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\findAll().

◆ setDefaultOrderings()

TYPO3\CMS\Extbase\Persistence\Repository::setDefaultOrderings ( array  $defaultOrderings)

Sets the property names to order the result by per default. Expected like this: array( 'foo' => ::ORDER_ASCENDING, 'bar' => ::ORDER_DESCENDING )

Parameters
array$defaultOrderingsThe property names to order by
Returns
void

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 191 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\$defaultOrderings.

◆ setDefaultQuerySettings()

TYPO3\CMS\Extbase\Persistence\Repository::setDefaultQuerySettings ( \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface  $defaultQuerySettings)

Sets the default query settings to be used in this repository

Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface$defaultQuerySettingsThe query settings to be used by default
Returns
void

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 203 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\$defaultQuerySettings.

Referenced by TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository\initializeObject(), and TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\injectDataMapper().

◆ update()

TYPO3\CMS\Extbase\Persistence\Repository::update (   $modifiedObject)

Replaces an existing object with the same identifier by the given object

Parameters
object$modifiedObjectThe modified object
Exceptions
Exception

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 111 of file Repository.php.

Referenced by TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository\updateRepositoryCount().

Member Data Documentation

◆ $defaultOrderings

TYPO3\CMS\Extbase\Persistence\Repository::$defaultOrderings = []
protected

◆ $defaultQuerySettings

TYPO3\CMS\Extbase\Persistence\Repository::$defaultQuerySettings = null
protected

◆ $objectManager

TYPO3\CMS\Extbase\Persistence\Repository::$objectManager
protected

Definition at line 34 of file Repository.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Repository\__construct().

◆ $objectType

TYPO3\CMS\Extbase\Persistence\Repository::$objectType
protected

Definition at line 39 of file Repository.php.

◆ $persistenceManager

TYPO3\CMS\Extbase\Persistence\Repository::$persistenceManager
protected