當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BookPeer::getTableMap方法代碼示例

本文整理匯總了PHP中BookPeer::getTableMap方法的典型用法代碼示例。如果您正苦於以下問題:PHP BookPeer::getTableMap方法的具體用法?PHP BookPeer::getTableMap怎麽用?PHP BookPeer::getTableMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BookPeer的用法示例。


在下文中一共展示了BookPeer::getTableMap方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testSetRelationMapRightAlias

 public function testSetRelationMapRightAlias()
 {
     $bookTable = BookPeer::getTableMap();
     $join = new ModelJoin();
     $join->setTableMap($bookTable);
     $join->setRelationMap($bookTable->getRelation('Author'), null, 'a');
     $this->assertEquals(array(BookPeer::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:ketheriel,項目名稱:ETVA,代碼行數:9,代碼來源:ModelJoinTest.php

示例2: getPhpNameMap

 public static function getPhpNameMap()
 {
     if (self::$phpNameMap === null) {
         $map = BookPeer::getTableMap();
         $columns = $map->getColumns();
         $nameMap = array();
         foreach ($columns as $column) {
             $nameMap[$column->getPhpName()] = $column->getColumnName();
         }
         self::$phpNameMap = $nameMap;
     }
     return self::$phpNameMap;
 }
開發者ID:ajith24,項目名稱:ajithworld,代碼行數:13,代碼來源:BaseBookPeer.php

示例3: testReplaceMultipleNames

 /**
  * @dataProvider conditionsForTestReplaceMultipleNames
  */
 public function testReplaceMultipleNames($origClause, $expectedColumns, $modifiedClause)
 {
     $c = new TestableModelCriteria('bookstore', 'Book');
     $c->replaceNames($origClause);
     $foundColumns = $c->replacedColumns;
     foreach ($foundColumns as $column) {
         $expectedColumn = BookPeer::getTableMap()->getColumnByPhpName(array_shift($expectedColumns));
         $this->assertEquals($expectedColumn, $column);
     }
     $this->assertEquals($modifiedClause, $origClause);
 }
開發者ID:ketheriel,項目名稱:ETVA,代碼行數:14,代碼來源:ModelCriteriaTest.php

示例4: 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(AuthorPeer::getTableMap());
     $join1->setRelationMap(BookPeer::getTableMap()->getRelation('Author'), null, 'a');
     $join1->setRelationAlias('a');
     $join2 = new ModelJoin();
     $join2->setJoinType(Criteria::LEFT_JOIN);
     $join2->setTableMap(AuthorPeer::getTableMap());
     $join2->setRelationMap(BookPeer::getTableMap()->getRelation('Author'), null, 'b');
     $join2->setRelationAlias('b');
     $q1 = BookQuery::create()->addAlias('a', AuthorPeer::TABLE_NAME)->addJoinObject($join1, 'a')->add('a.FIRST_NAME', 'Leo', Criteria::EQUAL)->addAlias('b', AuthorPeer::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:shelsonjava,項目名稱:datawrapper,代碼行數:16,代碼來源:QueryBuilderTest.php

示例5: testGetRelation

 public function testGetRelation()
 {
     set_include_path(get_include_path() . PATH_SEPARATOR . "fixtures/bookstore/build/classes");
     Propel::init('fixtures/bookstore/build/conf/bookstore-conf.php');
     $bookTable = BookPeer::getTableMap();
     $titleColumn = $bookTable->getColumn('TITLE');
     $this->assertNull($titleColumn->getRelation(), 'getRelation() returns null for non-foreign key columns');
     $publisherColumn = $bookTable->getColumn('PUBLISHER_ID');
     $this->assertEquals($publisherColumn->getRelation(), $bookTable->getRelation('Publisher'), 'getRelation() returns the RelationMap object for this foreign key');
     $bookstoreTable = BookstoreEmployeePeer::getTableMap();
     $supervisorColumn = $bookstoreTable->getColumn('SUPERVISOR_ID');
     $this->assertEquals($supervisorColumn->getRelation(), $supervisorColumn->getRelation('Supervisor'), 'getRelation() returns the RelationMap object even whit ha specific refPhpName');
 }
開發者ID:nextbigsound,項目名稱:propel-orm,代碼行數:13,代碼來源:ColumnMapTest.php

示例6: testIsInteger

 public function testIsInteger()
 {
     $bookTable = BookPeer::getTableMap();
     $idColumn = $bookTable->getColumn('id');
     // INTEGER
     $titleColumn = $bookTable->getColumn('title');
     // VARCHAR
     $this->assertTrue($idColumn->isInteger(), 'isInteger() returns true');
     $this->assertFalse($titleColumn->isInteger(), 'isInteger() returns false');
 }
開發者ID:kalaspuffar,項目名稱:php-orm-benchmark,代碼行數:10,代碼來源:ColumnMapTest.php

示例7: testIsPrimaryString

 public function testIsPrimaryString()
 {
     $bookTable = BookPeer::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:keneanung,項目名稱:gw2spidy,代碼行數:14,代碼來源:ColumnMapTest.php


注:本文中的BookPeer::getTableMap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。