FeaturesGenerationMethodInterface.php
2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* @file
* Contains \Drupal\features\FeaturesGenerationMethodInterface.
*/
namespace Drupal\features;
use Drupal\features\FeaturesManagerInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\FormStateInterface;
/**
* Interface for package assignment classes.
*/
interface FeaturesGenerationMethodInterface {
/**
* Injects the features manager.
*
* @param \Drupal\features\FeaturesManagerInterface $features_manager
* The features manager to be used to retrieve the configuration
* list and the assigned packages.
*/
public function setFeaturesManager(FeaturesManagerInterface $features_manager);
/**
* Injects the features assigner.
*
* @param \Drupal\features\FeaturesAssignerInterface $assigner
* The features assigner to be used to retrieve the bundle configuration.
*/
public function setAssigner(FeaturesAssignerInterface $assigner);
/**
* Prepares packages for generation.
*
* @param array $packages
* Array of package data.
* @param \Drupal\features\FeaturesBundleInterface $bundle
* The optional bundle used for the generation. Used to generate profiles.
*
* @return array
* An array of packages data.
*/
public function prepare(array &$packages = array(), FeaturesBundleInterface $bundle = NULL);
/**
* Performs package generation.
*
* @param array $packages
* Array of package data.
* @param \Drupal\features\FeaturesBundleInterface $bundle
* The optional bundle used for the generation. Used to generate profiles.
*
* @return array
* Array of results for profile and/or packages, each result including the
* following keys:
* - 'success': boolean TRUE or FALSE for successful writing.
* - 'display': boolean TRUE if the message should be displayed to the
* user, otherwise FALSE.
* - 'message': a message about the result of the operation.
* - 'variables': an array of substitutions to be used in the message.
*/
public function generate(array $packages = array(), FeaturesBundleInterface $bundle = NULL);
/**
* Responds to the submission of
* \Drupal\features_ui\Form\FeaturesExportForm.
*/
public function exportFormSubmit(array &$form, FormStateInterface $form_state);
}