Builds the table comment
@return void
339319
private function buildTableComment() {
        /** @var ResultSet $results */
        $results = $this->getConfiguration()->getConnection()->query('SHOW TABLE STATUS WHERE Name="' . $this->getTableName() . '"');
        $result = (object)$results->fetch();
        $this->setComment($result->Comment);
    }
376198
public static function commentTable($table, $comment, $connection = null)
	{
		if (is_null($connection)) {
			$connection = DB::connection();
		}

		if ($connection->getDriverName() === 'sqlite') {
			return;
		}

		$connection->statement(
			sprintf(
				'ALTER TABLE `%s` COMMENT = "%s"', $table, addslashes($comment)
			)
		);
	}
331068
public function build()
    {
        $view = $this->getPostsListView();

        $postsPerPage = @$this->viewsData['postsPerPage'] ?: 5;

        $this->pagesData = array_chunk($this->viewsData['blogPosts'], $postsPerPage);

        foreach ($this->pagesData as $pageIndex => $posts) {
            $this->buildPage($pageIndex, $view, $posts);
        }
    }
598020
public function build()
    {
        $value = $this->getValue();

        $this->uppercaseComparator();

        // Check for IS/IS NOT and set the value to NULL if it is.
        if ($this->isComparatorIsNotNullIsNull()) {
            $value = null;
        }

        // Check for IN/NOT IN and build a nice comma-separated list.
        if (!$this->isComparatorIsNotNullIsNull() && $this->isComparatorInNotIn() && is_array($value)) {
            $this->uppercaseComparator();
            $valueArray = [];
            foreach ($value as $valueItem) {
                if ($this->shouldQuoteValues()) {
                    $valueArray[] = $this->query->quote($valueItem);
                } else {
                    $valueArray[] = $valueItem;
                }
            }
            $value = '(' . implode(',', $valueArray) . ')';
        }

        // Now check if we need to still quote the value.
        if (!$this->isComparatorIsNotNullIsNull() && !$this->isComparatorInNotIn() && $this->shouldQuoteValues()) {
            $value = $this->query->quote($value);
        }

        // If we don't have IN/NOT IN, IS/NOT IS, and we shouldn't quote, we assume we're checking fields.
        if ($this->shouldCompareFields()) {
            $valueBuild = [
                $this->query->quoteIdentifier($this->getTableName()),
                '.',
                $this->query->quoteIdentifier($value),
            ];
            $value = implode($valueBuild);
        }

        $tableName = $this->getTableName();
        if ($this->getJoinTableName()) {
            $tableName = $this->getJoinTableName();
        }
        $tableName = $this->query->quoteIdentifier($tableName);

        $returnArray = [
            $tableName . '.' . $this->query->quoteIdentifier($this->getKey()),
            $this->getComparator(),
            $value,
        ];
        $returnString = implode(' ', $returnArray);

        return trim($returnString);
    }
1336453
function createComment() {
    $cnt = count( $this->comment );
     if( 0 >= $cnt )
      return;
    $comment = null;
    foreach( $this->comment as $commentPart ) {
      $attributes = $this->_createParams( $commentPart['params'], array( 'ALTREP', 'LANGUAGE' ));
      $content    = $this->_strrep( $commentPart['value'] );
      $comment   .= $this->_createElement( 'COMMENT', $attributes, $content );
    }
    return $comment;
  }
