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


PHP EntityManager::getMetadataFactory方法代码示例

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


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

示例1: isEntity

 /**
  * Check object status is enity
  *
  * @param object|string $entity
  * @return bool
  */
 protected function isEntity($entity)
 {
     if (is_object($entity)) {
         $entity = ClassUtils::getClass($entity);
     }
     return !$this->entityManager->getMetadataFactory()->isTransient($entity);
 }
开发者ID:pecinaon,项目名称:doctrine-mapper,代码行数:13,代码来源:BaseMapper.php

示例2: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $schemaTool = new Doctrine\ORM\Tools\SchemaTool($this->em);
         $schemaTool->updateSchema($this->em->getMetadataFactory()->getAllMetadata());
         $output->writeLn('<info>[OK] - BLOG:UPDATE</info>');
         return 0;
         // zero return code means everything is ok
     } catch (\Exception $exc) {
         $output->writeLn('<error>BLOG:UPDATE - ' . $exc->getMessage() . '</error>');
         return 1;
         // non-zero return code means error
     }
 }
开发者ID:krausv,项目名称:www.zeminem.cz,代码行数:14,代码来源:BlogUpdate.php

示例3: setIdentity

 /**
  * Sets the user identity.
  * @return UserStorage Provides a fluent interface
  */
 public function setIdentity(IIdentity $identity = null)
 {
     if ($identity !== NULL) {
         $class = get_class($identity);
         // we want to convert identity entities into fake identity
         // so only the identifier fields are stored,
         // but we are only interested in identities which are correctly
         // mapped as doctrine entities
         if ($this->entityManager->getMetadataFactory()->hasMetadataFor($class)) {
             $cm = $this->entityManager->getClassMetadata($class);
             $identifier = $cm->getIdentifierValues($identity);
             $identity = new FakeIdentity($identifier, $class);
         }
     }
     return parent::setIdentity($identity);
 }
开发者ID:blitzik,项目名称:vycetky-doctrine,代码行数:20,代码来源:UserStorage.php

示例4: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $schemaTool = new Doctrine\ORM\Tools\SchemaTool($this->em);
         $schemaTool->createSchema($this->em->getMetadataFactory()->getAllMetadata());
         $post = new Entity\Post();
         $post->title = 'Vítejte na svém novém blogu!';
         $post->slug = 'vitejte-na-svem-novem-blogu';
         $post->body = 'Instalace proběhla úspěšně. Jupí! (-:';
         $post->date = new \DateTime();
         $post->publish_date = new \DateTime();
         $this->em->persist($post);
         $this->em->flush();
         $output->writeLn('<info>[OK] - BLOG:INSTALL</info>');
         return 0;
         // zero return code means everything is ok
     } catch (\Exception $exc) {
         $output->writeLn('<error>BLOG:INSTALL - ' . $exc->getMessage() . '</error>');
         return 1;
         // non-zero return code means error
     }
 }
开发者ID:krausv,项目名称:www.zeminem.cz,代码行数:22,代码来源:BlogInstall.php


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