當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。