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


PHP EntityManager::remove方法代码示例

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


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

示例1: removeEntity

 /**
  * @param $entity
  */
 public function removeEntity($entity)
 {
     $this->em->remove($entity);
     $this->em->flush();
     $isFound = $this->em->getRepository(get_class($entity))->findOneBy(['id' => $entity->getId()]);
     $this->assertNull($isFound);
 }
开发者ID:alexjobs,项目名称:Aisel,代码行数:10,代码来源:AbstractWebTestCase.php

示例2: delete

 /**
  * Delete a given article
  * @param Article            $article
  */
 public function delete(Article $article, BusinessEntityPage $bep)
 {
     $this->entityManager->remove($bep);
     $this->entityManager->remove($article);
     //flush the modifications
     $this->entityManager->flush();
 }
开发者ID:Atc-it,项目名称:victoire,代码行数:11,代码来源:ArticleManager.php

示例3: remove

 /**
  * @param $object
  * @param bool $isFlush
  */
 protected function remove($object, $isFlush = false)
 {
     $this->em->remove($object);
     if ($isFlush) {
         $this->em->flush($object);
     }
 }
开发者ID:smart-core,项目名称:module-unicat,代码行数:11,代码来源:UnicatService.php

示例4: delete

 /**
  * @param object $object
  * @param string $flush
  */
 public function delete($object, $flush = true)
 {
     $this->entityManager->remove($object);
     if ($flush) {
         $this->entityManager->flush();
     }
 }
开发者ID:rarekit,项目名称:posit,代码行数:11,代码来源:BrandManager.php

示例5: remove

 /**
  * @param Object $object
  * @param boolean $flush
  */
 public function remove($object, $flush = true)
 {
     $this->em->remove($object);
     if ($flush) {
         $this->em->flush();
     }
 }
开发者ID:Valantir007,项目名称:ForumBundle,代码行数:11,代码来源:BasicManager.php

示例6: delete

 public function delete($invitation, $withFlush = false)
 {
     $this->entityManager->remove($invitation);
     if ($withFlush) {
         $this->entityManager->flush();
     }
 }
开发者ID:adrianoaguiar,项目名称:multi-tenancy-bundle,代码行数:7,代码来源:InvitationHandler.php

示例7: saveObjects

 protected function saveObjects()
 {
     // Product information korábbi elemeinek törlése
     $oldItems = $this->object->getInformation()->toArray();
     if ($oldItems) {
         foreach ($oldItems as $item) {
             $this->entityManager->remove($item);
             $this->object->removeInformation($item);
         }
     }
     // Product information-be új elemek hozzá adása
     if ($this->informationObjects) {
         foreach ($this->informationObjects as $item) {
             $this->object->addInformation($item);
         }
     }
     // Product persist
     $this->entityManager->persist($this->object);
     // Product information persistek
     if ($this->informationObjects) {
         foreach ($this->informationObjects as $object) {
             $this->entityManager->persist($object);
         }
     }
     //Flush
     $this->entityManager->flush();
 }
开发者ID:jarold87,项目名称:pingvin,代码行数:27,代码来源:AssocationTest.php

示例8: remove

 /**
  * {@inheritdoc}
  */
 public function remove(BannerInterface $banner, $save = false)
 {
     $this->em->remove($banner);
     if (true === $save) {
         $this->save();
     }
 }
开发者ID:silvestra,项目名称:silvestra,代码行数:10,代码来源:BannerManager.php

示例9: excluir

 /**
  * @param $id
  * @return integer
  */
 public function excluir($id)
 {
     $entity = $this->em->getReference('Admin\\Domain\\Entity\\OtherEntity', (int) $id);
     $this->em->remove($entity);
     $this->em->flush();
     return (int) $id;
 }
开发者ID:rzorzal,项目名称:MyZend2Skeleton,代码行数:11,代码来源:OtherEntityService.php

示例10: remove

 /**
  * {@inheritdoc}
  */
 public function remove(SeoMetadataInterface $seoMetadata, $save = false)
 {
     $this->em->remove($seoMetadata);
     if (true === $save) {
         $this->save();
     }
 }
