PHP Class Pimcore\Model\Element\Service

Inheritance: extends Pimcore\Model\AbstractModel
Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Méthodes publiques

Méthode Description
addTreeFilterJoins ( $cv, $childsList ) Changes the query according to the custom view config
cleanupBrokenViews ( ) clean up broken views which were generated by localized fields, .
correctPath ( string $path ) : string
createFolderByPath ( $path, array $options = [] ) : Folder | Folder | Folder
findForbiddenPaths ( string $type, $user ) : array find all elements which the user may not list and therefore may never be shown to the user
fixAllowedTypes ( $data, $type )
getCustomViewById ( $id )
getDependedElement ( array $config ) : AbstractObject | Document | Asset
getDependencyForFrontend ( Document | Asset | AbstractObject $element ) : array
getElementById ( string $type, integer $id ) : Pimcore\Model\Element\ElementInterface
getElementByPath ( string $type, string $path ) : Pimcore\Model\Element\ElementInterface
getElementType ( Pimcore\Model\Element\ElementInterface $element ) : string
getFilename ( Pimcore\Model\Element\ElementInterface $element ) : string
getIdList ( $list, $idGetter = 'getId' ) : array
getIdPath ( $element ) : string
getRequiredByDependenciesForFrontend ( Dependency $d ) : array
getRequiresDependenciesForFrontend ( Dependency $d ) : array
getSafeVersionInfo ( $versions )
getSaveCopyName ( string $type, string $sourceKey, Pimcore\Model\Element\ElementInterface $target ) : Pimcore\Model\Element\ElementInterface | string Returns a uniqe key for the element in the $target-Path (recursive)
getType ( Pimcore\Model\Element\ElementInterface $element ) : string determines the type of an element (object,asset,document)
getTypePath ( $element ) : string
getUniqueKey ( $element ) : string returns a unique key for an element
getValidKey ( $key, null $type ) : mixed | string
gridElementData ( Pimcore\Model\Element\ElementInterface $element ) : array
isPublished ( Pimcore\Model\Element\ElementInterface $element = null ) : boolean determines whether an element is published
isValidKey ( $key, $type ) : boolean
loadAllFields ( Pimcore\Model\Element\ElementInterface $element ) : Pimcore\Model\Element\ElementInterface
minimizePropertiesForEditmode ( $props ) : array
pathExists ( $path, $type = null ) : boolean
renewReferences ( Document | Asset | AbstractObject $data, $initial = true ) : mixed renews all references, for example after unserializing an ElementInterface
runSanityCheck ( )
scheduleForSanityCheck ( Pimcore\Model\Element\ElementInterface $element ) : void Schedules element with this id for sanity check to be cleaned of broken relations

Méthodes protégées

Méthode Description
performSanityCheck ( Pimcore\Model\Element\ElementInterface $element ) : void
updateChilds ( Pimcore\Model\Element\ElementInterface $target, Pimcore\Model\Element\ElementInterface $new ) : void

Private Methods

Méthode Description
filterNullValues ( $var ) : boolean Callback for array_filter function.

Method Details

addTreeFilterJoins() public static méthode

Changes the query according to the custom view config
public static addTreeFilterJoins ( $cv, $childsList )
$cv array
$childsList

cleanupBrokenViews() public méthode

... when removing a language the view isn't valid anymore
public cleanupBrokenViews ( )

correctPath() public static méthode

public static correctPath ( string $path ) : string
$path string
Résultat string

createFolderByPath() public static méthode

public static createFolderByPath ( $path, array $options = [] ) : Folder | Folder | Folder
$path
$options array
Résultat Pimcore\Model\Asset\Folder | Pimcore\Model\Document\Folder | Pimcore\Model\Object\Folder

findForbiddenPaths() public static méthode

find all elements which the user may not list and therefore may never be shown to the user
public static findForbiddenPaths ( string $type, $user ) : array
$type string asset|object|document
Résultat array

fixAllowedTypes() public static méthode

public static fixAllowedTypes ( $data, $type )

getCustomViewById() public static méthode

public static getCustomViewById ( $id )

getDependedElement() public static méthode

public static getDependedElement ( array $config ) : AbstractObject | Document | Asset
$config array
Résultat Pimcore\Model\Object\AbstractObject | Pimcore\Model\Document | Pimcore\Model\Asset

getDependencyForFrontend() public static méthode

public static getDependencyForFrontend ( Document | Asset | AbstractObject $element ) : array
$element Pimcore\Model\Document | Pimcore\Model\Asset | Pimcore\Model\Object\AbstractObject
Résultat array

getElementById() public static méthode

public static getElementById ( string $type, integer $id ) : Pimcore\Model\Element\ElementInterface
$type string
$id integer
Résultat Pimcore\Model\Element\ElementInterface

getElementByPath() public static méthode

public static getElementByPath ( string $type, string $path ) : Pimcore\Model\Element\ElementInterface
$type string
$path string
Résultat Pimcore\Model\Element\ElementInterface

getElementType() public static méthode

public static getElementType ( Pimcore\Model\Element\ElementInterface $element ) : string
$element Pimcore\Model\Element\ElementInterface $element
Résultat string

getFilename() public static méthode

public static getFilename ( Pimcore\Model\Element\ElementInterface $element ) : string
$element Pimcore\Model\Element\ElementInterface
Résultat string

getIdList() public static méthode

public static getIdList ( $list, $idGetter = 'getId' ) : array
$list array | \Pimcore\Model\Listing\AbstractListing
Résultat array

getIdPath() public static méthode

public static getIdPath ( $element ) : string
$element
Résultat string

getRequiredByDependenciesForFrontend() public static méthode

public static getRequiredByDependenciesForFrontend ( Dependency $d ) : array
$d Pimcore\Model\Dependency
Résultat array

getRequiresDependenciesForFrontend() public static méthode

public static getRequiresDependenciesForFrontend ( Dependency $d ) : array
$d Pimcore\Model\Dependency
Résultat array

getSafeVersionInfo() public static méthode

public static getSafeVersionInfo ( $versions )

getSaveCopyName() public static méthode

Returns a uniqe key for the element in the $target-Path (recursive)
public static getSaveCopyName ( string $type, string $sourceKey, Pimcore\Model\Element\ElementInterface $target ) : Pimcore\Model\Element\ElementInterface | string
$type string
$sourceKey string
$target Pimcore\Model\Element\ElementInterface
Résultat Pimcore\Model\Element\ElementInterface | string

getType() public static méthode

determines the type of an element (object,asset,document)
public static getType ( Pimcore\Model\Element\ElementInterface $element ) : string
$element Pimcore\Model\Element\ElementInterface
Résultat string

getTypePath() public static méthode

public static getTypePath ( $element ) : string
$element
Résultat string

getUniqueKey() public static méthode

returns a unique key for an element
public static getUniqueKey ( $element ) : string
$element
Résultat string

getValidKey() public static méthode

public static getValidKey ( $key, null $type ) : mixed | string
$key
$type null
Résultat mixed | string

gridElementData() public static méthode

public static gridElementData ( Pimcore\Model\Element\ElementInterface $element ) : array
$element Pimcore\Model\Element\ElementInterface
Résultat array

isPublished() public static méthode

determines whether an element is published
public static isPublished ( Pimcore\Model\Element\ElementInterface $element = null ) : boolean
$element Pimcore\Model\Element\ElementInterface
Résultat boolean

isValidKey() public static méthode

public static isValidKey ( $key, $type ) : boolean
$key
$type
Résultat boolean

loadAllFields() public static méthode

public static loadAllFields ( Pimcore\Model\Element\ElementInterface $element ) : Pimcore\Model\Element\ElementInterface
$element Pimcore\Model\Element\ElementInterface
Résultat Pimcore\Model\Element\ElementInterface

minimizePropertiesForEditmode() public static méthode

public static minimizePropertiesForEditmode ( $props ) : array
$props
Résultat array

pathExists() public static méthode

public static pathExists ( $path, $type = null ) : boolean
$path
$type
Résultat boolean

performSanityCheck() protected static méthode

protected static performSanityCheck ( Pimcore\Model\Element\ElementInterface $element ) : void
$element Pimcore\Model\Element\ElementInterface
Résultat void

renewReferences() public static méthode

renews all references, for example after unserializing an ElementInterface
public static renewReferences ( Document | Asset | AbstractObject $data, $initial = true ) : mixed
$data Pimcore\Model\Document | Pimcore\Model\Asset | Pimcore\Model\Object\AbstractObject
Résultat mixed

runSanityCheck() public static méthode

public static runSanityCheck ( )

scheduleForSanityCheck() public static méthode

Schedules element with this id for sanity check to be cleaned of broken relations
public static scheduleForSanityCheck ( Pimcore\Model\Element\ElementInterface $element ) : void
$element Pimcore\Model\Element\ElementInterface
Résultat void

updateChilds() protected méthode

protected updateChilds ( Pimcore\Model\Element\ElementInterface $target, Pimcore\Model\Element\ElementInterface $new ) : void
$target Pimcore\Model\Element\ElementInterface the parent element
$new Pimcore\Model\Element\ElementInterface the newly inserted child
Résultat void