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

Public Member Functions

 injectDataMapper (\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper)
 
 countAll ()
 
 findAll ()
 
 findByExtensionKeyOrderedByVersion ($extensionKey)
 
 findOneByCurrentVersionByExtensionKey ($extensionKey)
 
 findOneByExtensionKeyAndVersion ($extensionKey, $version)
 
 findByTitleOrAuthorNameOrExtensionKey ($searchString)
 
 findByVersionRangeAndExtensionKeyOrderedByVersion ($extensionKey, $lowestVersion=0, $highestVersion=0, $includeCurrentVersion=true)
 
 findAllCommunityDistributions ()
 
 findAllOfficialDistributions ()
 
 countByVersionRangeAndExtensionKey ($extensionKey, $lowestVersion=0, $highestVersion=0)
 
 findHighestAvailableVersion ($extensionKey)
 
 insertLastVersion ($repositoryUid=1)
 
- 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)
 

Public Attributes

const TABLE_NAME = 'tx_extensionmanager_domain_model_extension'
 

Protected Member Functions

 markExtensionWithMaximumVersionAsCurrent ($repositoryUid)
 
 fetchMaximalVersionsForAllExtensions ($repositoryUid)
 
 getNumberOfCurrentExtensions ()
 
 addDefaultConstraints (\TYPO3\CMS\Extbase\Persistence\Generic\Query $query)
 
- Protected Member Functions inherited from Repository
 getRepositoryClassName ()
 

Protected Attributes

 $dataMapper
 
- Protected Attributes inherited from Repository
 $persistenceManager
 
 $objectManager
 
 $objectType
 
 $defaultOrderings = []
 
 $defaultQuerySettings = null
 

Detailed Description

A repository for extensions

Definition at line 24 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

Member Function Documentation

addDefaultConstraints ( \TYPO3\CMS\Extbase\Persistence\Generic\Query  $query)
protected

Adds default constraints to the query - in this case it enables us to always just search for the latest version of an extension

Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\Query$querythe query to adjust
Returns

Definition at line 432 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

Referenced by ExtensionRepository\countAll(), and ExtensionRepository\findAll().

countAll ( )
countByVersionRangeAndExtensionKey (   $extensionKey,
  $lowestVersion = 0,
  $highestVersion = 0 
)

Count extensions with a certain key between a given version range

Parameters
string$extensionKey
int$lowestVersion
int$highestVersion
Returns
int

Definition at line 300 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References ExtensionRepository\findByVersionRangeAndExtensionKeyOrderedByVersion().

fetchMaximalVersionsForAllExtensions (   $repositoryUid)
protected

Fetches the UIDs of all maximal versions for all extensions. This is done by doing a LEFT JOIN to itself ("a" and "b") and comparing both integer_version fields.

Parameters
int$repositoryUid
Returns
array

Definition at line 368 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References GeneralUtility\makeInstance().

Referenced by ExtensionRepository\markExtensionWithMaximumVersionAsCurrent().

findAll ( )

Finds all extensions

Returns
array|

Returns all objects of this repository

Returns
array The extensions

Implements RepositoryInterface.

Definition at line 74 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References ExtensionRepository\addDefaultConstraints(), and Repository\createQuery().

findAllCommunityDistributions ( )

Finds all extensions with category "distribution" not published by the TYPO3 CMS Team

Returns

Definition at line 251 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

findAllOfficialDistributions ( )

Finds all extensions with category "distribution" that are published by the TYPO3 CMS Team

Returns

Definition at line 274 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

findByExtensionKeyOrderedByVersion (   $extensionKey)

Find an extension by extension key ordered by version

Parameters
string$extensionKey
Returns

Definition at line 92 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

findByTitleOrAuthorNameOrExtensionKey (   $searchString)

Find an extension by title, author name or extension key This is the function used by the TER search. It is using a scoring for the matches to sort the extension with an exact key match on top

Parameters
string$searchStringThe string to search for extensions
Returns
mixed

Definition at line 148 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References GeneralUtility\makeInstance().

findByVersionRangeAndExtensionKeyOrderedByVersion (   $extensionKey,
  $lowestVersion = 0,
  $highestVersion = 0,
  $includeCurrentVersion = true 
)

Find an extension between a certain version range ordered by version number

Parameters
string$extensionKey
int$lowestVersion
int$highestVersion
bool$includeCurrentVersion
Returns

Definition at line 212 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

Referenced by ExtensionRepository\countByVersionRangeAndExtensionKey().

findHighestAvailableVersion (   $extensionKey)

Find highest version available of an extension

Parameters
string$extensionKey
Returns

Definition at line 311 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

findOneByCurrentVersionByExtensionKey (   $extensionKey)

Find the current version by extension key

Parameters
string$extensionKey
Returns
array|

Definition at line 106 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

findOneByExtensionKeyAndVersion (   $extensionKey,
  $version 
)

Find one extension by extension key and version

Parameters
string$extensionKey
string$version(example: 4.3.10)
Returns
array|

Definition at line 127 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References Repository\createQuery().

getNumberOfCurrentExtensions ( )
protected

Returns the number of extensions that are current.

Returns
int

Definition at line 409 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References GeneralUtility\makeInstance().

Referenced by ExtensionRepository\insertLastVersion().

injectDataMapper ( \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper  $dataMapper)
Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper$dataMapper

Definition at line 39 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References ExtensionRepository\$dataMapper.

insertLastVersion (   $repositoryUid = 1)

Updates the current_version field after update.

Parameters
int$repositoryUid
Returns
int

Definition at line 327 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References ExtensionRepository\getNumberOfCurrentExtensions(), and ExtensionRepository\markExtensionWithMaximumVersionAsCurrent().

markExtensionWithMaximumVersionAsCurrent (   $repositoryUid)
protected

Sets current_version = 1 for all extensions where the extension version is maximal.

For performance reasons, the "native" database connection is used here directly.

Parameters
int$repositoryUid
Returns
void

Definition at line 342 of file extensionmanager/Classes/Domain/Repository/ExtensionRepository.php.

References ExtensionRepository\fetchMaximalVersionsForAllExtensions(), and GeneralUtility\makeInstance().

Referenced by ExtensionRepository\insertLastVersion().

Member Data Documentation

const TABLE_NAME = 'tx_extensionmanager_domain_model_extension'