PHP Class Sulu\Bundle\ResourceBundle\Resource\FilterManager

Inheritance: implements Sulu\Bundle\ResourceBundle\Resource\FilterManagerInterface, use trait Sulu\Component\Persistence\RelationTrait
Afficher le fichier Open project: sulu/sulu

Protected Properties

Свойство Type Description
$conditionEntityName
$conditionGroupEntityName
$conditionRepository Sulu\Bundle\ResourceBundle\Entity\ConditionRepositoryInterface
$contextConfiguration array
$em Doctrine\ORM\EntityManagerInterface
$filterEntityName
$filterRepository Sulu\Bundle\ResourceBundle\Entity\FilterRepositoryInterface
$filterTranslationEntityName
$userEntityName
$userRepository Sulu\Component\Security\Authentication\UserRepositoryInterface

Méthodes publiques

Méthode Description
__construct ( Doctrine\ORM\EntityManagerInterface $em, Sulu\Bundle\ResourceBundle\Entity\FilterRepositoryInterface $filterRepo, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository, Sulu\Bundle\ResourceBundle\Entity\ConditionRepositoryInterface $conditionRepository, array $contextConfig )
batchDelete ( array $ids ) Deletes multiple filters at once.
delete ( $id )
findByIdAndLocale ( $id, $locale )
findFiltersForUserAndContext ( string $context, $userId, string $locale ) : Filter[] Finds all filters filtered by context and user and for the given locale.
getFeaturesForContext ( $context ) : array | null Returns the configured features for a context.
getFieldDescriptors ( $locale )
getListFieldDescriptors ( $locale )
hasContext ( $context ) : boolean Checks if the context exists.
isFeatureEnabled ( $context, $feature ) : boolean Checks if a feature is enabled for a context.
save ( array $data, $locale, $userId, $id = null )

Méthodes protégées

Méthode Description
addConditionGroup ( Filter $filter, array $conditionGroupData ) : boolean Adds a condition group to the given filter.
checkData ( array $data, boolean $create ) Checks if the given data is correct.
checkDataSet ( array $data, string $key, boolean $create ) : boolean Checks if data for the given key is set correctly.
getProperty ( array $data, string $key, string $default = null ) : mixed Returns the entry from the data with the given key, or the given default value, if the key does not exist.
getValueForCondition ( $value, $type ) : string Parses the value for a condition - is mainly used for parsing values with type datetime but excludes relative values like "-1 week" or "now".
isValidConditionData ( array $data ) : boolean Checks if the given data is correct for a condition.
removeNonExistentConditions ( ConditionGroup $conditionGroup, array $conditionIds ) Removes conditions from condition groups when they are not in the given array.
updateConditionGroup ( ConditionGroup $conditionGroup, array $matchedEntry ) : boolean Updates the given condition group with the values from the given array.

Method Details

__construct() public méthode

public __construct ( Doctrine\ORM\EntityManagerInterface $em, Sulu\Bundle\ResourceBundle\Entity\FilterRepositoryInterface $filterRepo, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository, Sulu\Bundle\ResourceBundle\Entity\ConditionRepositoryInterface $conditionRepository, array $contextConfig )
$em Doctrine\ORM\EntityManagerInterface
$filterRepo Sulu\Bundle\ResourceBundle\Entity\FilterRepositoryInterface
$userRepository Sulu\Component\Security\Authentication\UserRepositoryInterface
$conditionRepository Sulu\Bundle\ResourceBundle\Entity\ConditionRepositoryInterface
$contextConfig array

addConditionGroup() protected méthode

Adds a condition group to the given filter.
protected addConditionGroup ( Filter $filter, array $conditionGroupData ) : boolean
$filter Sulu\Bundle\ResourceBundle\Api\Filter The filter to add the condition group to
$conditionGroupData array The array containing the data for the additional condition group
Résultat boolean

batchDelete() public méthode

Deletes multiple filters at once.
public batchDelete ( array $ids )
$ids array

checkData() protected méthode

