3 namespace TYPO3\CMS\Core\Resource\Index;
21 use TYPO3\CMS\Core\Resource\Exception\InvalidUidException;
22 use TYPO3\CMS\Core\Type\File as FileType;
68 if (!empty($record[
'newlyCreated'])) {
74 $additionalMetaInformation = array(
75 'width' => $imageInfo->getWidth(),
76 'height' => $imageInfo->getHeight(),
79 $this->
update($file->
getUid(), $additionalMetaInformation);
98 throw new InvalidUidException(
'Metadata can only be retrieved for indexed files. UID: "' . $uid .
'"', 1381590731);
102 if ($record ===
false) {
106 $passedData = new \ArrayObject($record);
108 return $passedData->getArrayCopy();
118 return ' AND sys_language_uid IN (0,-1) AND pid=0';
130 $emptyRecord = array(
131 'file' => (
int)$fileUid,
135 'cruser_id' => isset(
$GLOBALS[
'BE_USER']->user[
'uid']) ? (
int)
$GLOBALS[
'BE_USER']->user[
'uid'] : 0,
136 'l10n_diffsource' =>
''
138 $emptyRecord = array_merge($emptyRecord, $additionalFields);
140 $record = $emptyRecord;
142 $record[
'newlyCreated'] =
true;
157 public function update($fileUid, array $data)
159 if (empty($this->tableFields)) {
162 $updateRow = array_intersect_key($data, $this->tableFields);
163 if (array_key_exists(
'uid', $updateRow)) {
164 unset($updateRow[
'uid']);
167 if (!empty($updateRow)) {
168 $updateRow[
'tstamp'] = time();
169 $this->
getDatabaseConnection()->exec_UPDATEquery($this->tableName,
'uid = ' . (
int)$row[
'uid'], $updateRow);
194 return $this->
getObjectManager()->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
204 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
217 $this->
getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class,
'recordPostRetrieval', array($data));
228 $this->
getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class,
'recordUpdated', array($data));
239 $this->
getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class,
'recordCreated', array($data));
250 $this->
getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class,
'recordDeleted', array($fileUid));
258 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class);