本文整理汇总了PHP中Column::getTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::getTable方法的具体用法?PHP Column::getTable怎么用?PHP Column::getTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Column
的用法示例。
在下文中一共展示了Column::getTable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRemoveColumnDDL
/**
* Builds the DDL SQL to remove a column
*
* @return string
*/
public function getRemoveColumnDDL(Column $column)
{
$pattern = "\nALTER TABLE %s DROP %s;\n";
return sprintf($pattern, $this->quoteIdentifier($column->getTable()->getName()), $this->quoteIdentifier($column->getName()));
}
示例2: getColumnFullIdentifier
/**
* Get the full quoted identifier including database/table name
* @param Column $column
* @return string
*/
public function getColumnFullIdentifier(Column $column)
{
return "{$this->getTableFullIdentifier($column->getTable())}.{$this->getColumnBaseIdentifier($column)}";
}
示例3: getColumnDDL
public function getColumnDDL(Column $col)
{
$domain = $col->getDomain();
$ddl = array($this->quoteIdentifier($col->getName()));
$sqlType = $domain->getSqlType();
$table = $col->getTable();
if ($col->isAutoIncrement() && $table && $table->getIdMethodParameters() == null) {
$sqlType = $col->getType() === PropelTypes::BIGINT ? 'bigserial' : 'serial';
}
if ($this->hasSize($sqlType) && $col->isDefaultSqlType($this)) {
$ddl[] = $sqlType . $domain->printSize();
} else {
$ddl[] = $sqlType;
}
if ($default = $this->getColumnDefaultValueDDL($col)) {
$ddl[] = $default;
}
if ($notNull = $this->getNullString($col->isNotNull())) {
$ddl[] = $notNull;
}
if ($autoIncrement = $col->getAutoIncrementString()) {
$ddl[] = $autoIncrement;
}
return implode(' ', $ddl);
}
示例4: getRuleMessage
/**
* Gets the message for a specified rule.
*
* @param Column $column
* @param string $type
* @param mixed $value
*/
protected function getRuleMessage(Column $column, $type, $value)
{
// create message
$colName = $column->getName();
$tableName = $column->getTable()->getName();
$msg = self::$validatorMessages[strtolower($type)];
$tmp = compact($msg['var']);
array_unshift($tmp, $msg['msg']);
$msg = call_user_func_array('sprintf', $tmp);
return $msg;
}
示例5: getAddColumnDDLBits
public function getAddColumnDDLBits(Column $column)
{
$pattern = "ADD %s %s";
$tableColumns = $column->getTable()->getColumns();
//default to add to top if the before-column cannot be found
$insertPositionDDL = "FIRST";
foreach ($tableColumns as $i => $tableColumn) {
//we found the column, use the column before it, if its not the first
if ($tableColumn->getName() == $column->getName()) {
//we have a column that is not the first column
if ($i > 0) {
$insertPositionDDL = "AFTER " . $this->quoteIdentifier($tableColumns[$i - 1]->getName());
}
break;
}
}
return sprintf($pattern, $this->getColumnDDL($column), $insertPositionDDL);
}
示例6: getAddColumnDDL
/**
* Builds the DDL SQL to remove a column
*
* @return string
*/
public function getAddColumnDDL(Column $column)
{
$pattern = "\r\nALTER TABLE %s ADD %s;\r\n";
return sprintf($pattern, $this->quoteIdentifier($column->getTable()->getName()), $this->getColumnDDL($column));
}