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


PHP ClassMetadataInfo::setCustomRepositoryClass方法代码示例

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


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

示例1: 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

示例2: 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

示例3: loadMetadata

 public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
 {
     $metadata->mapField(array('id' => true, 'fieldName' => 'id', 'type' => 'integer', 'columnName' => 'id'));
     $metadata->mapField(array('fieldName' => 'value', 'type' => 'float'));
     $metadata->isMappedSuperclass = true;
     $metadata->setCustomRepositoryClass("Doctrine\\Tests\\Models\\DDC869\\DDC869PaymentRepository");
     $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_AUTO);
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:8,代码来源:DDC869Payment.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: loadMetadataForClass

 /**
  * {@inheritdoc}
  */
 public function loadMetadataForClass($className, \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
 {
     $element = $this->getElement($className, true);
     // Customizing for Cloudrexx: YamlEntity extension
     if ($element['type'] == 'YamlEntity') {
         $metadata->setCustomRepositoryClass(isset($element['repositoryClass']) ? $element['repositoryClass'] : null);
         $metadata->isMappedSuperclass = true;
     }
     parent::loadMetadataForClass($className, $metadata);
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:13,代码来源:YamlDriver.class.php

示例6: 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

示例7: setCustomRepositoryClasses

 private function setCustomRepositoryClasses(ClassMetadataInfo $metadata)
 {
     foreach ($this->classes as $class) {
         if (array_key_exists('model', $class) && $class['model'] === $metadata->getName()) {
             $metadata->isMappedSuperclass = false;
             if (array_key_exists('repository', $class)) {
                 $metadata->setCustomRepositoryClass($class['repository']);
             }
         }
     }
 }
开发者ID:bcremer,项目名称:Sylius,代码行数:11,代码来源:LoadORMMetadataSubscriber.php

示例8: process

 private function process(ClassMetadataInfo $metadata)
 {
     foreach ($this->classes as $application => $classes) {
         foreach ($classes as $class) {
             if (isset($class['model']) && $class['model'] === $metadata->getName()) {
                 $metadata->isMappedSuperclass = false;
                 if (isset($class['repository'])) {
                     $metadata->setCustomRepositoryClass($class['repository']);
                 }
             } else {
                 if (isset($class['translation']['model']) && $class['translation']['model'] === $metadata->getName()) {
                     $metadata->isMappedSuperclass = false;
                     if (isset($class['translation']['repository'])) {
                         $metadata->setCustomRepositoryClass($class['translation']['repository']);
                     }
                 }
             }
         }
     }
 }
开发者ID:aleherse,项目名称:Sylius,代码行数:20,代码来源:LoadORMMetadataSubscriber.php

示例9: 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

示例10: process

 private function process(ClassMetadataInfo $metadata, $configuration)
 {
     foreach ($this->classes as $entity) {
         if (isset($entity['model']) && $entity['model'] === $metadata->getName()) {
             $metadata->isMappedSuperclass = false;
             //                $this->mergeFieldMappings($metadata, $configuration);
             if (isset($entity['repository'])) {
                 $metadata->setCustomRepositoryClass($entity['repository']);
             }
         }
     }
 }
开发者ID:leonverschuren,项目名称:Cms,代码行数:12,代码来源:LoadORMMetadataSubscriber.php

示例11: convertToEntityIfNeeded

 /**
  * @param ClassMetadataInfo $metadata
  */
 private function convertToEntityIfNeeded(ClassMetadataInfo $metadata)
 {
     foreach ($this->resourceRegistry->getAll() as $alias => $resourceMetadata) {
         if ($metadata->getName() !== $resourceMetadata->getClass('model')) {
             continue;
         }
         if ($resourceMetadata->hasClass('repository')) {
             $metadata->setCustomRepositoryClass($resourceMetadata->getClass('repository'));
         }
         $metadata->isMappedSuperclass = false;
     }
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:15,代码来源:LoadORMMetadataSubscriber.php

示例12: 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

示例13: 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

示例14: toEntity

 /**
  * Transform a mapped superclass into entity if needed.
  *
  * @param ClassMetadataInfo $metadata
  */
 private function toEntity(ClassMetadataInfo $metadata)
 {
     foreach ($this->classes as $name => $class) {
         if (!is_array($class) || $class['class'] != $metadata->getName()) {
             continue;
         }
         if (isset($class['class'])) {
             $metadata->isMappedSuperclass = false;
         }
         if (isset($class['repository_class'])) {
             $metadata->setCustomRepositoryClass($class['repository_class']);
         }
     }
 }
开发者ID:thedarsideofit,项目名称:EkinoWordpressBundle,代码行数:19,代码来源:LoadMetadataSubscriber.php

示例15: 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


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