Mgallegos\LaravelJqgrid\Renders\JqGridRender::addExport PHP Method

addExport() public method

public addExport ( array $properties = [] )
$properties array
    public function addExport(array $properties = array())
    {
        $export_type = '';
        foreach ($properties as $key => $value) {
            if (preg_match('/ButtonVisible$/', $key) && gettype($value) == 'boolean') {
                $export_type = substr($key, 0, -1 * strlen('ButtonVisible'));
            }
        }
        if ($export_type == '') {
            throw new \Exception('addExport-method does not set the required parameter ...ButtonVisible or can not determine the type of the method by prefix of this parameter');
        }
        $notFoundKeys = array_diff([$export_type . 'ButtonVisible', $export_type . 'ButtonText', $export_type . 'Icon'], array_keys($properties));
        if (count($notFoundKeys) > 0) {
            throw new \Exception('addExport-method does not set the required parameters: ' . implode(', ', $notFoundKeys));
        }
        $this->exportButtonsOptions = array_merge($this->exportButtonsOptions, $properties);
        return $this;
    }