-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename PlainTextStorage to LocalFileStorage, add Interface for contract
- Loading branch information
Showing
11 changed files
with
169 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
modules/entity_to_text_tika/src/Storage/StorageInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Drupal\entity_to_text_tika\Storage; | ||
|
||
use Drupal\file\Entity\File; | ||
|
||
/** | ||
* OCR Storage interface. | ||
* | ||
* All class that store and retrieve OCR text values must implement | ||
* the interface. | ||
*/ | ||
interface StorageInterface { | ||
|
||
/** | ||
* Load an OCR text value from a storage interface (file, database ...). | ||
* | ||
* @param \Drupal\file\Entity\File $file | ||
* The document to be saved. | ||
* @param string $langcode | ||
* The translation the ocr file must be retrieved. | ||
* | ||
* @return string|null | ||
* The OCR plain-text value for the given file. | ||
*/ | ||
public function load(File $file, string $langcode = 'eng'): ?string; | ||
|
||
/** | ||
* Store an OCR text value into a storage interface (file, database ...). | ||
* | ||
* @param \Drupal\file\Entity\File $file | ||
* The document to be saved. | ||
* @param string $content | ||
* The plain-text document to be stored. | ||
* @param string $langcode | ||
* The translation the ocr file must be stored. | ||
* | ||
* @return string | ||
* The saved full path file. | ||
*/ | ||
public function save(File $file, string $content, string $langcode = 'eng'): string; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.