for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Author: Nil Portugués Calderó <[email protected]>
* Date: 6/3/14
* Time: 12:07 AM.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NilPortugues\Sql\QueryBuilder\Syntax;
* Class Table.
class Table
{
* @var string
protected $name;
protected $alias;
protected $schema;
* @var bool
protected $view = false;
* @param $name
* @param string $schema
public function __construct($name, $schema = null)
$this->name = $name;
if (!is_null($schema)) {
$this->schema = $schema;
}
* @return string
public function __toString()
return (string) $this->name;
* @param bool $view
* @return $this
public function setView($view)
$this->view = $view;
return $this;
* @return bool
public function isView()
return $this->view;
public function getName()
return $this->name;
public function getAlias()
return $this->alias;
public function getCompleteName()
$alias = ($this->alias) ? " AS {$this->alias}" : '';
$schema = ($this->schema) ? "{$this->schema}." : '';
return $schema.$this->name.$alias;
* @param string $alias
public function setAlias($alias)
$this->alias = $alias;
public function getSchema()
return $this->schema;
* @param string
public function setSchema($schema)