Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fillpdf
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
fillpdf
Commits
437dc9a4
Commit
437dc9a4
authored
2 years ago
by
Liam Morland
Browse files
Options
Downloads
Patches
Plain Diff
Issue #3272489: Remove deprecated interface FillPdfBackendPluginInterface
parent
1bcb8d45
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/FillPdfBackendPluginInterface.php
+0
-67
0 additions, 67 deletions
src/FillPdfBackendPluginInterface.php
src/Service/BackendProxy.php
+1
-1
1 addition, 1 deletion
src/Service/BackendProxy.php
with
1 addition
and
68 deletions
src/FillPdfBackendPluginInterface.php
deleted
100644 → 0
+
0
−
67
View file @
1bcb8d45
<?php
namespace
Drupal\fillpdf
;
/**
* Defines the required interface for all FillPDF BackendService plugins.
*
* @package Drupal\fillpdf
*
* @deprecated in fillpdf:8.x-4.9 and is removed from fillpdf:8.x-5.0.
* Instead of implementing FillPdfBackendPluginInterface, you should extend
* PdfBackendBase.
* @see https://www.drupal.org/node/3059476
* @see \Drupal\fillpdf\Plugin\PdfBackendBase
*/
interface
FillPdfBackendPluginInterface
{
/**
* Parse a PDF and return a list of its fields.
*
* @param \Drupal\fillpdf\FillPdfFormInterface $fillpdf_form
* The PDF whose fields are going to be parsed.
*
* @return array
* An array of associative arrays. Each sub-array contains a 'name' key with
* the name of the field and a 'type' key with the type. These can be
* iterated over and saved by the caller.
*/
public
function
parse
(
FillPdfFormInterface
$fillpdf_form
);
/**
* Populate a FillPDF form with field data.
*
* Formerly known as merging. Accept an array of PDF field keys and field
* values and populate the PDF using them.
*
* @param \Drupal\fillpdf\FillPdfFormInterface $fillpdf_form
* The FillPdfForm referencing the file whose field values are going to be
* populated.
* @param array $field_mapping
* An array of fields mapping PDF field keys to the values with which they
* should be replaced. Example array:
* @code
* [
* 'values' => [
* 'Field 1' => 'value',
* 'Checkbox Field' => 'On',
* ],
* 'images' => [
* 'Image Field 1' => [
* 'data' => base64_encode($file_data),
* 'filenamehash' => md5($image_path_info['filename']) . '.' . $image_path_info['extension'],
* ],
* ],
* ]
* @endcode
* @param array $context
* The request context as returned by
* FillPdfLinkManipulatorInterface::parseLink().
*
* @return string|null
* The raw file contents of the new PDF, or NULL if populating failed. The
* caller has to handle saving or serving the file accordingly.
*/
public
function
populateWithFieldData
(
FillPdfFormInterface
$fillpdf_form
,
array
$field_mapping
,
array
$context
);
}
This diff is collapsed.
Click to expand it.
src/Service/BackendProxy.php
+
1
−
1
View file @
437dc9a4
...
@@ -104,7 +104,7 @@ class BackendProxy implements BackendProxyInterface {
...
@@ -104,7 +104,7 @@ class BackendProxy implements BackendProxyInterface {
}
}
// Now load the backend plugin.
// Now load the backend plugin.
/** @var
\Drupal\fillpdf\FillPdfBackendPluginInterface|
\Drupal\fillpdf\Plugin\PdfBackendInterface $backend */
/** @var \Drupal\fillpdf\Plugin\PdfBackendInterface $backend */
$backend
=
$this
->
backendManager
->
createInstance
(
$config
->
get
(
'backend'
),
$config
->
get
());
$backend
=
$this
->
backendManager
->
createInstance
(
$config
->
get
(
'backend'
),
$config
->
get
());
// @todo Emit event (or call alter hook?) before populating PDF.
// @todo Emit event (or call alter hook?) before populating PDF.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment