class Service extends Service (View source)

Properties

protected AbstractDao $dao from AbstractModel
protected User $_user
protected array $_copyRecursiveIds
protected Document[] $nearestPathCache

Methods

Dao
getDao()

No description

setDao($dao)

No description

getResource() deprecated

No description

initDao(null $key = null, bool $forceDetection = false)

No description

static string|null
locateDaoClass(string $modelClass)

No description

$this
setValues(array $data = [])

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

mixed
__call($method, $args)

No description

__clone()

No description

array
getObjectVars()

returns object values without the dao

array
__debugInfo()

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

void
configure()

No description

array
getValidTableColumns(string $table, bool $cache)

No description

void
resetValidTableColumnsCache(string $table)

No description

static string
getIdPath($element)

No description

from Service
static string
getTypePath($element)

No description

from Service
static array
getIdList($list, string $idGetter = 'getId')

No description

from Service
static array
from Service
static array
from Service
static array
from Service
getDependedElement(array $config)

No description

from Service
static bool
isPublished(ElementInterface $element = null)

determines whether an element is published

from Service
getElementByPath(string $type, string $path)

No description

from Service
static string
getBaseClassNameForElement(string|ElementInterface $element)

No description

from Service
static ElementInterface|string
getSaveCopyName(string $type, string $sourceKey, ElementInterface $target)

Returns a uniqe key for the element in the $target-Path (recursive)

from Service
static bool
pathExists($path, $type = null)

No description

getElementById(string $type, int $id)

No description

from Service
static string
getElementType(ElementInterface $element)

No description

from Service
static string
getType(ElementInterface $element)

determines the type of an element (object,asset,document)

from Service
static 
scheduleForSanityCheck(ElementInterface $element)

Schedules element with this id for sanity check to be cleaned of broken relations

from Service
static 
runSanityCheck()

No description

from Service
static 
performSanityCheck(ElementInterface $element)

No description

from Service
static array
minimizePropertiesForEditmode($props)

No description

from Service
updateChilds(ElementInterface $target, ElementInterface $new)

No description

from Service
static array
gridElementData(ElementInterface $element)

No description

from Service
static string
getFilename(ElementInterface $element)

No description

from Service
static array
findForbiddenPaths(string $type, $user)

find all elements which the user may not list and therefore may never be shown to the user

from Service
static mixed
renewReferences(Document|Asset|AbstractObject $data, bool $initial = true)

renews all references, for example after unserializing an ElementInterface

from Service
static string
correctPath(string $path)

No description

from Service
loadAllFields(ElementInterface $element)

No description

from Service
cleanupBrokenViews()

clean up broken views which were generated by localized fields, .

from Service
static Folder|Folder|Folder
createFolderByPath($path, array $options = [])

No description

from Service
static 
addTreeFilterJoins($cv, $childsList)

Changes the query according to the custom view config

from Service
static mixed
getCustomViewById($id)

No description

from Service
static mixed|string
getValidKey(string $key, null $type)

No description

from Service
static bool
isValidKey(string $key, string $type)

No description

from Service
static bool
isValidPath(string $path, string $type)

No description

from Service
static string
getUniqueKey($item, int $nr = 0)

No description

static array|string
fixAllowedTypes($data, $type)

No description

from Service
static array
getSafeVersionInfo($versions)

No description

from Service
cloneMe(ElementInterface $element)

No description

from Service
__construct(null $user = null)

No description

matches($object, $property)

{@inheritdoc}

from Service
static string
render(PageSnippet $document, array $attributes = [], bool $useLayout = false, array $query = [], array $options = [])

Renders a document outside of a view with support for legacy documents

static 
saveRecursive($document, int $collectGarbageAfterIteration = 25, int $saved = 0)

Save document and all child documents

copyRecursive(Document $target, Document $source)

No description

copyAsChild($target, $source, bool $enableInheritance = false, bool $resetIndex = false)

No description

mixed
copyContents($target, $source)

No description

static array
gridDocumentData(Document $document)

No description

static mixed
loadAllDocumentFields($doc)

No description

static bool
isValidType($type)

No description

static Document
rewriteIds($document, $rewriteConfig, array $params = [])

Rewrites id from source to target, $rewriteConfig contains array( "document" => array( SOURCE_ID => TARGET_ID, SOURCE_ID => TARGET_ID ), "object" => array(.

static Document
getByUrl($url)

No description

getNearestDocumentByPath(string|Request $path, bool $ignoreHardlinks = false, array $types = [])

Get the nearest document by path. Used to match nearest document for a static route.

array
getTranslations(Document $document)

No description

addTranslation(Document $document, Document $translation, $language = null)

No description

removeTranslation(Document $document)

No description

int
getTranslationSourceId(Document $document)

No description

Details

Dao getDao()

Return Value

Dao

AbstractModel setDao($dao)

Parameters

$dao

Return Value

AbstractModel

AbstractDao getResource() deprecated

deprecated

Return Value

AbstractDao

initDao(null $key = null, bool $forceDetection = false)

Parameters

null $key
bool $forceDetection

Exceptions

Exception

static string|null locateDaoClass(string $modelClass)

Parameters

string $modelClass

Return Value

string|null

$this setValues(array $data = [])

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

array __sleep()

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

__clone()

array getObjectVars()

returns object values without the dao

Return Value

array

array __debugInfo()

Return Value

array

void beginTransaction()

Return Value

void

void commit()

Return Value

void

void rollBack()

Return Value

void

void configure()

Return Value

void

array getValidTableColumns(string $table, bool $cache)

Parameters

string $table
bool $cache

Return Value

array

void resetValidTableColumnsCache(string $table)

Parameters

string $table

Return Value

void

static string getIdPath($element)

Parameters

$element

Return Value

string

static string getTypePath($element)

Parameters

$element

Return Value

string

Exceptions

Exception

static array getIdList($list, string $idGetter = 'getId')

Parameters

$list array | \Pimcore\Model\Listing\AbstractListing
string $idGetter

Return Value

array

static array getRequiredByDependenciesForFrontend(Dependency $d)

Parameters

Dependency $d

Return Value

array

static array getRequiresDependenciesForFrontend(Dependency $d)

Parameters

Dependency $d

Return Value

array

static array getDependencyForFrontend(Document|Asset|AbstractObject $element)

Parameters

Document|Asset|AbstractObject $element

Return Value

array

static AbstractObject|Document|Asset getDependedElement(array $config)

Parameters

array $config

Return Value

AbstractObject|Document|Asset

static bool isPublished(ElementInterface $element = null)

determines whether an element is published

Parameters

ElementInterface $element

Return Value

bool

static ElementInterface getElementByPath(string $type, string $path)

Parameters

string $type
string $path

Return Value

ElementInterface

static string getBaseClassNameForElement(string|ElementInterface $element)

Parameters

string|ElementInterface $element

Return Value

string

Exceptions

Exception

static ElementInterface|string getSaveCopyName(string $type, string $sourceKey, ElementInterface $target)

Returns a uniqe key for the element in the $target-Path (recursive)

Parameters

string $type
string $sourceKey
ElementInterface $target

Return Value

ElementInterface|string

static bool pathExists($path, $type = null)

Parameters

$path
$type

Return Value

bool

static ElementInterface getElementById(string $type, int $id)

Parameters

string $type
int $id

Return Value

ElementInterface

static string getElementType(ElementInterface $element)

Parameters

ElementInterface $element $element

Return Value

string

static string getType(ElementInterface $element)

determines the type of an element (object,asset,document)

Parameters

ElementInterface $element

Return Value

string

static scheduleForSanityCheck(ElementInterface $element)

Schedules element with this id for sanity check to be cleaned of broken relations

Parameters

ElementInterface $element

static runSanityCheck()

static protected performSanityCheck(ElementInterface $element)

Parameters

ElementInterface $element

static array minimizePropertiesForEditmode($props)

Parameters

$props

Return Value

array

protected updateChilds(ElementInterface $target, ElementInterface $new)

Parameters

ElementInterface $target the parent element
ElementInterface $new the newly inserted child

static array gridElementData(ElementInterface $element)

Parameters

ElementInterface $element

Return Value

array

static string getFilename(ElementInterface $element)

Parameters

ElementInterface $element

Return Value

string

static array findForbiddenPaths(string $type, $user)

find all elements which the user may not list and therefore may never be shown to the user

Parameters

string $type asset|object|document
$user

Return Value

array

static mixed renewReferences(Document|Asset|AbstractObject $data, bool $initial = true)

renews all references, for example after unserializing an ElementInterface

Parameters

Document|Asset|AbstractObject $data
bool $initial

Return Value

mixed

static string correctPath(string $path)

Parameters

string $path

Return Value

string

static ElementInterface loadAllFields(ElementInterface $element)

Parameters

ElementInterface $element

Return Value

ElementInterface

cleanupBrokenViews()

clean up broken views which were generated by localized fields, .

... when removing a language the view isn't valid anymore

static Folder|Folder|Folder createFolderByPath($path, array $options = [])

Parameters

$path
array $options

Return Value

Folder|Folder|Folder

Exceptions

Exception

static addTreeFilterJoins($cv, $childsList)

Changes the query according to the custom view config

Parameters

$cv array
$childsList

static mixed getCustomViewById($id)

Parameters

$id

Return Value

mixed

static mixed|string getValidKey(string $key, null $type)

Parameters

string $key
null $type

Return Value

mixed|string

static bool isValidKey(string $key, string $type)

Parameters

string $key
string $type

Return Value

bool

static bool isValidPath(string $path, string $type)

Parameters

string $path
string $type

Return Value

bool

static string getUniqueKey($item, int $nr = 0)

Parameters

$item
int $nr

Return Value

string

Exceptions

Exception

static array|string fixAllowedTypes($data, $type)

Parameters

$data
$type

Return Value

array|string

static array getSafeVersionInfo($versions)

Parameters

$versions

Return Value

array

static ElementInterface cloneMe(ElementInterface $element)

Parameters

ElementInterface $element

Return Value

ElementInterface

See also

__construct(null $user = null)

Parameters

null $user

matches($object, $property)

{@inheritdoc}

Parameters

$object
$property

static string render(PageSnippet $document, array $attributes = [], bool $useLayout = false, array $query = [], array $options = [])

Renders a document outside of a view with support for legacy documents

Parameter order was kept for BC (useLayout before query and options).

Parameters

PageSnippet $document
array $attributes
bool $useLayout
array $query
array $options

Return Value

string

static saveRecursive($document, int $collectGarbageAfterIteration = 25, int $saved = 0)

Save document and all child documents

Parameters

$document
int $collectGarbageAfterIteration
int $saved

Document copyRecursive(Document $target, Document $source)

Parameters

Document $target
Document $source

Return Value

Document copied document

Document copyAsChild($target, $source, bool $enableInheritance = false, bool $resetIndex = false)

Parameters

$target
$source
bool $enableInheritance
bool $resetIndex

Return Value

Document

Exceptions

Exception

mixed copyContents($target, $source)

Parameters

$target
$source

Return Value

mixed

Exceptions

Exception

static array gridDocumentData(Document $document)

Parameters

Document $document

Return Value

array

static mixed loadAllDocumentFields($doc)

Parameters

$doc

Return Value

mixed

static bool isValidType($type)

Parameters

$type

Return Value

bool

static Document rewriteIds($document, $rewriteConfig, array $params = [])

Rewrites id from source to target, $rewriteConfig contains array( "document" => array( SOURCE_ID => TARGET_ID, SOURCE_ID => TARGET_ID ), "object" => array(.

..), "asset" => array(...) )

Parameters

$document
$rewriteConfig
array $params

Return Value

Document

static Document getByUrl($url)

Parameters

$url

Return Value

Document

Document|PageSnippet|null getNearestDocumentByPath(string|Request $path, bool $ignoreHardlinks = false, array $types = [])

Get the nearest document by path. Used to match nearest document for a static route.

Parameters

string|Request $path
bool $ignoreHardlinks
array $types

Return Value

Document|PageSnippet|null

array getTranslations(Document $document)

Parameters

Document $document

Return Value

array

addTranslation(Document $document, Document $translation, $language = null)

Parameters

Document $document
Document $translation
$language

removeTranslation(Document $document)

Parameters

Document $document

int getTranslationSourceId(Document $document)

Parameters

Document $document

Return Value

int