当前位置: 首页>>代码示例>>PHP>>正文


PHP Column::getMutatorVisibility方法代码示例

本文整理汇总了PHP中Propel\Generator\Model\Column::getMutatorVisibility方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::getMutatorVisibility方法的具体用法?PHP Column::getMutatorVisibility怎么用?PHP Column::getMutatorVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Propel\Generator\Model\Column的用法示例。


在下文中一共展示了Column::getMutatorVisibility方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()]);
 }
开发者ID:gossi,项目名称:propel-l10n-behavior,代码行数:29,代码来源:L10nBehaviorObjectBuilderModifier.php

示例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    {";
 }
开发者ID:SwissalpS,项目名称:Propel2,代码行数:24,代码来源:ObjectBuilder.php

示例3: 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();
     $script .= "\n    " . $visibility . " function set{$cfc}(\$v)\n    {";
 }
开发者ID:KyleGoslan,项目名称:Huge-Propel,代码行数:12,代码来源:ObjectBuilder.php

示例4: addTemporalMutator

 /**
  * Adds a setter method for date/time/timestamp columns.
  * @param      string &$script The script will be modified in this method.
  * @param      Column $col The current column.
  * @see        parent::addColumnMutators()
  */
 protected function addTemporalMutator(&$script, Column $col)
 {
     $cfc = $col->getPhpName();
     $clo = strtolower($col->getName());
     $visibility = $col->getMutatorVisibility();
     $dateTimeClass = $this->getBuildProperty('dateTimeClass');
     if (!$dateTimeClass) {
         $dateTimeClass = '\\DateTime';
     }
     $this->declareClasses($dateTimeClass, '\\DateTimeZone', '\\Propel\\Runtime\\Util\\PropelDateTime');
     $this->addTemporalMutatorComment($script, $col);
     $this->addMutatorOpenOpen($script, $col);
     $this->addMutatorOpenBody($script, $col);
     $fmt = var_export($this->getTemporalFormatter($col), true);
     $script .= "\n        \$dt = PropelDateTime::newInstance(\$v, null, '{$dateTimeClass}');\n        if (\$this->{$clo} !== null || \$dt !== null) {";
     if (($def = $col->getDefaultValue()) !== null && !$def->isExpression()) {
         $defaultValue = $this->getDefaultValueString($col);
         $script .= "\n            if ( (\$dt != \$this->{$clo}) // normalized values don't match\n                || (\$dt->format({$fmt}) === {$defaultValue}) // or the entered value matches the default\n                 ) {";
     } else {
         $script .= "\n            if (\$dt !== \$this->{$clo}) {";
     }
     $script .= "\n                \$this->{$clo} = \$dt;\n                \$this->modifiedColumns[] = " . $this->getColumnConstant($col) . ";\n            }\n        } // if either are not null\n";
     $this->addMutatorClose($script, $col);
 }
开发者ID:rouffj,项目名称:Propel2,代码行数:30,代码来源:ObjectBuilder.php

示例5: testSetMutatorAndAccessorMethodsVisibility

 public function testSetMutatorAndAccessorMethodsVisibility()
 {
     $column = new Column();
     $column->setAccessorVisibility('private');
     $column->setMutatorVisibility('private');
     $this->assertSame('private', $column->getAccessorVisibility());
     $this->assertSame('private', $column->getMutatorVisibility());
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:8,代码来源:ColumnTest.php

示例6: addMutatorOpenOpen

 /**
  * Adds the mutator function declaration.
  *
  * @param string &$script
  * @param Column $column
  */
 public function addMutatorOpenOpen(&$script, Column $column)
 {
     $cfc = $column->getPhpName();
     $visibility = $column->getMutatorVisibility();
     $script .= "\n    " . $visibility . " function set{$cfc}(\$v)\n    {";
 }
开发者ID:bondarovich,项目名称:Propel2,代码行数:12,代码来源:ObjectBuilder.php


注:本文中的Propel\Generator\Model\Column::getMutatorVisibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。