|
@@ 85-94 (lines=10) @@
|
| 82 |
|
'_self', |
| 83 |
|
'_blank', |
| 84 |
|
]); |
| 85 |
|
$resolver->setNormalizer('route', function(Options $options, $value) { |
| 86 |
|
// route or url should be defined |
| 87 |
|
if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) { |
| 88 |
|
throw new InvalidOptionsException( |
| 89 |
|
'You must set either an url or a route for the property "'.$this->name.'"' |
| 90 |
|
); |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
return $value; |
| 94 |
|
}); |
| 95 |
|
$resolver->setNormalizer('admin', function(Options $options, $value) { |
| 96 |
|
// if a Admin is defined, an Action should be defined too |
| 97 |
|
if ($value && !$options->offsetGet('action')) { |
|
@@ 95-104 (lines=10) @@
|
| 92 |
|
|
| 93 |
|
return $value; |
| 94 |
|
}); |
| 95 |
|
$resolver->setNormalizer('admin', function(Options $options, $value) { |
| 96 |
|
// if a Admin is defined, an Action should be defined too |
| 97 |
|
if ($value && !$options->offsetGet('action')) { |
| 98 |
|
throw new InvalidOptionsException( |
| 99 |
|
'An Action should be provided if an Admin is provided for property "'.$this->name.'"' |
| 100 |
|
); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
return $value; |
| 104 |
|
}); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
/** |