1105091
public function Generate ()
	{
		
		// If there is a table but no namespace or name
		
		if ($this->get ('table') && (!$this->get ('namespace') || !$this->get ('name')))
		{
			
			// Get namespace and name details from the table name
			
			list ($namespace, $class)	= $this->parser->convertToNamespaceAndClass ($this->get ('table'));
			
			// Set namespace and name
			
			if (!$this->get ('namespace'))
			{
				$this->set ('namespace', $namespace);
			}
			
			if (!$this->get ('name'))
			{
				$this->set ('name', $class);
			}
			
		}
		
		// Start script
		
		$this->addLine ('<?php');
		$this->addLine ();
		
		// Add class comment
		
		$comment	= 
			($this->get ('description')?	$this->get ('description') . "\n\n" : NULL) . 
			($this->get ('author')?			$this->tabVals ('@author',		$this->get ('author'), 4, '') . "\n" : NULL) . 
			($this->get ('email')?			$this->tabVals ('@email',		$this->get ('email'), 4, '') . "\n" : NULL) . 
			($this->get ('link')?			$this->tabVals ('@link',		$this->get ('link'), 4, '') . "\n" : NULL) . 
			($this->get ('copyright')?		$this->tabVals ('@copyright ',	$this->get ('copyright'), 4, '') . "\n" : NULL) . 
			($this->get ('date_created')?	$this->tabVals ('@datecreated',	$this->get ('date_created'), 5, '') . "\n" : NULL);
		
		if (substr ($comment, -1) == "\n")
		{
			$comment	= substr ($comment, 0, -1);
		}
		
		$this->phpdocComment ($comment);
		$this->addLine ();
		$this->phpdocComment ($this->generateProperties ());
		$this->addLine ();
		
		// Define namespace
		
		$this->lineComment ('Define namespace');
		$this->addLine ();
		$this->addLine ('namespace ' . $this->get ('namespace') . ';');
		$this->addLine ();
		
		// Start class
		
		$this->lineComment ('Start ' . $this->get ('name') . ' Class');
		$this->addLine ();
		$this->addLine ('class ' . $this->get ('name') . ' extends ' . $this->get ('extends'));
		$this->addLine ('{');
		$this->tabUp ();
		$this->addLine ();
		
		// Database table

		if ($this->get ('table'))
		{
			$this->phpdocComment ("Database table\n@var string");
			$this->addLine ();
			$this->addLine ('public static $dbTable	= \'' . $this->get ('table') . '\';');
			$this->addLine ();
		}
		
		// Get primary key
		
		$pk	= $this->getPk ();
		
		// If there is a primary key which is different to the default
		
		if (is_array ($pk) && $pk['Field'] !== self::$pk)
		{
			
			// Set it
			
			$this->phpdocComment ("Primary key field\n@var string");
			$this->addLine ();
			$this->addLine ('public static $pk	= \'' . $pk['Field'] . '\';');
			$this->addLine ();
			
		}
		
		// Attributes
		
		$this->phpdocComment ("Class attributes\n@var array");
		$this->addLine ();
		$this->generateAttributes ();
		$this->addLine ();
		
		// Database connection
		// Specify if not the default
		
		if ($this->get ('table') && $this->get ('database') != $this->db->getDatabaseName ())
		{
			
			// Create new database tool

			$db		= new Db;
			
			// Find database resource name from table name
			
			$dbName	= array_search ($this->get ('database'), $db->getDatabases ());
			
			// Set default class database resource
			
			$this->phpdocComment ("Default class resources\n@var array");
			$this->addLine ();
			$this->addLine ('protected static $defaultResources	= array (\'db\' => array (\'db\', \'' . $dbName . '\'));');
			$this->addLine ();
			
		}
		
		// End class
		
		$this->tabDown ();
		$this->addLine ('}');
		$this->addLine ();
		$this->lineComment ('End ' . $this->get ('name') . ' Class');
		
		// Return class
		
		return $this->class;
		
	}
42864
private function buildGetSource() {
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setDescription('This returns the table name');
        $method->setName('getSource');
        $method->setReturnType('string');
        $method->setContent('return \'' . $this->getTableName() . '\';');
        $this->getAbstractClass()->addMethod($method);
    }
45693
def dump_comments(table_name, stream)
      unless (comments = @connection.comments(table_name)).empty?
        comment_statements = comments.map do |row|
          column_name = row[0]
          comment = format_comment(row[1])
          if column_name
            "  set_column_comment '#{table_name}', '#{column_name}', '#{comment}'"
          else
            "  set_table_comment '#{table_name}', '#{comment}'"
          end

        end

        stream.puts comment_statements.join("\n")
        stream.puts
      end
    end
499968
public function build()
    {
        foreach ($this->events as $event => $listeners) {
            foreach ($listeners as $listener) {
                $this->builder->getClassMetadata()->addEntityListener($event, $listener['class'], $listener['method']);
            }
        }
    }
