ExtensionRepository extends Repository

A repository for extensions

Internal

This class is a specific domain repository implementation and is not part of the Public TYPO3 API.

Table of Contents

Constants

TABLE_NAME  = 'tx_extensionmanager_domain_model_extension'

Properties

$defaultOrderings  : array<non-empty-string, QueryInterface::ORDER_*>
$defaultQuerySettings  : QuerySettingsInterface
Override query settings created by extbase natively.
$objectManager  : ObjectManagerInterface
$objectType  : class-string
$persistenceManager  : PersistenceManagerInterface
$querySettings  : QuerySettingsInterface|null

Methods

__call()  : mixed
Dispatches magic methods (findBy[Property]())
__construct()  : mixed
Constructs a new Repository
add()  : mixed
Adds an object to this repository
countAll()  : int
Count all extensions
countByVersionRangeAndExtensionKey()  : int
Count extensions with a certain key between a given version range
createQuery()  : QueryInterface
Returns a query for objects of this repository
findAll()  : array<string|int, mixed>|QueryResultInterface
Finds all extensions
findAllCommunityDistributions()  : array<string|int, Extension>
Finds all extensions with category "distribution" not published by the TYPO3 CMS Team
findAllOfficialDistributions()  : array<string|int, Extension>
Finds all extensions with category "distribution" that are published by the TYPO3 CMS Team
findByExtensionKeyOrderedByVersion()  : QueryResultInterface
Find an extension by extension key ordered by version
findByIdentifier()  : object|null
Finds an object matching the given identifier.
findByTitleOrAuthorNameOrExtensionKey()  : mixed
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
findByUid()  : object|null
Finds an object matching the given identifier.
findByVersionRangeAndExtensionKeyOrderedByVersion()  : QueryResultInterface
Find an extension between a certain version range ordered by version number
findHighestAvailableVersion()  : object|null
Find highest version available of an extension
findOneByCurrentVersionByExtensionKey()  : object|null
Find the current version by extension key
findOneByExtensionKeyAndVersion()  : object|null
Find one extension by extension key and version
initializeObject()  : mixed
Do not include pid in queries
injectPersistenceManager()  : mixed
injectQuerySettings()  : mixed
remove()  : mixed
Removes an object from this repository.
removeAll()  : mixed
Removes all objects of this repository as if remove() was called for all of them.
setDefaultOrderings()  : mixed
Sets the property names to order the result by per default.
setDefaultQuerySettings()  : mixed
Sets the default query settings to be used in this repository.
update()  : mixed
Replaces an existing object with the same identifier by the given object
addDefaultConstraints()  : QueryInterface
Adds default constraints to the query - in this case it enables us to always just search for the latest version of an extension
filterYoungestVersionOfExtensionList()  : array<string|int, Extension>
Get a list of various extensions in various versions and returns a filtered list containing the extension-version combination with the highest version number.
getExtensionsSuitableForTypo3Version()  : array<string|int, Extension>
Get extensions (out of a given list) that are suitable for the current TYPO3 version
getRepositoryClassName()  : mixed
Returns the class name of this class.

Constants

TABLE_NAME

public string TABLE_NAME = 'tx_extensionmanager_domain_model_extension'

Properties

$defaultOrderings

protected array<non-empty-string, QueryInterface::ORDER_*> $defaultOrderings = []

$defaultQuerySettings

Override query settings created by extbase natively.

protected QuerySettingsInterface $defaultQuerySettings

Be careful if using this, see the comment on setDefaultQuerySettings() for more insights.

$objectType

protected class-string $objectType

Methods

__call()

Dispatches magic methods (findBy[Property]())

public __call(non-empty-string $methodName, array<int, mixed> $arguments) : mixed
Parameters
$methodName : non-empty-string

The name of the magic method

$arguments : array<int, mixed>

The arguments of the magic method

Tags
throws
UnsupportedMethodException

countAll()

Count all extensions

public countAll() : int
Return values
int

countByVersionRangeAndExtensionKey()

Count extensions with a certain key between a given version range

public countByVersionRangeAndExtensionKey(string $extensionKey[, int $lowestVersion = 0 ][, int $highestVersion = 0 ]) : int
Parameters
$extensionKey : string
$lowestVersion : int = 0
$highestVersion : int = 0
Return values
int

findAllCommunityDistributions()

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

public findAllCommunityDistributions([bool $showUnsuitableDistributions = false ]) : array<string|int, Extension>
Parameters
$showUnsuitableDistributions : bool = false
Return values
array<string|int, Extension>