开发者ID:silvestra,项目名称:silvestra,代码行数:10,代码来源:SeoMetadataManager.php

示例11: remove

 /**
  * {@inheritdoc}
  */
 public function remove(TreeInterface $tree, $save = false)
 {
     $this->em->remove($tree);
     if (true === $save) {
         $this->save();
     }
 }
开发者ID:aistis-,项目名称:SitemapBundle,代码行数:10,代码来源:TreeManager.php

示例12: remove

 /**
  * {@inheritdoc}
  */
 public function remove(TextNodeInterface $textNode, $save = false)
 {
     $this->em->remove($textNode);
     if (true === $save) {
         $this->save();
     }
 }
开发者ID:silvestra,项目名称:silvestra,代码行数:10,代码来源:TextNodeManager.php

示例13: remove

 /**
  * {@inheritdoc}
  */
 public function remove(SiteInterface $site, $save = false)
 {
     $this->em->remove($site);
     if (true === $save) {
         $this->save();
     }
 }
开发者ID:silvestra,项目名称:silvestra,代码行数:10,代码来源:SiteManager.php

示例14: saveReminders

 /**
  * Save reminders
  *
  * @param RemindableInterface $entity
  */
 public function saveReminders(RemindableInterface $entity)
 {
     // Persist and flush new entity to get id
     if (!($entityId = $this->getEntityIdentifier($entity))) {
         $this->entityManager->persist($entity);
         $this->entityManager->flush($entity);
         $entityId = $this->getEntityIdentifier($entity);
     }
     $reminders = $entity->getReminders();
     $reminderData = $entity->getReminderData();
     $entityClass = $this->getEntityClassName($entity);
     if (!$reminders instanceof RemindersPersistentCollection) {
         foreach ($reminders as $reminder) {
             $this->syncEntityReminder($reminder, $reminderData, $entityClass, $entityId);
             $this->entityManager->persist($reminder);
         }
     } else {
         if ($reminders->isDirty()) {
             foreach ($reminders->getInsertDiff() as $reminder) {
                 $this->entityManager->persist($reminder);
             }
             foreach ($reminders->getDeleteDiff() as $reminder) {
                 $this->entityManager->remove($reminder);
             }
         }
         foreach ($reminders as $reminder) {
             $this->syncEntityReminder($reminder, $reminderData, $entityClass, $entityId);
         }
     }
 }
开发者ID:xamin123,项目名称:platform,代码行数:35,代码来源:ReminderManager.php

示例15: updateInstitutionMedicalCenterListing

 /**
  * @param InstitutionMedicalCenter $center
  */
 function updateInstitutionMedicalCenterListing(InstitutionMedicalCenter $center)
 {
     $institution = $center->getInstitution();
     $criteria = array('institution' => $institution->getId(), 'institutionMedicalCenter' => $center->getId());
     $recentlyApprovedListing = $this->em->getRepository('AdminBundle:RecentlyApprovedListing')->findOneBy($criteria);
     if ($recentlyApprovedListing) {
         if ($center->getStatus() == InstitutionMedicalCenterStatus::APPROVED) {
             $recentlyApprovedListing->setDateUpdated(new \DateTime());
             $this->em->persist($recentlyApprovedListing);
         } else {
             $this->em->remove($recentlyApprovedListing);
         }
         $this->em->flush();
     } else {
         if ($center->getStatus() == InstitutionMedicalCenterStatus::APPROVED) {
             $recentlyApprovedListingService = new RecentlyApprovedListingService();
             $recentlyApprovedListingService->setEntityManager($this->em);
             $recentlyApprovedListing = new RecentlyApprovedListing();
             $recentlyApprovedListing->setInstitution($institution);
             $recentlyApprovedListing->setInstitutionMedicalCenter($center);
             $recentlyApprovedListing->setDateUpdated(new \DateTime());
             $recentlyApprovedListing->setStatus(1);
             $this->em->persist($recentlyApprovedListing);
             $this->em->flush($recentlyApprovedListing);
         }
     }
 }
开发者ID:TMBaay,项目名称:MEDTrip---Healthcareabroad,代码行数:30,代码来源:RecentlyApprovedListingService.php


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