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


PHP ClassMetadataInfo::setTableName方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     $this->metadata = new ClassMetadataInfo('\\Foo');
     $this->metadata->setTableName('foo');
     $this->objectManager = m::mock('Doctrine\\Common\\Persistence\\ObjectManager');
     $this->args = new LoadClassMetadataEventArgs($this->metadata, $this->objectManager);
 }
开发者ID:jee7,项目名称:orm,代码行数:7,代码来源:TablePrefixTest.php

示例2: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('page');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\PageRepository');
     $metadata->addLifecycleCallback('setTemplatecontentChecksumOnUpdate', 'prePersist');
     $metadata->addLifecycleCallback('setTemplatecontentChecksumOnUpdate', 'preUpdate');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'prePersist');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'preUpdate');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'templateid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'mediaid', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'description', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'date', 'type' => 'bigint', 'length' => 20));
     $metadata->mapField(array('fieldName' => 'innavigation', 'type' => 'smallint', 'length' => 1));
     $metadata->mapField(array('fieldName' => 'navigationtitle', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'content', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'templatecontent', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'templatecontentchecksum', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'globalcontent', 'type' => 'text', 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'pagetype', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'pageattributes', 'type' => 'text', 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'lastupdate', 'type' => 'bigint', 'default' => 0));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:29,代码来源:Page.php

示例3: loadMetadataForClass

 /**
  * {@inheritdoc}
  */
 public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
 {
     if (null === $this->mappingData) {
         $this->loadMappingData();
     }
     $shortName = $this->getShortName($className);
     if (!isset($this->mappingData[$shortName])) {
         throw new MappingException(sprintf('No mapping found for class "%s".', $className));
     }
     $mapping = array_merge(array('type' => 'entity', 'table' => $this->tableize($shortName), 'readOnly' => false, 'repositoryClass' => null), $this->mappingData[$shortName]);
     switch ($mapping['type']) {
         case 'entity':
             $metadata->setCustomRepositoryClass($mapping['repositoryClass']);
             if ($mapping['readOnly']) {
                 $metadata->markReadOnly();
             }
             break;
         case 'mappedSuperclass':
             $metadata->isMappedSuperclass = true;
             break;
         default:
             throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className);
     }
     $metadata->setTableName($mapping['table']);
     // map fields
     foreach ($mapping['fields'] as $field => $fieldMapping) {
         $this->mapField($field, $fieldMapping, $metadata);
     }
     if (0 === count($metadata->getIdentifier())) {
         $metadata->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true));
     }
 }
开发者ID:ruian,项目名称:KnpRadBundle,代码行数:35,代码来源:YamlDriver.php

