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


PHP ForeignKey::setRefPhpName方法代码示例

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


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

示例1: VendorInfo

$column63->addVendorInfo(new VendorInfo('mysql', ['Charset' => 'latin1', 'Collate' => 'latin1_general_ci']));
$column64 = new Column('is_published', 'boolean');
$column64->setNotNull();
$column64->setDefaultValue('false');
/* Foreign Keys */
$fkAuthorPost = new ForeignKey('fk_post_has_author');
$fkAuthorPost->addReference('author_id', 'id');
$fkAuthorPost->setForeignTableCommonName('blog_author');
$fkAuthorPost->setRefPhpName('Posts');
$fkAuthorPost->setPhpName('Author');
$fkAuthorPost->setDefaultJoin('Criteria::LEFT_JOIN');
$fkAuthorPost->setOnDelete('CASCADE');
$fkCategoryPost = new ForeignKey('fk_post_has_category');
$fkCategoryPost->addReference('category_id', 'id');
$fkCategoryPost->setForeignTableCommonName('blog_category');
$fkCategoryPost->setRefPhpName('Posts');
$fkCategoryPost->setPhpName('Category');
$fkCategoryPost->setDefaultJoin('Criteria::INNER_JOIN');
$fkCategoryPost->setOnDelete('SETNULL');
$fkPostTag = new ForeignKey('fk_post_has_tags');
$fkPostTag->addReference('post_id', 'id');
$fkPostTag->setForeignTableCommonName('blog_post');
$fkPostTag->setPhpName('Post');
$fkPostTag->setDefaultJoin('Criteria::LEFT_JOIN');
$fkPostTag->setOnDelete('CASCADE');
$fkTagPost = new ForeignKey('fk_tag_has_posts');
$fkTagPost->addReference('tag_id', 'id');
$fkTagPost->setForeignTableCommonName('blog_tag');
$fkTagPost->setPhpName('Tag');
$fkTagPost->setDefaultJoin('Criteria::LEFT_JOIN');
$fkTagPost->setOnDelete('CASCADE');
开发者ID:disider,项目名称:Propel2,代码行数:31,代码来源:blog-database.php

示例2: testSetNames

 public function testSetNames()
 {
     $fk = new ForeignKey();
     $fk->setName('book_author');
     $fk->setPhpName('Author');
     $fk->setRefPhpName('Books');
     $this->assertSame('book_author', $fk->getName());
     $this->assertSame('Author', $fk->getPhpName());
     $this->assertSame('Books', $fk->getRefPhpName());
 }
开发者ID:disider,项目名称:Propel2,代码行数:10,代码来源:ForeignKeyTest.php


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