本文整理汇总了PHP中TYPO3\CMS\Core\Resource\File::getProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP File::getProperties方法的具体用法?PHP File::getProperties怎么用?PHP File::getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\File
的用法示例。
在下文中一共展示了File::getProperties方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProperties
/**
* Gets all properties, falling back to values of the parent.
*
* @return array
*/
public function getProperties()
{
if (empty($this->mergedProperties)) {
$this->mergedProperties = $this->propertiesOfFileReference;
ArrayUtility::mergeRecursiveWithOverrule($this->mergedProperties, $this->originalFile->getProperties(), true, true, false);
array_walk($this->mergedProperties, [$this, 'restoreNonNullValuesCallback']);
}
return $this->mergedProperties;
}
示例2: getFileArray
/**
* Fixes a bug in TYPO3 6.2.0 that the properties metadata is not overlayed on localization.
*
* @param File $file
* @return array
*/
public static function getFileArray(File $file)
{
$properties = $file->getProperties();
$stat = $file->getStorage()->getFileInfo($file);
$array = $file->toArray();
foreach ($properties as $key => $value) {
$array[$key] = $value;
}
foreach ($stat as $key => $value) {
$array[$key] = $value;
}
return $array;
}
示例3: toArray
/**
* Basic array function for the DB update
*
* @return array
*/
public function toArray()
{
if ($this->usesOriginalFile()) {
$properties = $this->originalFile->getProperties();
unset($properties['uid']);
unset($properties['pid']);
unset($properties['identifier']);
unset($properties['name']);
// Use width + height set in processed file
$properties['width'] = $this->properties['width'];
$properties['height'] = $this->properties['height'];
} else {
$properties = $this->properties;
$properties['identifier'] = $this->getIdentifier();
$properties['name'] = $this->getName();
}
$properties['configuration'] = serialize($this->processingConfiguration);
return array_merge($properties, array('storage' => $this->getStorage()->getUid(), 'checksum' => $this->calculateChecksum(), 'task_type' => $this->taskType, 'configurationsha1' => sha1($properties['configuration']), 'original' => $this->originalFile->getUid(), 'originalfilesha1' => $this->originalFileSha1));
}
示例4: update
/**
* Updates an existing file object in the database
*
* @param \TYPO3\CMS\Core\Resource\File $modifiedObject
* @return void
*/
public function update($modifiedObject)
{
// TODO check if $modifiedObject is an instance of \TYPO3\CMS\Core\Resource\File
// TODO check if $modifiedObject is indexed
$changedProperties = $modifiedObject->getUpdatedProperties();
$properties = $modifiedObject->getProperties();
$updateFields = array();
foreach ($changedProperties as $propertyName) {
$updateFields[$propertyName] = $properties[$propertyName];
}
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_file', 'uid=' . $modifiedObject->getUid(), $updateFields);
}
示例5: getReferenceProperties
/**
* Gets all properties.
*
* @return array
*/
public function getReferenceProperties()
{
return \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($this->originalFile->getProperties(), $this->propertiesOfFileReference);
}