Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/core-2209-email-validation-on-newsl…
Browse files Browse the repository at this point in the history
…etter-subscription-and-guest-form
  • Loading branch information
gerner-spryker committed Nov 30, 2017
2 parents 67b2b13 + 2d5d58a commit 9207a0b
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 452 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"spryker/kernel": "^3.0.0",
"spryker/locale": "^3.0.0",
"spryker/mail": "^4.0.0",
"spryker/propel-orm": "^1.0.0",
"spryker/propel-orm": "^1.5.0",
"spryker/sequence-number": "^3.0.0",
"spryker/session": "^3.0.0",
"spryker/symfony": "^3.0.0",
Expand Down
23 changes: 0 additions & 23 deletions src/Spryker/Client/Customer/CustomerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,6 @@
*/
class CustomerClient extends AbstractClient implements CustomerClientInterface
{
/**
* {@inheritdoc}
*
* @api
*
* @param \Generated\Shared\Transfer\CustomerTransfer $customerTransfer
*
* @return bool
*/
public function hasCustomerWithEmailAndPassword(CustomerTransfer $customerTransfer)
{
$customerResponseTransfer = $this->getFactory()
->createZedCustomerStub()
->hasCustomerWithEmailAndPassword($customerTransfer);

$hasCustomer = $customerResponseTransfer->getHasCustomer();
if ($hasCustomer === true) {
$this->setCustomer($customerResponseTransfer->getCustomerTransfer());
}

return $hasCustomer;
}

/**
* {@inheritdoc}
*
Expand Down
13 changes: 0 additions & 13 deletions src/Spryker/Client/Customer/CustomerClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@

interface CustomerClientInterface
{
/**
* Specification:
* - Checks if customer exists in persistent storage by provided email and plain text password.
* - Stores found customer information in session.
*
* @api
*
* @param \Generated\Shared\Transfer\CustomerTransfer $customerTransfer
*
* @return bool
*/
public function hasCustomerWithEmailAndPassword(CustomerTransfer $customerTransfer);

/**
* Specification:
* - Checks if customer exists in persistent storage by provided email and plain text password.
Expand Down
6 changes: 2 additions & 4 deletions src/Spryker/Shared/Customer/CustomerConstants.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ interface CustomerConstants
const CUSTOMER_ANONYMOUS_PATTERN = 'CUSTOMER_ANONYMOUS_PATTERN';
const CUSTOMER_SECURED_PATTERN = 'CUSTOMER_SECURED_PATTERN';

/** @deprecated Use CustomerConstants::BASE_URL_YVES instead */
const HOST_YVES = 'HOST_YVES';

/**
* Base URL for Yves including scheme and port (e.g. http://www.de.demoshop.local:8080)
* Specification:
* - Base URL for Yves including scheme and port (e.g. http://www.de.demoshop.local:8080)
*
* @api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class CustomerAnonymizer implements CustomerAnonymizerInterface
* @param array $customerAnonymizerPlugins
*/
public function __construct(
CustomerQueryContainerInterface
$customerQueryContainer,
CustomerQueryContainerInterface $customerQueryContainer,
CustomerInterface $customerModel,
AddressInterface $addressModel,
array $customerAnonymizerPlugins
Expand Down
17 changes: 4 additions & 13 deletions src/Spryker/Zed/Customer/Business/Customer/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Orm\Zed\Customer\Persistence\SpyCustomerAddress;
use Propel\Runtime\Collection\ObjectCollection;
use Spryker\Zed\Customer\Business\Exception\AddressNotFoundException;
use Spryker\Zed\Customer\Business\Exception\CountryNotFoundException;
use Spryker\Zed\Customer\Business\Exception\CustomerNotFoundException;
use Spryker\Zed\Customer\Dependency\Facade\CustomerToCountryInterface;
use Spryker\Zed\Customer\Dependency\Facade\CustomerToLocaleInterface;
Expand Down Expand Up @@ -352,22 +351,13 @@ protected function getCustomerFromCustomerTransfer(CustomerTransfer $customerTra
}

/**
* @throws \Spryker\Zed\Customer\Business\Exception\CountryNotFoundException
*
* @return int
*/
protected function getCustomerCountryId()
{
$idCountry = $this->countryFacade->getIdCountryByIso2Code($this->getIsoCode());

if ($idCountry === null) {
throw new CountryNotFoundException(sprintf(
'Country not found for ISO code `%s`.',
$this->getIsoCode()
));
}
$countryTransfer = $this->countryFacade->getCountryByIso2Code($this->getIsoCode());

return $idCountry;
return $countryTransfer->getIdCountry();
}

/**
Expand Down Expand Up @@ -465,7 +455,8 @@ protected function retrieveFkCountry(AddressTransfer $addressTransfer)
if (empty($fkCountry)) {
$iso2Code = $addressTransfer->getIso2Code();
if (empty($iso2Code) === false) {
$fkCountry = $this->countryFacade->getIdCountryByIso2Code($iso2Code);
$countryTransfer = $this->countryFacade->getCountryByIso2Code($iso2Code);
$fkCountry = $countryTransfer->getIdCountry();
} else {
$fkCountry = $this->getCustomerCountryId();
}
Expand Down
20 changes: 2 additions & 18 deletions src/Spryker/Zed/Customer/Business/CustomerFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,6 @@ public function confirmRegistration(CustomerTransfer $customerTransfer)
->confirmRegistration($customerTransfer);
}

/**
* {@inheritdoc}
*
* @api
*
* @deprecated Use CustomerFacade::sendPasswordRestoreMail() instead
*
* @param \Generated\Shared\Transfer\CustomerTransfer $customerTransfer
*
* @return \Generated\Shared\Transfer\CustomerResponseTransfer
*/
public function forgotPassword(CustomerTransfer $customerTransfer)
{
return $this->sendPasswordRestoreMail($customerTransfer);
}

/**
* {@inheritdoc}
*
Expand Down Expand Up @@ -431,7 +415,7 @@ public function tryAuthorizeCustomerByEmailAndPassword(CustomerTransfer $custome
*/
public function saveCustomerForOrder(
QuoteTransfer $quoteTransfer,
CheckoutResponseTransfer $checkoutResponseTransfer
CheckoutResponseTransfer $checkoutResponseTransfer
) {
$this->getFactory()->createCustomerOrderSaver()->saveOrder($quoteTransfer, $checkoutResponseTransfer);
}
Expand All @@ -448,7 +432,7 @@ public function saveCustomerForOrder(
*/
public function checkOrderPreSaveConditions(
QuoteTransfer $quoteTransfer,
CheckoutResponseTransfer $checkoutResponseTransfer
CheckoutResponseTransfer $checkoutResponseTransfer
) {
$this->getFactory()
->createPreConditionChecker()
Expand Down
18 changes: 2 additions & 16 deletions src/Spryker/Zed/Customer/Business/CustomerFacadeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,6 @@ public function registerCustomer(CustomerTransfer $customerTransfer);
*/
public function confirmRegistration(CustomerTransfer $customerTransfer);

/**
* Specification:
* - Sends password restoration link via email using a freshly generated password restoration key.
*
* @api
*
* @deprecated Use sendPasswordRestoreMail() instead
*
* @param \Generated\Shared\Transfer\CustomerTransfer $customerTransfer
*
* @return \Generated\Shared\Transfer\CustomerResponseTransfer
*/
public function forgotPassword(CustomerTransfer $customerTransfer);

/**
* Specification:
* - Sends password restoration link via email using a freshly generated password restoration key.
Expand Down Expand Up @@ -365,7 +351,7 @@ public function tryAuthorizeCustomerByEmailAndPassword(CustomerTransfer $custome
*/
public function saveCustomerForOrder(
QuoteTransfer $quoteTransfer,
CheckoutResponseTransfer $checkoutResponseTransfer
CheckoutResponseTransfer $checkoutResponseTransfer
);

/**
Expand All @@ -382,7 +368,7 @@ public function saveCustomerForOrder(
*/
public function checkOrderPreSaveConditions(
QuoteTransfer $quoteTransfer,
CheckoutResponseTransfer $checkoutResponseTransfer
CheckoutResponseTransfer $checkoutResponseTransfer
);

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,4 @@ public function indexAction(Request $request)
'form' => $form->createView(),
]);
}

/**
* @return \Generated\Shared\Transfer\CustomerTransfer
*/
protected function createCustomerTransfer()
{
return new CustomerTransfer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,84 +18,6 @@
*/
class AddressController extends AbstractController
{
/**
* @deprecated moved to Customer view page ViewController->indexAction()
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return array
*/
public function indexAction(Request $request)
{
$idCustomerRaw = $request->get(CustomerConstants::PARAM_ID_CUSTOMER);

if (empty($idCustomerRaw)) {
return $this->redirectResponse('/customer');
}

$idCustomer = $this->castId($idCustomerRaw);

$table = $this->getFactory()
->createCustomerAddressTable($idCustomer);

return $this->viewResponse([
'addressTable' => $table->render(),
'idCustomer' => $idCustomer,
]);
}

/**
* @deprecated moved to Customer view page ViewController->indexAction()
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
*/
public function tableAction(Request $request)
{
$idCustomer = $this->castId($request->get(CustomerConstants::PARAM_ID_CUSTOMER));

$table = $this->getFactory()
->createCustomerAddressTable($idCustomer);

return $this->jsonResponse($table->fetchData());
}

/**
* @deprecated Address has no detail page anymore
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return array
*/
public function viewAction(Request $request)
{
$idCustomer = false;
$idCustomerAddress = $this->castId($request->get(CustomerConstants::PARAM_ID_CUSTOMER_ADDRESS));

$customerAddress = $this->createCustomerAddressTransfer();
$customerAddress->setIdCustomerAddress($idCustomerAddress);

$addressDetails = $this->getFacade()
->getAddress($customerAddress);

if (empty($addressDetails) === false) {
$idCustomer = $addressDetails->getFkCustomer();
}

$customerAddressTransfer = $this->createCustomerAddressTransfer();
$customerAddressTransfer->setIdCustomerAddress($idCustomerAddress);

$address = $this->getFacade()
->getAddress($customerAddressTransfer);

return $this->viewResponse([
'address' => $address->toArray(),
'idCustomer' => $idCustomer,
'idCustomerAddress' => $idCustomerAddress,
]);
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*
Expand Down
Loading

0 comments on commit 9207a0b

Please sign in to comment.