TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
Repository Class Reference
Inheritance diagram for Repository:
RepositoryInterface SingletonInterface BlogRepository PersonRepository PostRepository ContentRepository ExtensionRepository HistoryEntryRepository LogEntryRepository WorkspaceRepository BackendUserGroupRepository BackendUserSessionRepository BackendUserGroupRepository BackendUserRepository CategoryRepository FileMountRepository FrontendUserGroupRepository FrontendUserRepository ExtensionRepository RepositoryRepository 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 extbase/Classes/Persistence/Repository.php.

Constructor & Destructor Documentation

__construct ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)

Constructs a new Repository

Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager

Definition at line 64 of file extbase/Classes/Persistence/Repository.php.

References Repository\$objectManager, Repository\getRepositoryClassName(), and ClassNamingUtility\translateRepositoryNameToModelName().

Member Function Documentation

__call (   $methodName,
  $arguments 
)

Dispatches magic methods (findBy[Property]())

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

Definition at line 235 of file extbase/Classes/Persistence/Repository.php.

References Repository\createQuery().

add (   $object)

Adds an object to this repository

Parameters
object$objectThe object to add
Exceptions
ExceptionIllegalObjectTypeException
Returns
void

Implements RepositoryInterface.

Definition at line 78 of file extbase/Classes/Persistence/Repository.php.

countAll ( )

Returns the total number objects of this repository.

Returns
int The object count

Implements RepositoryInterface.

Definition at line 136 of file extbase/Classes/Persistence/Repository.php.

References Repository\createQuery().

findAll ( )

Returns all objects of this repository.

Returns
QueryResultInterface|array

Implements RepositoryInterface.

Definition at line 125 of file extbase/Classes/Persistence/Repository.php.

References Repository\createQuery().

Referenced by Repository\removeAll().

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

Definition at line 174 of file extbase/Classes/Persistence/Repository.php.

Referenced by Repository\findByUid().

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

Definition at line 162 of file extbase/Classes/Persistence/Repository.php.

References Repository\findByIdentifier().

Referenced by RepositoryRepository\updateRepositoryCount().

getRepositoryClassName ( )
protected

Returns the class name of this class.

Returns
string Class name of the repository.

Definition at line 266 of file extbase/Classes/Persistence/Repository.php.

Referenced by Repository\__construct().

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

Definition at line 54 of file extbase/Classes/Persistence/Repository.php.

References Repository\$persistenceManager.

remove (   $object)

Removes an object from this repository.

Parameters
object$objectThe object to remove
Exceptions
ExceptionIllegalObjectTypeException
Returns
void

Implements RepositoryInterface.

Definition at line 94 of file extbase/Classes/Persistence/Repository.php.

removeAll ( )

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

Returns
void

Implements RepositoryInterface.

Definition at line 148 of file extbase/Classes/Persistence/Repository.php.

References Repository\findAll().

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

Definition at line 191 of file extbase/Classes/Persistence/Repository.php.

References Repository\$defaultOrderings.

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

Definition at line 203 of file extbase/Classes/Persistence/Repository.php.

References Repository\$defaultQuerySettings.

Referenced by SysNoteRepository\initializeObject().

update (   $modifiedObject)

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

Parameters
object$modifiedObjectThe modified object
Exceptions
ExceptionUnknownObjectException
ExceptionIllegalObjectTypeException
Returns
void

Implements RepositoryInterface.

Definition at line 111 of file extbase/Classes/Persistence/Repository.php.

Referenced by RepositoryRepository\updateRepositoryCount().

Member Data Documentation

$defaultOrderings = []
protected
$defaultQuerySettings = null
protected
$objectManager
protected

Definition at line 34 of file extbase/Classes/Persistence/Repository.php.

Referenced by Repository\__construct().

$objectType
protected

Definition at line 39 of file extbase/Classes/Persistence/Repository.php.

$persistenceManager
protected