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


PHP User::getOrganization方法代码示例

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


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

示例1: onSuccess

 /**
  * "Success" form handler
  *
  * @param RFPRequest $entity
  * @return bool
  */
 protected function onSuccess(RFPRequest $entity)
 {
     $quote = new Quote();
     $quote->setRequest($entity)->setOwner($this->user)->setAccount($entity->getAccount())->setAccountUser($entity->getAccountUser())->setOrganization($this->user->getOrganization());
     foreach ($entity->getRequestProducts() as $requestProduct) {
         $quoteProduct = new QuoteProduct();
         $quoteProduct->setProduct($requestProduct->getProduct())->setType(QuoteProduct::TYPE_REQUESTED)->setCommentAccount($requestProduct->getComment());
         foreach ($requestProduct->getRequestProductItems() as $requestProductItem) {
             $quoteProductRequest = new QuoteProductRequest();
             $quoteProductRequest->setQuantity($requestProductItem->getQuantity())->setPrice($requestProductItem->getPrice())->setProductUnit($requestProductItem->getProductUnit())->setRequestProductItem($requestProductItem);
             $quoteProduct->addQuoteProductRequest($quoteProductRequest);
             $quoteProductOffer = new QuoteProductOffer();
             $quoteProductOffer->setQuantity($requestProductItem->getQuantity())->setProductUnit($requestProductItem->getProductUnit())->setPriceType(QuoteProductOffer::PRICE_TYPE_UNIT)->setAllowIncrements(true);
             $quoteProduct->addQuoteProductOffer($quoteProductOffer);
         }
         $quote->addQuoteProduct($quoteProduct);
     }
     try {
         $this->manager->persist($quote);
         $this->manager->flush();
         $this->quote = $quote;
     } catch (DBALException $e) {
         $this->exception = $e;
         return false;
     }
     return true;
 }
开发者ID:adam-paterson,项目名称:orocommerce,代码行数:33,代码来源:RequestCreateQuoteHandler.php

示例2: createUserInternalOrigin

 /**
  * @param User                  $emailOwner
  * @param OrganizationInterface $organization
  *
  * @return InternalEmailOrigin
  */
 protected function createUserInternalOrigin(User $emailOwner, OrganizationInterface $organization = null)
 {
     $organization = $organization ? $organization : $emailOwner->getOrganization();
     $originName = InternalEmailOrigin::BAP . '_User_' . $emailOwner->getId();
     $outboxFolder = new EmailFolder();
     $outboxFolder->setType(FolderType::SENT)->setName(FolderType::SENT)->setFullName(FolderType::SENT);
     $origin = new InternalEmailOrigin();
     $origin->setName($originName)->addFolder($outboxFolder)->setOwner($emailOwner)->setOrganization($organization);
     $emailOwner->addEmailOrigin($origin);
     $this->getEntityManager()->persist($origin);
     $this->getEntityManager()->persist($emailOwner);
     return $origin;
 }
开发者ID:northdakota,项目名称:platform,代码行数:19,代码来源:Processor.php

示例3: testOrganization

 public function testOrganization()
 {
     $entity = new User();
     $organization = new Organization();
     $this->assertNull($entity->getOrganization());
     $entity->setOrganization($organization);
     $this->assertSame($organization, $entity->getOrganization());
 }
开发者ID:xamin123,项目名称:platform,代码行数:8,代码来源:UserTest.php

示例4: createCalendarsForNewUser

 /**
  * @param EntityManager $em
  * @param UnitOfWork    $uow
  * @param User          $user
  */
 protected function createCalendarsForNewUser($em, $uow, $user)
 {
     $owningOrganization = $user->getOrganization();
     $this->createCalendar($em, $uow, $user, $owningOrganization);
     foreach ($user->getOrganizations() as $organization) {
         if ($organization->getId() !== $owningOrganization->getId()) {
             $this->createCalendar($em, $uow, $user, $organization);
         }
     }
 }
开发者ID:Maksold,项目名称:platform,代码行数:15,代码来源:EntityListener.php

示例5: getCountNewEmails

 /**
  * Get count new emails
  *
  * @param User $user
  *
  * @return mixed
  */
 public function getCountNewEmails(User $user)
 {
     return $this->createQueryBuilder('e')->select('COUNT(DISTINCT e)')->leftJoin('e.emailUsers', 'eu')->where('eu.organization = :organizationId')->andWhere('eu.owner = :ownerId')->andWhere('eu.seen = :seen')->setParameter('organizationId', $user->getOrganization()->getId())->setParameter('ownerId', $user->getId())->setParameter('seen', false)->getQuery()->getSingleScalarResult();
 }
开发者ID:northdakota,项目名称:platform,代码行数:11,代码来源:EmailRepository.php

示例6: getDefaultUserCalendar

 /**
  * @param User $user
  * @return null|Calendar
  */
 protected function getDefaultUserCalendar(User $user)
 {
     return $this->calendarRepository->findDefaultCalendar($user->getId(), $user->getOrganization()->getId());
 }
开发者ID:startupz,项目名称:platform-1,代码行数:8,代码来源:CreateCalendarEventAction.php


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