Make FnType accept params and content
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
3a112f4e79
commit
1bc585b2c8
3 changed files with 27 additions and 3 deletions
|
|
@ -4,13 +4,28 @@ namespace Arendsen\FluxQueryBuilder\Type;
|
|||
|
||||
class FnType implements TypeInterface
|
||||
{
|
||||
public function __construct(string $value)
|
||||
/**
|
||||
* @var mixed $value
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @var string $content
|
||||
*/
|
||||
protected $content;
|
||||
|
||||
public function __construct($value, string $content = '')
|
||||
{
|
||||
$this->value = $value;
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
if(is_string($this->value)) {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
return '(' . implode(', ', $this->value) . ') => ' . $this->content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue