Builds the table.

@return string  The generated table string.
183343
function _buildTable() {
        if (!count($this->_data)) {
            return '';
        }

        $vertical = $this->_border['vertical'];
        $separator = $this->_getSeparator();

        $return = array();
        for ($i = 0; $i < count($this->_data); $i++) {
            for ($j = 0; $j < count($this->_data[$i]); $j++) {
                if ($this->_data[$i] !== self::CONSOLE_TABLE_HORIZONTAL_RULE &&
                    $this->_strlen($this->_data[$i][$j]) <
                    $this->_cell_lengths[$j]
                ) {
                    $this->_data[$i][$j] = $this->_strpad($this->_data[$i][$j],
                        $this->_cell_lengths[$j],
                        ' ',
                        $this->_col_align[$j]);
                }
            }

            if ($this->_data[$i] !== self::CONSOLE_TABLE_HORIZONTAL_RULE) {
                $row_begin = $this->_borderVisibility['left']
                    ? $vertical . str_repeat(' ', $this->_padding)
                    : '';
                $row_end = $this->_borderVisibility['right']
                    ? str_repeat(' ', $this->_padding) . $vertical
                    : '';
                $implode_char = str_repeat(' ', $this->_padding) . $vertical
                    . str_repeat(' ', $this->_padding);
                $return[] = $row_begin
                    . implode($implode_char, $this->_data[$i]) . $row_end;
            } elseif (!empty($separator)) {
                $return[] = $separator;
            }

        }

        $return = implode(PHP_EOL, $return);
        if (!empty($separator)) {
            if ($this->_borderVisibility['inner']) {
                $return = $separator . PHP_EOL . $return;
            }
            if ($this->_borderVisibility['bottom']) {
                $return .= PHP_EOL . $separator;
            }
        }
        $return .= PHP_EOL;

        if (!empty($this->_headers)) {
            $return = $this->_getHeaderLine() . PHP_EOL . $return;
        }

        return $return;
    }
497291
public static function table()
	{
		$class = get_called_class();

		// Table name unknown
		if ( ! array_key_exists($class, static::$_table_names_cached))
		{
			// Table name set in Model
			if (property_exists($class, '_table_name'))
			{
				static::$_table_names_cached[$class] = static::$_table_name;
			}
			else
			{
				static::$_table_names_cached[$class] = \Inflector::tableize($class);
			}
		}

		return static::$_table_names_cached[$class];
	}
868179
public function build()
	{
		$a = explode("<span class=\"info\">", $this->raw, 2);
		if (isset($a[1])) {
			/**
			 * Get title.
			 */
			$b = explode("<div class=\"title\">", $a[1], 2);
			$b = explode("</div>", $b[1], 2);
			$this->info['title'] = static::e($b[0]);

			/**
			 * Table adaptation.
			 */
			$a = explode("<tbody>", $a[1], 2);
			$a = explode("</tbody>", $a[1], 2);

			/**
			 * Build info.
			 */
			$b = explode("<tr", $a[0]);
			unset($b[0]);
			if (count($b) > 1) {
				foreach ($b as $val) {
					$c = explode("<td>", $val, 2);
					if (isset($c[1])) {
						$c = explode("</td>", $c[1], 2);
						$d = explode("<ul class=\"list-inline gallery-info-list\">", $c[1], 2);
						if (! isset($d[1])) {
							$d = explode("<td>", $c[1], 2);
							$d = explode("</td>", $d[1], 2);
							$c[0] = static::e($c[0]);
							$this->info[$c[0]] = $c[0] === "Pages" ? (int) $d[0] : static::e(strip_tags($d[0]));
						} else {
							$d = explode("</ul>", $d[1], 2);
							$d = explode("<li", $d[0]);
							unset($d[0]);
							foreach ($d as $vax) {
								$vax = explode("<a href=\"", $vax);
								$vax = explode(">", $vax[1], 2);
								$vax = explode("<", $vax[1], 2);
								$this->info[static::e($c[0])][] = static::e($vax[0]);
							}
						}
					}
				}
			} else {
				throw new PururinException("Error Building Cover Info", 1);
			}
		}
		$ch = new Curl("http://pururin.us/assets/images/data/".$this->ins->id."/cover.jpg");
		$ch->setOpt(
			[
				CURLOPT_FOLLOWLOCATION => true,
				CURLOPT_REFERER => $this->ins->url
			]
		);
		$this->binary = $ch->exec();
		return true;
	}
267877
public function generate()
    {
        $result = '';

        $table = $this->buildTable();
        $where = $this->buildWhere();

        $result .= 'DELETE FROM '.$table;

        if ($where != '') {
            $result .= ' '.$where;
        }

        return $result;
    }
346249
private function buildConversionTable()
    {
        if ($this->source->getRadix() > $this->target->getRadix()) {
            return $this->createTable($this->source->getDigitList(), $this->target->getDigitList());
        }

        return array_flip($this->createTable($this->target->getDigitList(), $this->source->getDigitList()));
    }
890847
protected function _table()
    {
        return $this->_controller()
            ->loadModel(
                null,
                $this->getConfig('modelFactory') ?: $this->_controller()->getModelType()
            );
    }
419012
private function build() {

        //Check checkbox if needed
        if(true === $this -> filled) {

            if(true === isset($this -> attributes['name'])) {

                if(true === Request :: isPost()) {

                    if(null !== Request :: fromPost($this -> attributes['name'])) {
                        $this -> attributes['checked'] = 'checked';
                    }
                }
            }
        }

        $html = '<input type="'. $this -> type .'"';
        
        foreach($this -> attributes as $attribute => $value) {
            $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
        }

        $html .= '>';

        return $html;
    }
355545
protected function getTable(): Table
    {
        if ($this->table === null) {
            $this->table = new Table($this->output);
        }
        return $this->table;
    }
326754
public function ___build(): string
    {
        $this->escapeClass->doNotEscape($this->namesClass->getAliases());

        $tables = \implode(', ', $this->into);
        $fields = \implode(',', \array_keys($this->fields));
        $values = \implode(',', \array_map([$this->escapeClass, 'escape'], \array_values($this->fields)));

        return \sprintf('INSERT INTO %s (%s) VALUES (%s)', $tables, $fields, $values);
    }
834790
public function getTable()
    {
        if (! isset($this->table)) {
            $this->setTable(str_replace(
                '\\', '', Str::snake(Str::singular(class_basename($this)))
            ));
        }

        return $this->table;
    }
831477
private function generate()
    {
        $schema = [];

        foreach ($this->getTables() as $table) {
            $schema[$table] = $this->getTableDefinition($table);
        };

        foreach (array_keys($schema) as $table) {
            $constraints = $this->driver->getConstraints($table);

            foreach ($constraints as $constraint) {
                if (false === empty($constraint['REF_TABLE'])) {
                    $schema[$table]['properties'][$constraint['REF_TABLE']] = $this->mapConstraint($constraint);
                }
            }
        }

        return $schema;
    }
885684
public function generate()
    {
        /** @var LogTable[] $availableLogTables */
        $availableLogTables = array();

        $this->tables->sort();

        foreach ($this->tables as $i => $table) {
            if (is_array($table)) {

                // join condition provided
                $alias = isset($table['tableAlias']) ? $table['tableAlias'] : $table['table'];

                if (isset($table['join'])) {
                    $this->joinString .= ' ' . $table['join'];
                } else {
                    $this->joinString .= ' LEFT JOIN';
                }

                if (!isset($table['joinOn']) && $this->tables->getLogTable($table['table'])) {
                    $logTable = $this->tables->getLogTable($table['table']);
                    if (!empty($availableLogTables)) {
                        $table['joinOn'] = $this->findJoinCriteriasForTables($logTable, $availableLogTables);
                    }
                    if (!isset($table['tableAlias'])) {
                        // eg array('table' => 'log_link_visit_action', 'join' => 'RIGHT JOIN')
                        // we treat this like a regular string table which we can join automatically
                        $availableLogTables[$table['table']] = $logTable;
                    }
                }

                $this->joinString .= ' ' . Common::prefixTable($table['table']) . " AS " . $alias
                                   . " ON " . $table['joinOn'];
                continue;
            }

            $tableSql = Common::prefixTable($table) . " AS $table";

            $logTable = $this->tables->getLogTable($table);

            if ($i == 0) {
                // first table
                $this->joinString .= $tableSql;
            } else {

                $join = $this->findJoinCriteriasForTables($logTable, $availableLogTables);

                if ($join === null) {
                    $availableLogTables[$table] = $logTable;
                    continue;
                }

                // the join sql the default way
                $this->joinString .= " LEFT JOIN $tableSql ON " . $join;
            }

            $availableLogTables[$table] = $logTable;
        }
    }
1194916
protected function buildStatement(): string
    {
        $this->statementBuilder->addTable($this->table);
        $this->statementBuilder->addCols($this->cols);
        $this->statementBuilder->addWhere($this->where);
        return $this->statementBuilder->getStatement();
    }
676551
public function get_table() {
        $table = new html_table();
        $table->tablealign = 'center';
        $table->cellpadding = 5;
        $table->cellspacing = 0;
        $table->width = '90%';
        $table->align = array('left');
        $table->rotateheaders = true;
        $table->head = array('&#xa0;');
        $table->colclasses = array('');

        // Add role name headers.
        foreach ($this->roles as $targetrole) {
            $table->head[] = $targetrole->localname;
            $table->align[] = 'left';
            if ($this->is_allowed_target($targetrole->id)) {
                $table->colclasses[] = '';
            } else {
                $table->colclasses[] = 'dimmed_text';
            }
        }

        // Now the rest of the table.
        foreach ($this->roles as $fromrole) {
            $row = array($fromrole->localname);
            foreach ($this->roles as $targetrole) {
                $checked = '';
                $disabled = '';
                if ($this->allowed[$fromrole->id][$targetrole->id]) {
                    $checked = 'checked="checked" ';
                }
                if (!$this->is_allowed_target($targetrole->id)) {
                    $disabled = 'disabled="disabled" ';
                }
                $name = 's_' . $fromrole->id . '_' . $targetrole->id;
                $tooltip = $this->get_cell_tooltip($fromrole, $targetrole);
                $row[] = '<input type="checkbox" name="' . $name . '" id="' . $name .
                    '" title="' . $tooltip . '" value="1" ' . $checked . $disabled . '/>' .
                    '<label for="' . $name . '" class="accesshide">' . $tooltip . '</label>';
            }
            $table->data[] = $row;
        }

        return $table;
    }
207722
public function build()
    {
        $options           = $this->suppliedOptions;
        $this->tablePrefix = $this->db->getTablePrefix();
        $nested            = $this->getNestedRelationships($options['relationship']);

        $relevantName      = $nested['pieces'][sizeof($nested['pieces']) - 1];
        $relevantModel     = $nested['models'][sizeof($nested['models']) - 2];
        $options['nested'] = $nested;

        $relationship = $relevantModel->{$relevantName}();
        $selectTable  = $options['column_name'].'_'.$this->tablePrefix.$relationship->getRelated()->getTable();

        //set the relationship object so we can use it later
        $this->relationshipObject = $relationship;

        //replace the (:table) with the generated $selectTable
        $options['select'] = str_replace('(:table)', $selectTable, $options['select']);

        $this->suppliedOptions = $options;
    }
385571
public function build(): string
    {
        $table = $this->quoter->quoteName($this->table);

        $insert = 'INSERT';
        if (!empty($this->priority)) {
            $insert .= ' ' . $this->priority;
        }
        if (!empty($this->ignore)) {
            $insert .= ' ' . $this->ignore;
        }

        if (array_key_exists(0, $this->values)) {
            // multiple rows
            $result = sprintf('%s INTO %s (%s) VALUES', $insert, $table, $this->quoter->quoteFields($this->values[0]));
            foreach ($this->values as $key => $row) {
                $result .= sprintf('%s(%s)', ($key > 0) ? ',' : '', $this->quoter->quoteBulkValues($row));
            }
        } else {
            // single row
            $result = sprintf('%s INTO %s SET %s', $insert, $table, $this->quoter->quoteSetValues($this->values));
        }

        if ($this->duplicateValues) {
            $values = $this->quoter->quoteSetValues($this->duplicateValues);
            $result .= sprintf(' ON DUPLICATE KEY UPDATE %s', $values);
        }
        $result .= ';';

        return $result;
    }
793436
public function build()
    {
        $sql = [
            $this->select->build(),
            $this->from->build(),
            $this->where->build(),
            $this->groupBy->build(),
            $this->having->build(),
            $this->orderBy->build(),
            $this->limit->build(),
            $this->union->build(),
        ];

        $this->values = array_merge(
            $this->where->getValues(),
            $this->having->getValues(),
            $this->union->getValues());

        $sql = implode(' ', array_filter($sql));

        // when there is no select statement then the query
        // is probably just a where subquery, thus does
        // not need to be prefixed with WHERE
        if ('WHERE ' === substr($sql, 0, 6)) {
            return substr($sql, 6);
        }

        return $sql;
    }