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


PHP BookTableMap::getTableMap方法代码示例

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


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

示例1: testSetRelationMapRightAlias

 public function testSetRelationMapRightAlias()
 {
     $bookTable = BookTableMap::getTableMap();
     $join = new ModelJoin();
     $join->setTableMap($bookTable);
     $join->setRelationMap($bookTable->getRelation('Author'), null, 'a');
     $this->assertEquals(array(BookTableMap::COL_AUTHOR_ID), $join->getLeftColumns(), 'setRelationMap() automatically sets the left columns');
     $this->assertEquals(array('a.id'), $join->getRightColumns(), 'setRelationMap() automatically sets the right columns  using the right table alias');
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:9,代码来源:ModelJoinTest.php

示例2: testUseFkQueryTwiceTwoAliases

 public function testUseFkQueryTwiceTwoAliases()
 {
     $q = BookQuery::create()->useAuthorQuery('a')->filterByFirstName('Leo')->endUse()->useAuthorQuery('b')->filterByLastName('Tolstoi')->endUse();
     $join1 = new ModelJoin();
     $join1->setJoinType(Criteria::LEFT_JOIN);
     $join1->setTableMap(AuthorTableMap::getTableMap());
     $join1->setRelationMap(BookTableMap::getTableMap()->getRelation('Author'), null, 'a');
     $join1->setRelationAlias('a');
     $join2 = new ModelJoin();
     $join2->setJoinType(Criteria::LEFT_JOIN);
     $join2->setTableMap(AuthorTableMap::getTableMap());
     $join2->setRelationMap(BookTableMap::getTableMap()->getRelation('Author'), null, 'b');
     $join2->setRelationAlias('b');
     $q1 = BookQuery::create()->addAlias('a', AuthorTableMap::TABLE_NAME)->addJoinObject($join1, 'a')->add('a.FIRST_NAME', 'Leo', Criteria::EQUAL)->addAlias('b', AuthorTableMap::TABLE_NAME)->addJoinObject($join2, 'b')->add('b.LAST_NAME', 'Tolstoi', Criteria::EQUAL);
     $this->assertTrue($q->equals($q1), 'useFkQuery() called twice on the same relation with two aliases creates two joins');
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:16,代码来源:QueryBuilderTest.php

示例3: testReplaceMultipleNames

 /**
  * @dataProvider conditionsForTestReplaceMultipleNames
  */
 public function testReplaceMultipleNames($origClause, $expectedColumns, $modifiedClause)
 {
     $c = new TestableModelCriteria('bookstore', 'Propel\\Tests\\Bookstore\\Book');
     $c->replaceNames($origClause);
     $foundColumns = $c->replacedColumns;
     foreach ($foundColumns as $column) {
         $expectedColumn = BookTableMap::getTableMap()->getColumnByPhpName(array_shift($expectedColumns));
         $this->assertEquals($expectedColumn, $column);
     }
     $this->assertEquals($modifiedClause, $origClause);
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:14,代码来源:ModelCriteriaTest.php

示例4: testIsPrimaryString

 public function testIsPrimaryString()
 {
     $bookTable = BookTableMap::getTableMap();
     $idColumn = $bookTable->getColumn('ID');
     $titleColumn = $bookTable->getColumn('TITLE');
     $isbnColumn = $bookTable->getColumn('ISBN');
     $this->assertFalse($idColumn->isPrimaryString(), 'isPrimaryString() returns false by default.');
     $this->assertTrue($titleColumn->isPrimaryString(), 'isPrimaryString() returns true if set in schema.');
     $this->assertFalse($isbnColumn->isPrimaryString(), 'isPrimaryString() returns false if not set in schema.');
     $titleColumn->setPrimaryString(false);
     $this->assertFalse($titleColumn->isPrimaryString(), 'isPrimaryString() returns false if unset.');
     $titleColumn->setPrimaryString(true);
     $this->assertTrue($titleColumn->isPrimaryString(), 'isPrimaryString() returns true if set.');
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:14,代码来源:ColumnMapTest.php


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