Sleimanx2\Plastic\Map\Grammar::compileFields PHP Method

compileFields() public method

Compile an array of fluent fields.
public compileFields ( $fields ) : array
$fields
return array
    public function compileFields($fields)
    {
        $statement = [];
        foreach ($fields as $field) {
            $method = 'compile' . ucfirst($field->type);
            if (method_exists($this, $method)) {
                if (!empty($map = $this->{$method}($field))) {
                    $statement[$field->name] = $map;
                }
            }
        }
        return $statement;
    }