1374700
protected function assemble()
    {
        $this->push($this->replace ? 'REPLACE' : 'INSERT');
        $this->pushIgnoreDelayed();
        $this->push('INTO');
        $this->pushTable();
        $this->push('SET');
        $this->pushValues();
        $this->pushOnDuplicateKeyUpdate();
    }
441101
protected function assemble()
    {
        $this->push('SELECT');
        $this->pushDistinct();
        $this->pushColumns();
        $this->push('FROM');
        $this->pushTable();
        $this->pushHint();
        $this->pushJoin();
        $this->pushWhere();
        $this->pushGroup();
        $this->pushOrder();
        $this->pushLimit();
    }
533894
private function commentColumn($table, $column, $comment)
    {
        $table  = $this->wrapValue($table);
        $table  = $this->connection->getTablePrefix() . $table;
        $column = $this->wrapValue($column);

        $this->connection->statement("comment on column {$table}.{$column} is '{$comment}'");
    }
535122
public function changeComment($comment)
    {
        $this->actions->addAction(new ChangeComment($this->table, $comment));

        return $this;
    }
1164412
public function buildSql()
    {
        $sqlDbMapContent = "# Sqlfile -> Database map\n";
        foreach ($this->getDatabases() as $datasource => $database) {
            $platform = $database->getPlatform();
            $filename = $database->getName() . '.sql';

            if ($this->getGeneratorConfig()->getBuildProperty('disableIdentifierQuoting')) {
                $platform->setIdentifierQuoting(false);
            }

            $ddl = $platform->getAddTablesDDL($database);

            $file = $this->getWorkingDirectory() . DIRECTORY_SEPARATOR . $filename;
            if (file_exists($file) && $ddl == file_get_contents($file)) {
                // Unchanged
            } else {
                file_put_contents($file, $ddl);
            }

            $sqlDbMapContent .= sprintf("%s=%s\n", $filename, $datasource);
        }

        file_put_contents($this->getSqlDbMapFilename(), $sqlDbMapContent);
    }
20508
function getCommentSQL ($xmldb_table) {

        $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table);
        $comment.= " IS '" . $this->addslashes(substr($xmldb_table->getComment(), 0, 250)) . "'";

        return array($comment);
    }
512978
public function build()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $str = '';
        $strFunctions   = '';
        $strListen      = '';
        $strOnload      = '';
        $trigs = $this->getTriggers();
        $this->debug->log('trigs', $trigs);
        foreach ($trigs as $trigName => $trig) {
            $strFunc = $this->buildOnChangeFunc($trig);
            $strFunctions .= $strFunc."\n";
            $strOnload .= "\t".$trig['funcName']."();\n";
            $trigFields = $this->getFieldsWithName($trigName);
            foreach ($trigFields as $field) {
                // Listen to this field && call func when changed
                $strListen .= $this->buildListen($field, $trig['funcName'])."\n";
            }
        }
        if (!empty($strFunctions) || !empty($strListen)) {
            $str = '<script type="text/javascript">'."\n"
                .'//<![CDATA['."\n"
                .'$(function(){'."\n"
                    .'BDKForm.init("#'.$this->form->cfg['attribs']['id'].'");'."\n"
                    .$strFunctions
                    .$strListen
                    .'$(window).on("focus", function() {'."\n"
                        // .'console.log("window focused... re calculating required");'
                        .$strOnload
                    .'});'."\n"
                .'});'."\n"
                .'//]]>'."\n"
                .'</script>';
        }
        $this->debug->log('str!!', $str);
        $this->debug->groupEnd();
        return $str;
    }
1159604
protected function build()
    {
        $sql = "SELECT\n\t"
            . $this->columns . "\n"
            . $this->from . "\n"
            . ($this->join    ? $this->join           : null)
            . ($this->where   ? $this->where . "\n"   : null)
            . ($this->groupby ? $this->groupby . "\n" : null)
            . ($this->orderby ? $this->orderby . "\n" : null)
            . ($this->limit   ? $this->limit . "\n"   : null)
            . ($this->offset  ? $this->offset . "\n"  : null)
            . ";";

        return $sql;
    }