本文整理匯總了PHP中Propel\Generator\Model\Column::getTypeHint方法的典型用法代碼示例。如果您正苦於以下問題:PHP Column::getTypeHint方法的具體用法?PHP Column::getTypeHint怎麽用?PHP Column::getTypeHint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::getTypeHint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addTranslatedColumnSetter
protected function addTranslatedColumnSetter(Column $column)
{
$visibility = $column->getTable()->isReadOnly() ? 'protected' : $column->getMutatorVisibility();
$typeHint = '';
$null = '';
if ($column->getTypeHint()) {
$typeHint = $column->getTypeHint();
if ('array' !== $typeHint) {
$typeHint = $this->declareClass($typeHint);
}
$typeHint .= ' ';
if (!$column->isNotNull()) {
$null = ' = null';
}
}
$typeHint = "{$typeHint}\$v{$null}";
$i18nTablePhpName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($this->behavior->getI18nTable()));
$tablePhpName = $this->builder->getObjectClassName();
$objectBuilder = $this->builder->getNewObjectBuilder($this->behavior->getI18nTable());
$comment = '';
if ($this->isDateType($column->getType())) {
$objectBuilder->addTemporalMutatorComment($comment, $column);
} else {
$objectBuilder->addMutatorComment($comment, $column);
}
$comment = preg_replace('/^\\t/m', '', $comment);
$comment = str_replace('@return $this|' . $i18nTablePhpName, '@return $this|' . $tablePhpName, $comment);
return $this->renderTemplate('objectTranslatedColumnSetter', ['comment' => $comment, 'column' => $column, 'visibility' => $visibility, 'typeHint' => $typeHint, 'columnPhpName' => $column->getPhpName(), 'localeColumnName' => $this->behavior->getLocaleColumn()->getPhpName()]);
}
示例2: addMutatorOpenOpen
/**
* Adds the mutator function declaration.
*
* @param string &$script
* @param Column $column
*/
public function addMutatorOpenOpen(&$script, Column $column)
{
$cfc = $column->getPhpName();
$visibility = $this->getTable()->isReadOnly() ? 'protected' : $column->getMutatorVisibility();
$typeHint = '';
$null = '';
if ($column->getTypeHint()) {
$typeHint = $column->getTypeHint();
if ('array' !== $typeHint) {
$typeHint = $this->declareClass($typeHint);
}
$typeHint .= ' ';
if (!$column->isNotNull()) {
$null = ' = null';
}
}
$script .= "\n " . $visibility . " function set{$cfc}({$typeHint}\$v{$null})\n {";
}