示例4: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('user_status');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\UserStatusRepository');
     $metadata->mapField(array('id' => true, 'fieldName' => 'userid', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('id' => true, 'fieldName' => 'authbackend', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'lastlogin', 'type' => 'datetime'));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:12,代码来源:UserStatus.php

示例5: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('user_opt_in');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\OptInRepository');
     $metadata->mapField(array('id' => true, 'fieldName' => 'userid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'unique' => true, 'fieldName' => 'code', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'timestamp', 'type' => 'datetime'));
     $metadata->mapField(array('fieldName' => 'mode', 'type' => 'string', 'length' => 100));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:13,代码来源:OptIn.php

示例6: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('album');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\AlbumRepository');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'prePersist');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'preUpdate');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'lastupdate', 'type' => 'bigint', 'default' => 0));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:15,代码来源:Album.php

示例7: loadMetadata

 /**
  * @param Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('locks');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\LockRepository');
     $metadata->mapField(array('fieldName' => 'userid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'runid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'itemid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'type', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'starttime', 'type' => 'string', 'length' => 20));
     $metadata->mapField(array('fieldName' => 'lastactivity', 'type' => 'string', 'length' => 20));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:16,代码来源:Lock.php

示例8: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata
  */
 public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('user_group');
     $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\GroupRepository');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'prePersist');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'preUpdate');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'rights', 'type' => 'text', 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'users', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'lastupdate', 'type' => 'bigint', 'default' => 0));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:17,代码来源:Group.php

示例9: loadMetadata

 /**
  * @param Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('action_log');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_IDENTITY);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\ActionLogRepository');
     $metadata->mapField(array('id' => true, 'fieldName' => 'logid', 'type' => 'integer', 'generatedValue' => true));
     $metadata->mapField(array('fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'timestamp', 'type' => 'string', 'length' => 20));
     $metadata->mapField(array('fieldName' => 'userlogin', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'action', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'additionalinfo', 'type' => 'text', 'nullable' => true));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:17,代码来源:ActionLog.php

示例10: loadMetadata

 /**
  * @param Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('ticket');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\TicketRepository');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'timestamp', 'type' => 'integer', 'length' => 11));
     $metadata->mapField(array('fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'isredirect', 'type' => 'boolean'));
     $metadata->mapField(array('fieldName' => 'isget', 'type' => 'boolean'));
     $metadata->mapField(array('fieldName' => 'requestconfig', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'ticketlifetime', 'type' => 'integer'));
     $metadata->mapField(array('fieldName' => 'remainingcalls', 'type' => 'integer'));
     $metadata->mapField(array('fieldName' => 'sessionlifetime', 'type' => 'integer', 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'credentials', 'type' => 'text', 'nullable' => true));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:19,代码来源:Ticket.php

示例11: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('user');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\UserRepository');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'prePersist');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'preUpdate');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'lastname', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'firstname', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'password', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'gender', 'type' => 'string', 'length' => 10, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'email', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'language', 'type' => 'string', 'length' => 10, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'issuperuser', 'type' => 'boolean'));
     $metadata->mapField(array('fieldName' => 'isdeletable', 'type' => 'boolean'));
     $metadata->mapField(array('fieldName' => 'lastupdate', 'type' => 'bigint', 'default' => 0));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:21,代码来源:User.php

示例12: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('media_item');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\MediaRepository');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'prePersist');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'preUpdate');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('id' => true, 'fieldName' => 'websiteid', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'dateUploaded', 'type' => 'integer', 'length' => 11, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'filename', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'extension', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'size', 'type' => 'bigint', 'length' => 20, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'lastmod', 'type' => 'string', 'length' => 20, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'file', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'type', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'mimetype', 'type' => 'string', 'length' => 255, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'albumid', 'type' => 'string', 'length' => 100, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'lastupdate', 'type' => 'bigint', 'default' => 0));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:24,代码来源:Media.php

示例13: loadMetadata

 /**
  * @param \Doctrine\ORM\Mapping\ClassMetadataInfo|\Orm\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
  */
 public static function loadMetadata(ORM\ClassMetadataInfo $metadata)
 {
     $metadata->setTableName('website');
     $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE);
     $metadata->setCustomRepositoryClass('Orm\\Repository\\WebsiteRepository');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'prePersist');
     $metadata->addLifecycleCallback('setLastupdateToNow', 'preUpdate');
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'shortid', 'type' => 'string', 'length' => 10));
     $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 255));
     $metadata->mapField(array('fieldName' => 'description', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'navigation', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'publishingenabled', 'type' => 'boolean', 'default' => false));
     $metadata->mapField(array('fieldName' => 'publish', 'type' => 'text', 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'colorscheme', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'resolutions', 'type' => 'text'));
     $metadata->mapField(array('fieldName' => 'version', 'type' => 'integer'));
     $metadata->mapField(array('fieldName' => 'home', 'type' => 'string', 'length' => 100));
     $metadata->mapField(array('fieldName' => 'usedsetid', 'type' => 'string', 'length' => 100, 'nullable' => true));
     $metadata->mapField(array('fieldName' => 'creationmode', 'type' => 'string', 'length' => 10, 'default' => 'full'));
     $metadata->mapField(array('fieldName' => 'ismarkedfordeletion', 'type' => 'boolean'));
     $metadata->mapField(array('fieldName' => 'lastupdate', 'type' => 'bigint', 'default' => 0));
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:26,代码来源:Website.php


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