src/Graviton/DocumentBundle/DependencyInjection/Compiler/DocumentFormFieldsCompilerPass.php 1 location
|
@@ 76-81 (lines=6) @@
|
| 73 |
|
private function getFormFields(Document $document) |
| 74 |
|
{ |
| 75 |
|
$reflection = new \ReflectionClass($document->getClass()); |
| 76 |
|
if ($reflection->implementsInterface('Graviton\I18nBundle\Document\TranslatableDocumentInterface')) { |
| 77 |
|
$instance = $reflection->newInstanceWithoutConstructor(); |
| 78 |
|
$translatableFields = $instance->getTranslatableFields(); |
| 79 |
|
} else { |
| 80 |
|
$translatableFields = []; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
$result = []; |
| 84 |
|
foreach ($document->getFields() as $field) { |
src/Graviton/DocumentBundle/DependencyInjection/Compiler/TranslatableFieldsCompilerPass.php 1 location
|
@@ 65-70 (lines=6) @@
|
| 62 |
|
private function getTranslatableFields(Document $document, $prefix = '') |
| 63 |
|
{ |
| 64 |
|
$reflection = new \ReflectionClass($document->getClass()); |
| 65 |
|
if ($reflection->implementsInterface('Graviton\I18nBundle\Document\TranslatableDocumentInterface')) { |
| 66 |
|
$instance = $reflection->newInstanceWithoutConstructor(); |
| 67 |
|
$translatableFields = $instance->getTranslatableFields(); |
| 68 |
|
} else { |
| 69 |
|
$translatableFields = []; |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
$result = []; |
| 73 |
|
foreach ($document->getFields() as $field) { |