2 namespace TYPO3\CMS\Core\Resource\Index;
57 if (!class_exists($className)) {
58 throw new \InvalidArgumentException(
'The class "' . $className .
'" you are registering is not available', 1422705270);
59 }
elseif (!in_array(\TYPO3\CMS\Core\Resource\Index\ExtractorInterface::class, class_implements($className))) {
60 throw new \InvalidArgumentException(
'The extractor needs to implement the ExtractorInterface', 1422705271);
62 $this->extractors[] = $className;
71 public function getExtractors()
73 if ($this->instances === null) {
74 $this->instances = array();
80 $this->instances[] = $object;
83 if (count($this->instances) > 1) {
84 usort($this->instances, array($this,
'compareExtractorPriority'));
98 $allExtractors = $this->getExtractors();
100 $filteredExtractors = array();
101 foreach ($allExtractors as $priority => $extractorObject) {
102 if (empty($extractorObject->getDriverRestrictions())) {
103 $filteredExtractors[$priority] = $extractorObject;
104 }
elseif (in_array($driverType, $extractorObject->getDriverRestrictions())) {
105 $filteredExtractors[$priority] = $extractorObject;
108 return $filteredExtractors;