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


PHP ColumnMap::setPhpName方法代码示例

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


在下文中一共展示了ColumnMap::setPhpName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPrimaryKeys

 public function getPrimaryKeys()
 {
     $cm = new \ColumnMap('id', new \TableMap());
     $cm->setType('INTEGER');
     $cm->setPhpName('Id');
     return array('id' => $cm);
 }
开发者ID:gr-thao,项目名称:jobeet,代码行数:7,代码来源:ItemQuery.php

示例2: testPrimaryStringAddConfiguredColumn

 public function testPrimaryStringAddConfiguredColumn()
 {
     $this->assertFalse($this->tmap->hasPrimaryStringColumn(), 'hasPrimaryStringColumn() returns false while none set.');
     $column = new ColumnMap('BAR', $this->tmap);
     $column->setPhpName('Bar');
     $column->setType('VARCHAR');
     $column->setPrimaryString(true);
     $this->tmap->addConfiguredColumn($column);
     $this->assertTrue($this->tmap->hasPrimaryStringColumn(), 'hasPrimaryStringColumn() returns true after adding pkStr column.');
     $this->assertEquals($column, $this->tmap->getPrimaryStringColumn(), 'getPrimaryStringColumn() returns correct column.');
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:11,代码来源:TableMapTest.php

示例3: addColumn

  /**
   * Add a column to the table.
   *
   * @param      string name A String with the column name.
   * @param      string $type A string specifying the Propel type.
   * @param      boolean $isNotNull Whether column does not allow NULL values.
   * @param      int $size An int specifying the size.
   * @param      boolean $pk True if column is a primary key.
   * @param      string $fkTable A String with the foreign key table name.
   * @param      $fkColumn A String with the foreign key column name.
   * @param      string $defaultValue The default value for this column.
   * @return     ColumnMap The newly created column.
   */
  public function addColumn($name, $phpName, $type, $isNotNull = false, $size = null, $defaultValue = null, $pk = false, $fkTable = null, $fkColumn = null)
  {
    $col = new ColumnMap($name, $this);
    $col->setType($type);
    $col->setSize($size);
    $col->setPhpName($phpName);
    $col->setNotNull($isNotNull);
    $col->setDefaultValue($defaultValue);

    if ($pk) {
      $col->setPrimaryKey(true);
      $this->primaryKeys[$name] = $col;
    }

    if ($fkTable && $fkColumn) {
      $col->setForeignKey($fkTable, $fkColumn);
      $this->foreignKeys[$name] = $col;
    }

    $this->columns[$name] = $col;
    $this->columnsByPhpName[$phpName] = $col;

    return $col;
  }
开发者ID:rhertzog,项目名称:lcs,代码行数:37,代码来源:TableMap.php

示例4: addColumn

 /**
  * Add a column to the table.
  *
  * @param      string name A String with the column name.
  * @param      string $type A string specifying the Propel type.
  * @param      boolean $isNotNull Whether column does not allow NULL values.
  * @param      int $size An int specifying the size.
  * @param      boolean $pk True if column is a primary key.
  * @param      string $fkTable A String with the foreign key table name.
  * @param      $fkColumn A String with the foreign key column name.
  * @param      string $defaultValue The default value for this column.
  * @return     ColumnMap The newly created column.
  */
 public function addColumn($name, $phpName, $type, $isNotNull = false, $size = null, $pk = null, $fkTable = null, $fkColumn = null)
 {
     $col = new ColumnMap($name, $this);
     if ($fkTable && $fkColumn) {
         if (strpos($fkColumn, '.') > 0 && strpos($fkColumn, $fkTable) !== false) {
             $fkColumn = substr($fkColumn, strlen($fkTable) + 1);
         }
         $col->setForeignKey($fkTable, $fkColumn);
     }
     $col->setType($type);
     $col->setPrimaryKey($pk);
     $col->setSize($size);
     $col->setPhpName($phpName);
     $col->setNotNull($isNotNull);
     $this->columns[$name] = $col;
     return $this->columns[$name];
 }
开发者ID:nhemsley,项目名称:propel,代码行数:30,代码来源:TableMap.php

示例5: validFieldNameProvider

 public function validFieldNameProvider()
 {
     $className = '\\Foo\\Book';
     $options = array('foo' => 'bar');
     // table maps
     $emptyTableMap = new \TableMap();
     $authorTable = new \TableMap();
     $authorTable->setClassName('\\Foo\\Author');
     $resellerTable = new \TableMap();
     $resellerTable->setClassName('\\Foo\\Reseller');
     $relationsTableMap = $this->getMock('\\TableMap');
     // relations
     $mainAuthorRelation = new \RelationMap('MainAuthor');
     $mainAuthorRelation->setType(\RelationMap::MANY_TO_ONE);
     $mainAuthorRelation->setForeignTable($authorTable);
     $authorRelation = new \RelationMap('Author');
     $authorRelation->setType(\RelationMap::ONE_TO_MANY);
     $authorRelation->setForeignTable($authorTable);
     $resellerRelation = new \RelationMap('Reseller');
     $resellerRelation->setType(\RelationMap::MANY_TO_MANY);
     $resellerRelation->setLocalTable($resellerTable);
     // configure table maps mocks
     $relationsTableMap->expects($this->any())->method('getRelations')->will($this->returnValue(array($mainAuthorRelation, $authorRelation, $resellerRelation)));
     // columns
     $titleColumn = new \ColumnMap('Title', $emptyTableMap);
     $titleColumn->setType('text');
     $titleColumn->setPhpName('Title');
     $titleFieldMapping = array('id' => false, 'type' => 'text', 'fieldName' => 'Title');
     return array(array(null, array(), $className, 'Title', $options, array('type' => null, 'association_mapping' => null, 'field_mapping' => null)), array($emptyTableMap, array(), $className, 'Title', $options, array('type' => null, 'association_mapping' => null, 'field_mapping' => null)), array($emptyTableMap, array($titleColumn), $className, 'Title', $options, array('type' => 'text', 'association_mapping' => null, 'field_mapping' => $titleFieldMapping)), array($relationsTableMap, array($titleColumn), $className, 'MainAuthor', $options, array('type' => \RelationMap::MANY_TO_ONE, 'association_mapping' => array('targetEntity' => '\\Foo\\Author', 'type' => \RelationMap::MANY_TO_ONE), 'field_mapping' => null)), array($relationsTableMap, array($titleColumn), $className, 'Authors', $options, array('type' => \RelationMap::ONE_TO_MANY, 'association_mapping' => array('targetEntity' => '\\Foo\\Author', 'type' => \RelationMap::ONE_TO_MANY), 'field_mapping' => null)), array($relationsTableMap, array($titleColumn), $className, 'Resellers', $options, array('type' => \RelationMap::MANY_TO_MANY, 'association_mapping' => array('targetEntity' => '\\Foo\\Reseller', 'type' => \RelationMap::MANY_TO_MANY), 'field_mapping' => null)));
 }
开发者ID:kosolapovvp,项目名称:SonataPropelAdminBundle,代码行数:30,代码来源:ModelManagerTest.php


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