Skip to content

Commit

Permalink
allow reference resolution in setting ref values
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed May 4, 2018
1 parent bed8266 commit 001b4a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Core/Executor/ReferenceExecutor.php
Expand Up @@ -59,7 +59,9 @@ protected function set($dsl, $context)
if (!isset($dsl['value'])) {
throw new \Exception("Invalid step definition: miss 'value' for setting reference");
}
$value = $dsl['value'];
// this makes sense since we started supporting embedded refs...
$value = $this->referenceResolver->resolveReference($dsl['value']);
/// @todo add support for eZ dynamic parameters too
if (preg_match('/.*%.+%.*$/', $value)) {
// we use the same parameter resolving rule as symfony, even though this means abusing the ContainerInterface
$value = $this->container->getParameterBag()->resolveString($value);
Expand Down
2 changes: 0 additions & 2 deletions Core/ReferenceResolver/PrefixBasedResolverInterface.php
Expand Up @@ -5,8 +5,6 @@
/**
* At the moment this interface does nothing more than its parent.
* *However* we assume that all classes implementing this interface do produce a regexp which starts with a left anchoring: /^.../
*
* @deprecated in favour of EmbeddedReferenceResolverInterface
*/
interface PrefixBasedResolverInterface extends RegexpBasedResolverInterface
{
Expand Down
10 changes: 10 additions & 0 deletions WHATSNEW.md
Expand Up @@ -22,6 +22,16 @@ Version 4.8
# we get remote_content_id = "something 99 times different"
```

* New: it is now possible to create references with values that are generated from other references, such as:

```
type: reference
mode: set
identifier: three
value: "[reference:one].[loop:two]"
```

* New: when creating and updating ContentType definitions, it is possible to use a reference to define each field. The
value of the reference must be an array with all the usual keys: 'name', 'searchable', etc...
This makes it easy to define multiple ContentTypes sharing fields with the same definition such as f.e. the 'title'
Expand Down

0 comments on commit 001b4a8

Please sign in to comment.