当前位置: 首页>>代码示例>>PHP>>正文


PHP File::_getMetaData方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Resource\File::_getMetaData方法的典型用法代码示例。如果您正苦于以下问题:PHP File::_getMetaData方法的具体用法?PHP File::_getMetaData怎么用?PHP File::_getMetaData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Resource\File的用法示例。


在下文中一共展示了File::_getMetaData方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUri

 /**
  * @param File $file
  * @return string
  */
 protected function getUri(File $file)
 {
     $metadataProperties = $file->_getMetaData();
     $parameterName = sprintf('edit[sys_file_metadata][%s]', $metadataProperties['uid']);
     $uri = BackendUtility::getModuleUrl('record_edit', array($parameterName => 'edit', 'returnUrl' => BackendUtility::getModuleUrl(GeneralUtility::_GP('M'), $this->getAdditionalParameters())));
     return $uri;
 }
开发者ID:visol,项目名称:media,代码行数:11,代码来源:EditButton.php

示例2: extractMetaData

 /**
  * Extract metadata for given fileObject
  *
  * @param File $fileObject
  */
 public function extractMetaData(File $fileObject)
 {
     $newMetaData = [0 => $fileObject->_getMetaData()];
     // Loop through available extractors and fetch metadata for the given file.
     foreach ($this->getExtractionServices() as $service) {
         if ($this->isFileTypeSupportedByExtractor($fileObject, $service) && $service->canProcess($fileObject)) {
             $newMetaData[$service->getPriority()] = $service->extractMetaData($fileObject, $newMetaData);
         }
     }
     // Sort metadata by priority so that merging happens in order of precedence.
     ksort($newMetaData);
     // Merge the collected metadata.
     $metaData = [];
     foreach ($newMetaData as $data) {
         $metaData = array_merge($metaData, $data);
     }
     $fileObject->_updateMetaDataProperties($metaData);
     $this->getMetaDataRepository()->update($fileObject->getUid(), $metaData);
     $this->getFileIndexRepository()->updateIndexingTime($fileObject->getUid());
 }
开发者ID:,项目名称:,代码行数:25,代码来源:

示例3: linkWrapFile

 /**
  * Wraps filenames in links which opens the metadata editor.
  *
  * @param string $code String to be wrapped in links
  * @param File $fileObject File to be linked
  * @return string HTML
  */
 public function linkWrapFile($code, File $fileObject)
 {
     try {
         if ($fileObject instanceof File && $fileObject->isIndexed() && $fileObject->checkActionPermission('write') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
             $metaData = $fileObject->_getMetaData();
             $data = array('sys_file_metadata' => array($metaData['uid'] => 'edit'));
             $editOnClick = BackendUtility::editOnClick(GeneralUtility::implodeArrayForUrl('edit', $data), '', $this->listUrl());
             $title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.editMetadata'));
             $code = '<a href="#" title="' . $title . '" onclick="' . htmlspecialchars($editOnClick) . '">' . GeneralUtility::fixed_lgd_cs($code, $this->fixedL) . '</a>';
         }
     } catch (\Exception $e) {
         // intentional fall-through
     }
     return $code;
 }
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:22,代码来源:FileList.php

示例4: migrateFileFromDamToFal

 /**
  * migrate file from dam record to fal system
  *
  * @param array $damRecord
  * @param \TYPO3\CMS\Core\Resource\File $fileObject
  * @throws \Exception
  * @return void
  */
 protected function migrateFileFromDamToFal(array $damRecord, \TYPO3\CMS\Core\Resource\File $fileObject)
 {
     // in getProperties() we don't have the required UID of metadata record
     // if no metadata record is available it will automatically created within FAL
     $metadataRecord = $fileObject->_getMetaData();
     if (is_array($metadataRecord)) {
         // update existing record
         $this->database->exec_UPDATEquery('sys_file_metadata', 'uid = ' . $metadataRecord['uid'], $this->createArrayForUpdateInsertSysFileRecord($damRecord));
         // add the migrated uid of the DAM record to the FAL record
         $this->database->exec_UPDATEquery('sys_file', 'uid = ' . $fileObject->getUid(), array('_migrateddamuid' => $damRecord['uid']));
     }
 }
开发者ID:wernert,项目名称:t3ext-dam_falmigration,代码行数:20,代码来源:MigrateTask.php

示例5: cleanupCategoryReferences

 /**
  * Remove all category references of the deleted file.
  *
  * @param File $fileObject
  * @return void
  */
 protected function cleanupCategoryReferences(File $fileObject)
 {
     // Retrieve the file metadata uid which is different from the file uid.
     $metadataProperties = $fileObject->_getMetaData();
     $metaDataUid = isset($metadataProperties['_ORIG_uid']) ? $metadataProperties['_ORIG_uid'] : $metadataProperties['uid'];
     $this->getDatabaseConnection()->exec_DELETEquery('sys_category_record_mm', 'uid_foreign=' . (int) $metaDataUid . ' AND tablenames = \'sys_file_metadata\'');
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:13,代码来源:FileDeletionAspect.php

示例6: linkWrapFile

 /**
  * Wraps filenames in links which opens the metadata editor.
  *
  * @param string $code String to be wrapped in links
  * @param File $fileObject File to be linked
  * @return string HTML
  */
 public function linkWrapFile($code, File $fileObject)
 {
     try {
         if ($fileObject instanceof File && $fileObject->isIndexed() && $fileObject->checkActionPermission('write') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
             $metaData = $fileObject->_getMetaData();
             $urlParameters = ['edit' => ['sys_file_metadata' => [$metaData['uid'] => 'edit']], 'returnUrl' => $this->listURL()];
             $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
             $title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.editMetadata'));
             $code = '<a href="' . htmlspecialchars($url) . '" title="' . $title . '">' . GeneralUtility::fixed_lgd_cs($code, $this->fixedL) . '</a>';
         }
     } catch (\Exception $e) {
         // intentional fall-through
     }
     return $code;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:22,代码来源:FileList.php

示例7: extractMetaData

 /**
  * Extract metadata for given fileObject
  *
  * @param File $fileObject
  */
 public function extractMetaData(File $fileObject)
 {
     $newMetaData = array(0 => $fileObject->_getMetaData());
     foreach ($this->getExtractionServices() as $service) {
         if ($service->canProcess($fileObject)) {
             $newMetaData[$service->getPriority()] = $service->extractMetaData($fileObject, $newMetaData);
         }
     }
     ksort($newMetaData);
     $metaData = array();
     foreach ($newMetaData as $data) {
         $metaData = array_merge($metaData, $data);
     }
     $fileObject->_updateMetaDataProperties($metaData);
     $this->getMetaDataRepository()->update($fileObject->getUid(), $metaData);
     $this->getFileIndexRepository()->updateIndexingTime($fileObject->getUid());
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:22,代码来源:Indexer.php

示例8: getFileMetadataIdentifier

 /**
  * Retrieve the file metadata uid which is different from the file uid.
  *
  * @param \TYPO3\CMS\Core\Resource\File $file
  * @return int
  */
 protected function getFileMetadataIdentifier(File $file)
 {
     $metadataProperties = $file->_getMetaData();
     return isset($metadataProperties['_ORIG_uid']) ? (int) $metadataProperties['_ORIG_uid'] : (int) $metadataProperties['uid'];
 }
开发者ID:visol,项目名称:media,代码行数:11,代码来源:MediaIndexer.php


注:本文中的TYPO3\CMS\Core\Resource\File::_getMetaData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。