classes/Peyote/Column.php
public function compile()
	{
		$sql = array($this->name);

		$sql[] = $this->length !== null ?
			$this->type."(".$this->length.")" :
			$this->type;

		if ( ! empty($this->options))
		{
			$sql = \array_merge($sql, $this->options);
		}

		if ($this->is_null !== null)
		{
			$sql[] = $this->is_null === true ? "NULL" : "NOT NULL";
		}

		if ($this->default !== null)
		{
			$sql[] = "DEFAULT {$this->default}";
		}

		if ($this->auto_increment === true)
		{
			$sql[] = "AUTO_INCREMENT";
		}

		return join(' ', $sql);
	}
public function compile()
	{
		$sql = array($this->name);

		$sql[] = $this->length !== null ?
			$this->type."(".$this->length.")" :
			$this->type;

		if ( ! empty($this->options))
		{
			$sql = \array_merge($sql, $this->options);
		}

		if ($this->is_null !== null)
		{
			$sql[] = $this->is_null === true ? "NULL" : "NOT NULL";
		}

		if ($this->default !== null)
		{
			$sql[] = "DEFAULT {$this->default}";
		}

		if ($this->auto_increment === true)
		{
			$sql[] = "AUTO_INCREMENT";
		}

		return join(' ', $sql);
	}
public function compile ( ) { $ sql = array ( $ this -> name ) ; $ sql [ ] = $ this -> length !== null ? $ this -> type . "(" . $ this -> length . ")" : $ this -> type ; if ( ! empty ( $ this -> options ) ) { $ sql = \ array_merge ( $ sql , $ this -> options ) ; } if ( $ this -> is_null !== null ) { $ sql [ ] = $ this -> is_null === true ? "NULL" : "NOT NULL" ; } if ( $ this -> default !== null ) { $ sql [ ] = "DEFAULT {$this->default}" ; } if ( $ this -> auto_increment === true ) { $ sql [ ] = "AUTO_INCREMENT" ; } return join ( ' ' , $ sql ) ; }
{@inheritDoc}
{