public function testAlias()
 {
     $table = new Table("project");
     $this->assertNull($table->getAlias());
     $table->setAlias("pr");
     $this->assertEquals("pr", $table->getAlias());
     $table = new Table(["p" => "project"]);
     $this->assertEquals("p", $table->getAlias());
 }
Exemplo n.º 2
0
 /**
  * @param Table $table
  * @return string
  */
 protected function _renderTableWithAlias(Table $table)
 {
     $alias = $table->getAlias() ? " AS {$this->_renderAlias($table->getAlias())}" : '';
     $schema = $table->getSchema() ? "{$this->_renderTableSchema($table)}." : '';
     return $schema . $this->_renderTableName($table) . $alias;
 }