src/Graviton/DocumentBundle/DependencyInjection/Compiler/DocumentFieldNamesCompilerPass.php 1 location
|
@@ 32-41 (lines=10) @@
|
| 29 |
|
* |
| 30 |
|
* @return void |
| 31 |
|
*/ |
| 32 |
|
public function process(ContainerBuilder $container) |
| 33 |
|
{ |
| 34 |
|
$this->documentMap = $container->get('graviton.document.map'); |
| 35 |
|
|
| 36 |
|
$map = []; |
| 37 |
|
foreach ($this->documentMap->getDocuments() as $document) { |
| 38 |
|
$map[$document->getClass()] = $this->getFieldNames($document); |
| 39 |
|
} |
| 40 |
|
$container->setParameter('graviton.document.field.names', $map); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
/** |
| 44 |
|
* Get field names |
src/Graviton/DocumentBundle/DependencyInjection/Compiler/TranslatableFieldsCompilerPass.php 1 location
|
@@ 36-45 (lines=10) @@
|
| 33 |
|
* @param ContainerBuilder $container container builder |
| 34 |
|
* @return void |
| 35 |
|
*/ |
| 36 |
|
public function process(ContainerBuilder $container) |
| 37 |
|
{ |
| 38 |
|
$this->documentMap = $container->get('graviton.document.map'); |
| 39 |
|
|
| 40 |
|
$map = []; |
| 41 |
|
foreach ($this->documentMap->getDocuments() as $document) { |
| 42 |
|
$map[$document->getClass()] = $this->getTranslatableFields($document); |
| 43 |
|
} |
| 44 |
|
$container->setParameter('graviton.document.type.translatable.fields', $map); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
/** |
| 48 |
|
* Get document fields |