Add Flux from() and filter() methods
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
af750eb635
commit
e0e69b4beb
17 changed files with 2095 additions and 0 deletions
31
src/Function/From.php
Normal file
31
src/Function/From.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Arendsen\FluxQueryBuilder\Function;
|
||||
|
||||
class From extends Base {
|
||||
|
||||
/**
|
||||
* @var array $settings
|
||||
*/
|
||||
private $settings;
|
||||
|
||||
public function __construct(array $settings)
|
||||
{
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return 'from(' . implode(', ', $this->format($this->settings)) . ') ';
|
||||
}
|
||||
|
||||
protected function format(array $settings)
|
||||
{
|
||||
array_walk($settings, function(&$value, $key) {
|
||||
$value = $key . ': ' . (is_string($value) ? '"' . $value . '"' : $value);
|
||||
});
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue