private function addDatatableFields($modelName, $modelData)
    {
        $fields = '';
        $firstIteration = true;

        foreach ($modelData->fields as $field)
        {
            if ($field->hideInListings === false)
            {
                if ($firstIteration)
                {
                    $fields .= sprintf("{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name);
                    $firstIteration = false;
                }
                else
                {
                    $fields .= sprintf($this->tab(4) . "{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name);
                }
            }
        }

        $this->stub = str_replace('{{datatable_fields}}', $fields, $this->stub);
        $this->stub = str_replace('{{datatable_url}}', ucfirst($modelName), $this->stub);

        return $this;
    }
private function addDatatableFields($modelName, $modelData)
    {
        $fields = '';
        $firstIteration = true;

        foreach ($modelData->fields as $field)
        {
            if ($field->hideInListings === false)
            {
                if ($firstIteration)
                {
                    $fields .= sprintf("{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name);
                    $firstIteration = false;
                }
                else
                {
                    $fields .= sprintf($this->tab(4) . "{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name);
                }
            }
        }

        $this->stub = str_replace('{{datatable_fields}}', $fields, $this->stub);
        $this->stub = str_replace('{{datatable_url}}', ucfirst($modelName), $this->stub);

        return $this;
    }
private function addDatatableFields ( $ modelName , $ modelData ) { $ fields = '' ; $ firstIteration = true ; foreach ( $ modelData -> fields as $ field ) { if ( $ field -> hideInListings === false ) { if ( $ firstIteration ) { $ fields .= sprintf ( "{ data: '%s', name: '%s' }," . PHP_EOL , $ field -> name , $ field -> name ) ; $ firstIteration = false ; } else { $ fields .= sprintf ( $ this -> tab ( 4 ) . "{ data: '%s', name: '%s' }," . PHP_EOL , $ field -> name , $ field -> name ) ; } } } $ this -> stub = str_replace ( '{{datatable_fields}}' , $ fields , $ this -> stub ) ; $ this -> stub = str_replace ( '{{datatable_url}}' , ucfirst ( $ modelName ) , $ this -> stub ) ; return $ this ; }
Datatable fields.

@param $modelName
@param $modelData

@return $this
Datatable fields .