findAllOfficialDistributions()

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

public findAllOfficialDistributions([bool $showUnsuitableDistributions = false ]) : array<string|int, Extension>
Parameters
$showUnsuitableDistributions : bool = false
Return values
array<string|int, Extension>

findByExtensionKeyOrderedByVersion()

Find an extension by extension key ordered by version

public findByExtensionKeyOrderedByVersion(string $extensionKey) : QueryResultInterface
Parameters
$extensionKey : string
Return values
QueryResultInterface

findByIdentifier()

Finds an object matching the given identifier.

public findByIdentifier(mixed $identifier) : object|null
Parameters
$identifier : mixed

The identifier of the object to find

Return values
object|null

The matching object if found, otherwise NULL

findByTitleOrAuthorNameOrExtensionKey()

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

public findByTitleOrAuthorNameOrExtensionKey(string $searchString) : mixed
Parameters
$searchString : string

The string to search for extensions

findByUid()

Finds an object matching the given identifier.

public findByUid(int $uid) : object|null
Parameters
$uid : int

The identifier of the object to find

Return values
object|null

The matching object if found, otherwise NULL

findByVersionRangeAndExtensionKeyOrderedByVersion()

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

public findByVersionRangeAndExtensionKeyOrderedByVersion(string $extensionKey[, int $lowestVersion = 0 ][, int $highestVersion = 0 ][, bool $includeCurrentVersion = true ]) : QueryResultInterface
Parameters
$extensionKey : string
$lowestVersion : int = 0
$highestVersion : int = 0
$includeCurrentVersion : bool = true
Return values
QueryResultInterface

findHighestAvailableVersion()

Find highest version available of an extension

public findHighestAvailableVersion(string $extensionKey) : object|null
Parameters
$extensionKey : string
Return values
object|null

findOneByCurrentVersionByExtensionKey()

Find the current version by extension key

public findOneByCurrentVersionByExtensionKey(string $extensionKey) : object|null
Parameters
$extensionKey : string
Return values
object|null

findOneByExtensionKeyAndVersion()

Find one extension by extension key and version

public findOneByExtensionKeyAndVersion(string $extensionKey, string $version) : object|null
Parameters
$extensionKey : string
$version : string

(example: 4.3.10)

Return values
object|null

initializeObject()

Do not include pid in queries

public initializeObject() : mixed

remove()

Removes an object from this repository.

public remove(object $object) : mixed
Parameters
$object : object

The object to remove

Tags
throws
IllegalObjectTypeException

removeAll()

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

public removeAll() : mixed

setDefaultOrderings()

Sets the property names to order the result by per default.

public setDefaultOrderings(array<non-empty-string, QueryInterface::ORDER_*$defaultOrderings) : mixed

Expected like this: array( 'foo' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING )

Parameters
$defaultOrderings : array<non-empty-string, QueryInterface::ORDER_*>

The property names to order by

setDefaultQuerySettings()

Sets the default query settings to be used in this repository.

public setDefaultQuerySettings(QuerySettingsInterface $defaultQuerySettings) : mixed

A typical use case is an initializeObject() method that creates a QuerySettingsInterface object, configures it and sets it to be used for all queries created by the repository.

Warning: Using this setter fully overrides native query settings created by QueryFactory->create(). This especially means that storagePid settings from configuration are not applied anymore, if not explicitly set. Make sure to apply these to your own QuerySettingsInterface object if needed, when using this method.

Parameters
$defaultQuerySettings : QuerySettingsInterface

The query settings to be used by default

filterYoungestVersionOfExtensionList()

Get a list of various extensions in various versions and returns a filtered list containing the extension-version combination with the highest version number.

protected filterYoungestVersionOfExtensionList(array<string|int, Extension$extensions, bool $showUnsuitable) : array<string|int, Extension>
Parameters
$extensions : array<string|int, Extension>
$showUnsuitable : bool
Return values
array<string|int, Extension>

getExtensionsSuitableForTypo3Version()

Get extensions (out of a given list) that are suitable for the current TYPO3 version

protected getExtensionsSuitableForTypo3Version(array<string|int, Extension$extensions) : array<string|int, Extension>
Parameters
$extensions : array<string|int, Extension>

List of extensions to check

Return values
array<string|int, Extension>

List of extensions suitable for current TYPO3 version

getRepositoryClassName()

Returns the class name of this class.

protected getRepositoryClassName() : mixed

        
On this page

Search results