Advertisement
BenjaminS

TYPO3: Linkvalidator - analyzeRecord() hook suggestion

Sep 30th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. /**
  2. * Find all supported broken links for a specific record
  3. *
  4. * @param array $results Array of broken links
  5. * @param string $table Table name of the record
  6. * @param array $fields Array of fields to analyze
  7. * @param array $record Record to analyse
  8. * @return void
  9. */
  10. public function analyzeRecord(array &$results, $table, array $fields, array $record) {
  11. if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['analyzeRecord'])) {
  12. foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['analyzeRecord'] as $classRef) {
  13. $hookObject = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
  14. if (!$hookObject instanceof \TYPO3\CMS\Linkvalidator\Interface\AnalyzeRecordInterface) {
  15. throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Linkvalidator\\Interface\\AnalyzeRecordInterface', 1380552237);
  16. }
  17. $hookObject->analyzeRecord($results, $table, $fields, $record);
  18. }
  19. }
  20.  
  21. .. continue analyzing normal way ..
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement