コード例 #1
0
 /**
  * @param int $ownerId
  * @param int $accountUserId
  * @param int $accountId
  * @param QuoteProduct[] $items
  * @param bool $locked
  * @return Quote
  */
 protected function getQuote($ownerId, $accountUserId = null, $accountId = null, array $items = [], $locked = false)
 {
     $quote = new Quote();
     $quote->setOwner($this->getEntity('Oro\\Bundle\\UserBundle\\Entity\\User', $ownerId));
     if (null !== $accountUserId) {
         $quote->setAccountUser($this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUser', $accountUserId));
     }
     if (null !== $accountId) {
         $quote->setAccount($this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\Account', $accountId));
     }
     foreach ($items as $item) {
         $quote->addQuoteProduct($item);
     }
     $quote->setLocked($locked);
     return $quote;
 }