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