Author: Adam Piotrowski (adam@wellcommerce.org)
Inheritance: implements WellCommerce\Bundle\ClientBundle\Entity\ClientInterface, use trait WellCommerce\Bundle\DoctrineBundle\Entity\IdentifiableTrait, use trait Knp\DoctrineBehaviors\Model\Timestampable\Timestampable, use trait Knp\DoctrineBehaviors\Model\Blameable\Blameable, use trait WellCommerce\Bundle\ShopBundle\Entity\ShopAwareTrait, use trait ClientGroupAwareTrait
Exemplo n.º 1
0
 public function create() : ClientInterface
 {
     $client = new Client();
     $client->setContactDetails($this->contactDetailsFactory->create());
     $client->setClientDetails($this->detailsFactory->create());
     $client->setBillingAddress($this->billingAddressFactory->create());
     $client->setShippingAddress($this->shippingAddressFactory->create());
     $client->setShop($this->shopStorage->getCurrentShop());
     $client->setClientGroup($this->shopStorage->getCurrentShop()->getClientGroup());
     return $client;
 }
Exemplo n.º 2
0
 /**
  * @return \WellCommerce\Bundle\ClientBundle\Entity\ClientInterface
  */
 public function create()
 {
     $client = new Client();
     $client->setAddresses(new ArrayCollection());
     $client->setConditionsAccepted(true);
     $client->setDiscount(0);
     $client->setNewsletterAccepted(true);
     $client->setSalt(base_convert(sha1(uniqid(mt_rand(), true)), 16, 36));
     return $client;
 }