mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
BUG moving new getContent method into DataObject, not Controller
This commit is contained in:
parent
687b4f5f97
commit
f02303793d
@ -802,6 +802,19 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
|||||||
$file->delete();
|
$file->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Content For FullTextSearch module (using Solr) */
|
||||||
|
function getContent() {
|
||||||
|
if (class_exists('FileTextExtractor')) {
|
||||||
|
// Determine which extractor can process this file.
|
||||||
|
$extractor = FileTextExtractor::for_file($this->owner->FullPath);
|
||||||
|
if (!$extractor) return null;
|
||||||
|
|
||||||
|
$text = $extractor->getContent($this->owner->FullPath);
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DMSDocument_Controller extends Controller {
|
class DMSDocument_Controller extends Controller {
|
||||||
@ -944,18 +957,5 @@ class DMSDocument_Controller extends Controller {
|
|||||||
return $linkText;
|
return $linkText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Content For FullTextSearch module (using Solr) */
|
|
||||||
function getContent() {
|
|
||||||
if (class_exists('FileTextExtractor')) {
|
|
||||||
// Determine which extractor can process this file.
|
|
||||||
$extractor = FileTextExtractor::for_file($this->owner->FullPath);
|
|
||||||
if (!$extractor) return null;
|
|
||||||
|
|
||||||
$text = $extractor->getContent($this->owner->FullPath);
|
|
||||||
return $text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user