| @@ 43-47 (lines=5) @@ | ||
| 40 | ->addDebugInfo($this) |
|
| 41 | ->write("\$containerService = \$this->env->getExtension('swp_container')->getContainerService();\n") |
|
| 42 | ->write('$container = $containerService->getContainer(')->subcompile($this->getNode('name'))->raw(', '); |
|
| 43 | if (!is_null($this->getNode('parameters'))) { |
|
| 44 | $compiler->subcompile($this->getNode('parameters')); |
|
| 45 | } else { |
|
| 46 | $compiler->raw('array()'); |
|
| 47 | } |
|
| 48 | $compiler->raw(");\n") |
|
| 49 | ->write("if (\$container->isVisible()) {\n") |
|
| 50 | ->indent() |
|
| @@ 66-70 (lines=5) @@ | ||
| 63 | $compiler->write("\$context['".$collectionTypeName."'] = null;\n"); |
|
| 64 | $compiler->write("\$context['_collection_type_filters'] = ")->subcompile($this->getNode('collectionFilters'))->raw("['_collection_type_filters']; unset(\$context['".$collectionTypeName."']['_collection_type_filters']);\n"); |
|
| 65 | ||
| 66 | if (!is_null($this->getNode('parameters'))) { |
|
| 67 | $compiler->write('$parameters = array_merge(')->subcompile($this->getNode('parameters'))->raw(", \$context['_collection_type_filters']);\n"); |
|
| 68 | } else { |
|
| 69 | $compiler->write("\$parameters = \$context['_collection_type_filters'];\n"); |
|
| 70 | } |
|
| 71 | } else { |
|
| 72 | if (!is_null($this->getNode('parameters'))) { |
|
| 73 | $compiler->raw('$parameters = ')->subcompile($this->getNode('parameters'))->raw(";\n"); |
|
| @@ 71-77 (lines=7) @@ | ||
| 68 | } else { |
|
| 69 | $compiler->write("\$parameters = \$context['_collection_type_filters'];\n"); |
|
| 70 | } |
|
| 71 | } else { |
|
| 72 | if (!is_null($this->getNode('parameters'))) { |
|
| 73 | $compiler->raw('$parameters = ')->subcompile($this->getNode('parameters'))->raw(";\n"); |
|
| 74 | } else { |
|
| 75 | $compiler->raw("\$parameters = [];\n"); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | $compiler->write('$swpCollectionMetaLoader'.$i." = \$this->env->getExtension('swp_gimme')->getLoader();\n") |
|
| 80 | ->write('')->subcompile($this->getNode('collectionType'))->raw(' = twig_ensure_traversable($swpCollectionMetaLoader'.$i.'->load("')->raw($collectionTypeName)->raw('", '); |
|
| @@ 47-51 (lines=5) @@ | ||
| 44 | ->addDebugInfo($this) |
|
| 45 | ->write('$swpMetaLoader'.$i." = \$this->env->getExtension('swp_gimme')->getLoader();\n") |
|
| 46 | ->write('')->subcompile($this->getNode('annotation'))->raw(' = $swpMetaLoader'.$i.'->load("')->raw($this->getNode('annotation')->getNode(0)->getAttribute('name'))->raw('", '); |
|
| 47 | if (!is_null($this->getNode('parameters'))) { |
|
| 48 | $compiler->subcompile($this->getNode('parameters')); |
|
| 49 | } else { |
|
| 50 | $compiler->raw('null'); |
|
| 51 | } |
|
| 52 | $compiler->raw(");\n") |
|
| 53 | ->write('if (')->subcompile($this->getNode('annotation'))->raw(" !== false) {\n") |
|
| 54 | ->indent() |
|