Checks if the given data is correct.
protected checkData ( array $data, boolean $create )
$data array The data to check
$create boolean Defines if check is for new or already existing data

checkDataSet() protected méthode

Checks if data for the given key is set correctly.
protected checkDataSet ( array $data, string $key, boolean $create ) : boolean
$data array The array with the data
$key string The array key to check
$create boolean Defines if the is for new or already existing data
Résultat boolean

delete() public méthode

public delete ( $id )

findByIdAndLocale() public méthode

public findByIdAndLocale ( $id, $locale )

findFiltersForUserAndContext() public méthode

Finds all filters filtered by context and user and for the given locale.
public findFiltersForUserAndContext ( string $context, $userId, string $locale ) : Filter[]
$context string
$userId
$locale string
Résultat Sulu\Bundle\ResourceBundle\Api\Filter[]

getFeaturesForContext() public méthode

Returns the configured features for a context.
public getFeaturesForContext ( $context ) : array | null
$context
Résultat array | null

getFieldDescriptors() public méthode

public getFieldDescriptors ( $locale )

getListFieldDescriptors() public méthode

public getListFieldDescriptors ( $locale )

getProperty() protected méthode

Returns the entry from the data with the given key, or the given default value, if the key does not exist.
protected getProperty ( array $data, string $key, string $default = null ) : mixed
$data array
$key string
$default string
Résultat mixed

getValueForCondition() protected méthode

Parses the value for a condition - is mainly used for parsing values with type datetime but excludes relative values like "-1 week" or "now".
protected getValueForCondition ( $value, $type ) : string
Résultat string

hasContext() public méthode

Checks if the context exists.
public hasContext ( $context ) : boolean
$context
Résultat boolean

isFeatureEnabled() public méthode

Checks if a feature is enabled for a context.
public isFeatureEnabled ( $context, $feature ) : boolean
$context
$feature
Résultat boolean

isValidConditionData() protected méthode

Checks if the given data is correct for a condition.
protected isValidConditionData ( array $data ) : boolean
$data array The data to check
Résultat boolean

removeNonExistentConditions() protected méthode

Removes conditions from condition groups when they are not in the given array.
protected removeNonExistentConditions ( ConditionGroup $conditionGroup, array $conditionIds )
$conditionGroup Sulu\Bundle\ResourceBundle\Entity\ConditionGroup
$conditionIds array

save() public méthode

public save ( array $data, $locale, $userId, $id = null )
$data array

updateConditionGroup() protected méthode

Updates the given condition group with the values from the given array.
protected updateConditionGroup ( ConditionGroup $conditionGroup, array $matchedEntry ) : boolean
$conditionGroup Sulu\Bundle\ResourceBundle\Entity\ConditionGroup
$matchedEntry array
Résultat boolean

Property Details

$conditionEntityName protected_oe static_oe property

protected static $conditionEntityName

$conditionGroupEntityName protected_oe static_oe property

protected static $conditionGroupEntityName

$conditionRepository protected_oe property

protected ConditionRepositoryInterface,Sulu\Bundle\ResourceBundle\Entity $conditionRepository
Résultat Sulu\Bundle\ResourceBundle\Entity\ConditionRepositoryInterface

$contextConfiguration protected_oe property

protected array $contextConfiguration
Résultat array

$em protected_oe property

protected EntityManagerInterface,Doctrine\ORM $em
Résultat Doctrine\ORM\EntityManagerInterface

$filterEntityName protected_oe static_oe property

protected static $filterEntityName

$filterRepository protected_oe property

protected FilterRepositoryInterface,Sulu\Bundle\ResourceBundle\Entity $filterRepository
Résultat Sulu\Bundle\ResourceBundle\Entity\FilterRepositoryInterface

$filterTranslationEntityName protected_oe static_oe property

protected static $filterTranslationEntityName

$userEntityName protected_oe static_oe property

protected static $userEntityName

$userRepository protected_oe property

protected UserRepositoryInterface,Sulu\Component\Security\Authentication $userRepository
Résultat Sulu\Component\Security\Authentication\UserRepositoryInterface