チェックアウトthis answer。レコードの削除時に実行されるフックを設定する方法についての詳細な説明があり、確実にお手伝いします。それをまとめると
、あなたはext_tables.php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['YourHook'][] = 'YourVendor\\YourExt\\Hooks\\YourHook';
であなたのフックを登録し、フック自体を宣言する必要があります:
/ext/your_ext/Classes/Hooks/yourHook.php
Here is a partial list of available hooks from the official Docs。
編集
あなたは正しいMember Function
を探しています。
正直に言うと、私はあなたがprocessCmdmap_afterFinish
を使用してそれらの場合、または複数をフックする必要がある場合に何が必要でしょうわからない:このコードの
<?php
namespace YourVendor\YourExt\Hooks;
class ProcessCmdmap {
/**
* hook that is called when an element shall get deleted
*
* @param string $table the table of the record
* @param integer $id the ID of the record
* @param array $record The accordant database record
* @param boolean $recordWasDeleted can be set so that other hooks or
* @param DataHandler $tcemainObj reference to the main tcemain object
* @return void
*/
function processCmdmap_postProcess($command, $table, $id, $value, $dataHandler) {
/* Does this trigger at all for the actions you need? */
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($command);
die();
if ($command == 'delete' ||
$command == 'update' ||
$command == 'move' ||
$table == 'tx_yourext_domain_model_something') {
}
}
}
大部分はthis answer
から来ます私はそれを見てみましょう。これらのフックは、ページのみ、またはページとコンテンツの両方に対応していますか? – Quai
ありがとうございます。私は明日その機能を試してみます。 – Quai
私はフックを試みたが、残念なことにページを作成して更新するだけであると認識されている。フックでコンテンツの作成、更新、削除、または移動を認識する方法はありますか? – Quai