1 | <?php |
||
18 | class Exporter extends Component |
||
19 | { |
||
20 | use CollectionTrait; |
||
21 | |||
22 | /** |
||
23 | * @var string|array|Serializer |
||
24 | */ |
||
25 | public $serializer; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | public $description; |
||
31 | |||
32 | /** |
||
33 | * @var Session[] |
||
34 | */ |
||
35 | public $sessions = []; |
||
36 | |||
37 | /** |
||
38 | * @var Dictionary[] |
||
39 | */ |
||
40 | public $dictionaries = []; |
||
41 | |||
42 | /** |
||
43 | * @var Event[] |
||
44 | */ |
||
45 | public $events = []; |
||
46 | |||
47 | /** |
||
48 | * @var Provider[] |
||
49 | */ |
||
50 | public $providers = []; |
||
51 | |||
52 | /** |
||
53 | * @var Parameter[] |
||
54 | */ |
||
55 | public $parameters = []; |
||
56 | |||
57 | /** |
||
58 | * @var Connection|array|string the DB connection object or the application component ID of the DB connection |
||
59 | */ |
||
60 | public $db = 'db'; |
||
61 | |||
62 | /** |
||
63 | * @var array|Formatter the formatter used to format model attribute values into displayable texts. |
||
64 | * This can be either an instance of [[Formatter]] or an configuration array for creating the [[Formatter]] |
||
65 | * instance. If this property is not set, the "formatter" application component will be used. |
||
66 | */ |
||
67 | public $formatter; |
||
68 | |||
69 | /** |
||
70 | * Initializes the exporter. |
||
71 | * This method will initialize required property values and instantiate collection objects. |
||
72 | */ |
||
73 | 10 | public function init() |
|
87 | |||
88 | |||
89 | /** |
||
90 | * Finds Provider instance by the given name. |
||
91 | * @param string $name the provider name |
||
92 | * @return Provider |
||
93 | * @throws InvalidConfigException if provider not found |
||
94 | */ |
||
95 | 8 | public function findProvider($name) |
|
104 | |||
105 | /** |
||
106 | * Finds Dictionary instance by the given name. |
||
107 | * @param string $name the dictionary name |
||
108 | * @return Dictionary |
||
109 | * @throws InvalidConfigException if dictionary not found |
||
110 | */ |
||
111 | 4 | public function findDictionary($name) |
|
120 | |||
121 | /** |
||
122 | * Finds Parameter instance by the given name. |
||
123 | * @param string $name the dictionary name |
||
124 | * @return Parameter|null |
||
125 | */ |
||
126 | 1 | public function findParameter($name) |
|
135 | |||
136 | /** |
||
137 | * Finds Event instance by the given name. |
||
138 | * @param string $name the dictionary name* |
||
139 | * @return Event|null |
||
140 | * @throws InvalidConfigException if is invalid expression event |
||
141 | */ |
||
142 | 5 | public function findEvent($name) |
|
155 | |||
156 | /** |
||
157 | * Performs data conversion |
||
158 | * @return string the formatted data |
||
159 | */ |
||
160 | 8 | public function execute() |
|
165 | |||
166 | /** |
||
167 | * Initializes the Serializer property |
||
168 | * @throws InvalidConfigException |
||
169 | */ |
||
170 | 10 | protected function initSerializer() |
|
186 | |||
187 | /** |
||
188 | * Initializes the Formatter property |
||
189 | * @throws InvalidConfigException |
||
190 | */ |
||
191 | 9 | protected function initFormatter() |
|
202 | } |
||
203 |