本文整理匯總了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);
}