| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentForm\App\Services\FormBuilder; |
| 4 |
|
| 5 |
class GroupSetterProxy |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Element group |
| 9 |
* @var string |
| 10 |
*/ |
| 11 |
protected $group = null; |
| 12 |
|
| 13 |
/** |
| 14 |
* @var \FluentForm\App\Services\FormBuilder\Components |
| 15 |
*/ |
| 16 |
protected $collection = null; |
| 17 |
|
| 18 |
public function __construct($collection, $group) |
| 19 |
{ |
| 20 |
$this->group = $group; |
| 21 |
$this->collection = $collection; |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Dynamic call method |
| 26 |
* @param string $method |
| 27 |
* @param array $params |
| 28 |
* @return \FluentForm\App\Services\FormBuilder\Components |
| 29 |
*/ |
| 30 |
public function __call($method, $params) |
| 31 |
{ |
| 32 |
call_user_func_array([ |
| 33 |
$this->collection, $method |
| 34 |
], array_merge($params, [$this->group])); |
| 35 |
|
| 36 |
return $this->collection; |
| 37 |
} |
| 38 |
} |