‪TYPO3CMS  9.5
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\A\Domain\Model\ARepository ExtbaseTeam\B\Domain\Model\BRepository 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\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\Extbase\Tests\Unit\Persistence\Fixture\Domain\Repository\EntityRepository TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyModelRepository TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository

Public Member Functions

 injectPersistenceManager (\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager)
 
 __construct (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 add ($object)
 
 remove ($object)
 
 update ($modifiedObject)
 
QueryResultInterface array findAll ()
 
int countAll ()
 
 removeAll ()
 
object findByUid ($uid)
 
object findByIdentifier ($identifier)
 
 setDefaultOrderings (array $defaultOrderings)
 
 setDefaultQuerySettings (\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $defaultQuerySettings)
 
TYPO3 CMS Extbase Persistence QueryInterface createQuery ()
 
mixed __call ($methodName, $arguments)
 

Protected Member Functions

string getRepositoryClassName ()
 

Protected Attributes

TYPO3 CMS Extbase Persistence PersistenceManagerInterface $persistenceManager
 
TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
string $objectType
 
array $defaultOrderings = array( )
 
TYPO3 CMS Extbase Persistence Generic QuerySettingsInterface $defaultQuerySettings
 

Detailed Description

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

Definition at line 22 of file Repository.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ __call()

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

Dispatches magic methods (findBy[Property]())

Parameters
string$methodName‪The name of the magic method
string$arguments‪The arguments of the magic method
Exceptions

Definition at line 209 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$object‪The object to add
Exceptions
Exception

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 69 of file Repository.php.

◆ countAll()

int 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.

Reimplemented in TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository.

Definition at line 121 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\Repository\createQuery(), and TYPO3\CMS\Extbase\Persistence\QueryInterface\execute().

◆ createQuery()

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

Returns a query for objects of this repository

Returns
‪\TYPO3\CMS\Extbase\Persistence\QueryInterface

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Reimplemented in TYPO3\CMS\Beuser\Domain\Repository\BackendUserRepository, and TYPO3\CMS\Beuser\Domain\Repository\BackendUserGroupRepository.

Definition at line 189 of file Repository.php.

References TYPO3\CMS\Extbase\Persistence\QueryInterface\setOrderings(), and TYPO3\CMS\Extbase\Persistence\QueryInterface\setQuerySettings().

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\findAllSortedByCategory(), ExtbaseTeam\BlogExample\Domain\Repository\PostRepository\findByCategory(), TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository\findByConstraint(), TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository\findByExtensionKeyOrderedByVersion(), 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()

◆ findByIdentifier()

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

Finds an object matching the given identifier.

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

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 154 of file Repository.php.

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

◆ findByUid()

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

Finds an object matching the given identifier.

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

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 143 of file Repository.php.

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

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

◆ getRepositoryClassName()

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

Returns the class name of this class.

Returns
‪string Class name of the repository.

Definition at line 242 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 47 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$object‪The object to remove
Exceptions
Exception

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 83 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.

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 130 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' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING )

Parameters
array$defaultOrderings‪The property names to order by

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 169 of file Repository.php.

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

◆ setDefaultQuerySettings()

◆ update()

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

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

Parameters
object$modifiedObject‪The modified object
Exceptions
Exception

Implements TYPO3\CMS\Extbase\Persistence\RepositoryInterface.

Definition at line 98 of file Repository.php.

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

Member Data Documentation

◆ $defaultOrderings

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

◆ $defaultQuerySettings

◆ $objectManager

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

Definition at line 30 of file Repository.php.

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

◆ $objectType

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

Definition at line 34 of file Repository.php.

◆ $persistenceManager

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