diff --git a/CHANGELOG.md b/CHANGELOG.md index 9de4035df5896..80e7697127dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +2.0.0.0-dev67 +============= +* GitHub requests: + * [#235](https://github.com/magento/magento2/issues/235) -- Translation escaping + * [#463](https://github.com/magento/magento2/pull/463) -- allow _resolveArguments to do sequential lookups +* Fixed bugs: + * Fixed an issue where nonexistent store views flat tables cleanuper dropped the catalog_category_flat_cl table + * Fixed an issue where the Product Flat Data indexer used the helpers logic instead of the Flat State logic + * Fixed an issue where an exception was thrown when applying a coupon code + * Fixed an issue where a Shopping Cart Price Rule was applied to the wrong products + * Fixed an issue with the broken Related Orders link on the Recurring Profile page + * Fixed an issue with CMS pages preview not working + * Fixed an issue with a sales report for a store view returning wrong result + * Fixed an issue where shipping did not work for orders containing only bundle products + * Fixed an issue where a custom not found page action did not work + * Fixed an issue where user configuration for a shopping cart rule to stop further rules processing was ignored +* Modularity improvements: + * Resolved dependencies of the Sales module on the RecurringProfile module + * Resolved dependencies of the Email Templates functionality on application modules + * Lib-only dependent components of the Core module moved to library + * CSS URL resolving logic moved from the publisher to a separate CSS pre-processor + * Refactored the View publisher +* Customer Service usage: + * Refactored the Sales module to use Customer service layer + * Refactored the Checkout module to use Customer service layer +* Updated various PHPDoc with the parameter and return types + 2.0.0.0-dev66 ============= * GitHub requests: @@ -17,8 +44,8 @@ * Moved the Billing Agreements functionality to the PayPal module * Finalized the work on resolving dependencies between the Multishipping module, and all other modules. Module can be removed without any impact on the system * Customer Service usage: - * Updated Customer Group Grid to use Customer Service for data retrieving and filtering - * Updated CustomerMetadataService::getAttributeMetadata to throw an exception if invalid code is provided + * Updated Customer Group Grid to use Customer Service for data retrieving and filtering + * Updated CustomerMetadataService::getAttributeMetadata to throw an exception if invalid code is provided * Unified the format of specifying arguments for class constructors in DI and in Layout configuration: * A common xsd schema is being used for defining simple types. Layout and DI customize common types with their specific ones * Argument processing is unified, and moved to library @@ -50,9 +77,12 @@ * [#319] (https://github.com/magento/magento2/issues/319) No message was displayed when product added to shopping cart. * [#367] (https://github.com/magento/magento2/issues/367) Improve the error message from the contact form * [#469] (https://github.com/magento/magento2/issues/469) Can't change prices on different websites for custom options -* Updated the Customer service exception handling, and added tests -* Added usage of the Customer service to the Customer module, replacing some direct usage of the Customer model -* Updated various PHPDoc with the parameter and return types + * [#484] (https://github.com/magento/magento2/pull/484) Calling clear / removeAllItems / removeItemByKey on Magento\Eav\Model\Entity\Collection\AbstractCollection does not remove model from protected _itemsById array + * [#474] (https://github.com/magento/magento2/pull/474) Change for Options Collection class + * [#483] (https://github.com/magento/magento2/pull/483) Update Category.php +* Update Customer Service Exception handling and add tests +* Add usage of Customer Service to Customer Module, replacing some direct usage of Customer Model +* Updated various PHPDoc with parameter and return types 2.0.0.0-dev64 ============= diff --git a/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php b/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php index 88c6cb31ee830..9e2b9c268d9e3 100644 --- a/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php +++ b/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php @@ -32,7 +32,7 @@ * @package Magento_AdminNotification * @author Magento Core Team */ -class Frequency implements \Magento\Core\Model\Option\ArrayInterface +class Frequency implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/AdminNotification/Model/Feed.php b/app/code/Magento/AdminNotification/Model/Feed.php index 89b351fe4f0b6..0e99af975a36b 100644 --- a/app/code/Magento/AdminNotification/Model/Feed.php +++ b/app/code/Magento/AdminNotification/Model/Feed.php @@ -57,8 +57,8 @@ class Feed extends \Magento\Core\Model\AbstractModel protected $_inboxFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Backend\App\ConfigInterface $backendConfig * @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -66,8 +66,8 @@ class Feed extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Backend\App\ConfigInterface $backendConfig, \Magento\AdminNotification\Model\InboxFactory $inboxFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php index 17b6b1540db2e..001d9d8bb6a6e 100644 --- a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php +++ b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php @@ -38,18 +38,18 @@ class Iframe extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php index a9994d45ae294..4b8ea95ba969b 100644 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php @@ -31,19 +31,19 @@ class Payment /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Catalog\Helper\Product $productHelper - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Catalog\Helper\Product $productHelper, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context, $productHelper); diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php index d563f7c4bbd58..1dfcd5c90527a 100644 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php @@ -35,17 +35,17 @@ class Payment extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet.php b/app/code/Magento/Authorizenet/Model/Authorizenet.php index cf9d760eb6176..25dd3b951843d 100644 --- a/app/code/Magento/Authorizenet/Model/Authorizenet.php +++ b/app/code/Magento/Authorizenet/Model/Authorizenet.php @@ -245,7 +245,7 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -257,14 +257,14 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Authorizenet\Helper\Data $authorizenetData * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php b/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php index 76c21f7be489d..3314eeef73efa 100644 --- a/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php +++ b/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php @@ -31,7 +31,7 @@ * * @author Magento Core Team */ -class PaymentAction implements \Magento\Core\Model\Option\ArrayInterface +class PaymentAction implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index 42bf804b6aaf8..a5e807c840b04 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -84,7 +84,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -108,7 +108,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php index 208d052a0fd73..72ac7ec31dd7b 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php @@ -35,10 +35,10 @@ class Observer /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; - + /** * Core helper * @@ -71,7 +71,7 @@ class Observer /** * @param \Magento\Authorizenet\Helper\Data $authorizenetData * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Authorizenet\Model\Directpost $payment * @param \Magento\Authorizenet\Model\Directpost\Session $session * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -79,7 +79,7 @@ class Observer public function __construct( \Magento\Authorizenet\Helper\Data $authorizenetData, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Authorizenet\Model\Directpost $payment, \Magento\Authorizenet\Model\Directpost\Session $session, \Magento\Core\Model\StoreManagerInterface $storeManager diff --git a/app/code/Magento/Authorizenet/i18n/de_DE.csv b/app/code/Magento/Authorizenet/i18n/de_DE.csv index 67ff79e8b55ea..f38994b8eecfd 100644 --- a/app/code/Magento/Authorizenet/i18n/de_DE.csv +++ b/app/code/Magento/Authorizenet/i18n/de_DE.csv @@ -57,7 +57,7 @@ "Payment canceling error.","Fehler bei Zahlungsabbruch." "Payment capturing error.","Fehler bei Zahlungserfassung." "Payment error. Order was not found.","Zahlungsfehler. Bestellung konnte nicht gefunden werden." -"Payment error. Paid amount doesn\'t match the order amount.","Zahlungsfehler. Gezahlter Betrag entspricht nicht dem Rechnungsbetrag." +"Payment error. Paid amount doesn't match the order amount.","Zahlungsfehler. Gezahlter Betrag entspricht nicht dem Rechnungsbetrag." "Payment from Applicable Countries","Bezahlung aus den entsprechenden Ländern" "Payment from Applicable Countries","Zahlung aus geeigneten Ländern" "Payment from Specific Countries","Zahlung aus spezifischen Ländern" diff --git a/app/code/Magento/Authorizenet/i18n/en_US.csv b/app/code/Magento/Authorizenet/i18n/en_US.csv index a9125d4bedd09..1a3d5e3762a3a 100644 --- a/app/code/Magento/Authorizenet/i18n/en_US.csv +++ b/app/code/Magento/Authorizenet/i18n/en_US.csv @@ -47,7 +47,7 @@ "Payment canceling error.","Payment canceling error." "Payment capturing error.","Payment capturing error." "Payment error. Order was not found.","Payment error. Order was not found." -"Payment error. Paid amount doesn\'t match the order amount.","Payment error. Paid amount doesn\'t match the order amount." +"Payment error. Paid amount doesn't match the order amount.","Payment error. Paid amount doesn't match the order amount." "Payment from Applicable Countries","Payment from Applicable Countries" "Payment from Specific Countries","Payment from Specific Countries" "Payment partial authorization error.","Payment partial authorization error." diff --git a/app/code/Magento/Authorizenet/i18n/es_ES.csv b/app/code/Magento/Authorizenet/i18n/es_ES.csv index efd2121126e37..9d3e547329db6 100644 --- a/app/code/Magento/Authorizenet/i18n/es_ES.csv +++ b/app/code/Magento/Authorizenet/i18n/es_ES.csv @@ -58,7 +58,7 @@ "Payment canceling error.","Error en el pago de cancelación." "Payment capturing error.","Error en el pago de retención." "Payment error. Order was not found.","Error de pago. No se encontró el pedido." -"Payment error. Paid amount doesn\'t match the order amount.","Error de pago. El importe pagado no coincide con el importe del pedido." +"Payment error. Paid amount doesn't match the order amount.","Error de pago. El importe pagado no coincide con el importe del pedido." "Payment from Applicable Countries","Pago desde países aceptados" "Payment from Applicable Countries","Pago desde países aplicables" "Payment from Specific Countries","Pago desde países específicos" diff --git a/app/code/Magento/Authorizenet/i18n/fr_FR.csv b/app/code/Magento/Authorizenet/i18n/fr_FR.csv index f5d73e48bdeab..27f8c38ee2709 100644 --- a/app/code/Magento/Authorizenet/i18n/fr_FR.csv +++ b/app/code/Magento/Authorizenet/i18n/fr_FR.csv @@ -57,7 +57,7 @@ "Payment canceling error.","Erreur dans l'annulation du paiement." "Payment capturing error.","Erreur lors de la saisie du paiement" "Payment error. Order was not found.","Erreur de paiement. La commande n'a pas été trouvée." -"Payment error. Paid amount doesn\'t match the order amount.","Erreur de paiement. Le montant payé ne correspond pas au montant de la commande." +"Payment error. Paid amount doesn't match the order amount.","Erreur de paiement. Le montant payé ne correspond pas au montant de la commande." "Payment from Applicable Countries","Paiement depuis les pays applicables" "Payment from Applicable Countries","Paiement depuis les pays disponibles." "Payment from Specific Countries","Paiement depuis les pays spécifiques" diff --git a/app/code/Magento/Authorizenet/i18n/nl_NL.csv b/app/code/Magento/Authorizenet/i18n/nl_NL.csv index f0317f80d31d1..ab578fc138a98 100644 --- a/app/code/Magento/Authorizenet/i18n/nl_NL.csv +++ b/app/code/Magento/Authorizenet/i18n/nl_NL.csv @@ -59,7 +59,7 @@ "Payment canceling error.","Probleem met het annuleren van de betaling." "Payment capturing error.","Fout in het ophalen van de betaling." "Payment error. Order was not found.","Betalingsfout. Bestelling is niet gevonden." -"Payment error. Paid amount doesn\'t match the order amount.","Betalingsfout. Betaalde bedrag is niet hetzelfde als bedrag van bestelling." +"Payment error. Paid amount doesn't match the order amount.","Betalingsfout. Betaalde bedrag is niet hetzelfde als bedrag van bestelling." "Payment from Applicable Countries","Betaling vanuit toegestane landen" "Payment from Applicable Countries","Betaling van Geëigende Landen" "Payment from Specific Countries","Betaling van Specifieke Landen" diff --git a/app/code/Magento/Authorizenet/i18n/pt_BR.csv b/app/code/Magento/Authorizenet/i18n/pt_BR.csv index b659f4fb655f8..94cbdd747e36f 100644 --- a/app/code/Magento/Authorizenet/i18n/pt_BR.csv +++ b/app/code/Magento/Authorizenet/i18n/pt_BR.csv @@ -47,7 +47,7 @@ "Payment canceling error.","Erro de cancelamento de pagamento." "Payment capturing error.","Erro de captura de pagamento." "Payment error. Order was not found.","Erro de pagamento. Ordem não foi encontrada." -"Payment error. Paid amount doesn\'t match the order amount.","Erro de pagamento. Valor pago não corresponde ao valor da ordem." +"Payment error. Paid amount doesn't match the order amount.","Erro de pagamento. Valor pago não corresponde ao valor da ordem." "Payment from Applicable Countries","Pagamento de Países Aplicáveis" "Payment from Specific Countries","Pagamento de Países Específicos" "Payment partial authorization error.","Erro de autorização de pagamento parcial." diff --git a/app/code/Magento/Authorizenet/i18n/zh_CN.csv b/app/code/Magento/Authorizenet/i18n/zh_CN.csv index 3de958434379e..5fb0d1927dbcd 100644 --- a/app/code/Magento/Authorizenet/i18n/zh_CN.csv +++ b/app/code/Magento/Authorizenet/i18n/zh_CN.csv @@ -47,7 +47,7 @@ "Payment canceling error.","取消支付过程出错。" "Payment capturing error.","支付捕获出错。" "Payment error. Order was not found.","支付出错,订单未找到。" -"Payment error. Paid amount doesn\'t match the order amount.","支付错误。付款金额与订单金额不匹配。" +"Payment error. Paid amount doesn't match the order amount.","支付错误。付款金额与订单金额不匹配。" "Payment from Applicable Countries","从可接受的国家支付" "Payment from Specific Countries","从指定的国家支付" "Payment partial authorization error.","支付的部分身份验证出错。" diff --git a/app/code/Magento/Authz/Service/AuthorizationV1.php b/app/code/Magento/Authz/Service/AuthorizationV1.php index 42f51a6942dd3..f85b3a7d5d27d 100644 --- a/app/code/Magento/Authz/Service/AuthorizationV1.php +++ b/app/code/Magento/Authz/Service/AuthorizationV1.php @@ -34,7 +34,7 @@ use Magento\User\Model\Role; use Magento\User\Model\RoleFactory; use Magento\User\Model\RulesFactory; -use Magento\Core\Model\Acl\RootResource as RootAclResource; +use Magento\Acl\RootResource as RootAclResource; /** * Authorization service. diff --git a/app/code/Magento/Authz/etc/module.xml b/app/code/Magento/Authz/etc/module.xml index f2e3eefbc760e..3f91c1382b6b3 100644 --- a/app/code/Magento/Authz/etc/module.xml +++ b/app/code/Magento/Authz/etc/module.xml @@ -26,7 +26,6 @@ - diff --git a/app/code/Magento/Backend/App/Router/DefaultRouter.php b/app/code/Magento/Backend/App/Router/DefaultRouter.php index 1c1d83f5a61b9..2295ce59d23d7 100644 --- a/app/code/Magento/Backend/App/Router/DefaultRouter.php +++ b/app/code/Magento/Backend/App/Router/DefaultRouter.php @@ -69,7 +69,8 @@ class DefaultRouter extends \Magento\Core\App\Router\Base * @param string $routerId * @param \Magento\App\ConfigInterface $coreConfig * @param \Magento\Backend\App\ConfigInterface $backendConfig - * + * @param \Magento\Code\NameBuilder $nameBuilder + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -83,6 +84,7 @@ public function __construct( \Magento\Core\Model\Store\Config $storeConfig, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, $routerId, + \Magento\Code\NameBuilder $nameBuilder, \Magento\App\ConfigInterface $coreConfig, \Magento\Backend\App\ConfigInterface $backendConfig ) { @@ -96,7 +98,8 @@ public function __construct( $storeManager, $storeConfig, $urlSecurityInfo, - $routerId + $routerId, + $nameBuilder ); $this->_coreConfig = $coreConfig; $this->_backendConfig = $backendConfig; @@ -173,6 +176,6 @@ public function getControllerClassName($module, $controller) $parts[] = \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE; $parts[] = $controller; - return \Magento\Core\Helper\String::buildClassName($parts); + return $this->nameBuilder->buildClassName($parts); } } diff --git a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php index d4e506fa7aa9b..e53511f6f22c1 100644 --- a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php +++ b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php @@ -46,7 +46,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\User\Model\UserFactory $userFactory * @param \Magento\Backend\Model\Auth\Session $authSession @@ -54,7 +54,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\User\Model\UserFactory $userFactory, \Magento\Backend\Model\Auth\Session $authSession, diff --git a/app/code/Magento/Backend/Block/System/Cache/Form.php b/app/code/Magento/Backend/Block/System/Cache/Form.php index f665699c45abc..bfb241e43e62b 100644 --- a/app/code/Magento/Backend/Block/System/Cache/Form.php +++ b/app/code/Magento/Backend/Block/System/Cache/Form.php @@ -41,14 +41,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Helper\Data $coreData * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Helper\Data $coreData, array $data = array() diff --git a/app/code/Magento/Backend/Block/System/Config/Form.php b/app/code/Magento/Backend/Block/System/Config/Form.php index d8be9a45baa30..89baf3e2ab6f0 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form.php +++ b/app/code/Magento/Backend/Block/System/Config/Form.php @@ -123,7 +123,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Config\Factory $configFactory * @param \Magento\Backend\Model\Config\Structure $configStructure @@ -134,7 +134,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Config\Factory $configFactory, \Magento\Backend\Model\Config\Structure $configStructure, diff --git a/app/code/Magento/Backend/Block/System/Design/Edit.php b/app/code/Magento/Backend/Block/System/Design/Edit.php index 3a2403bd5ea9f..abfccf831ba7b 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit.php @@ -35,18 +35,18 @@ class Edit extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php index 4f9de6c30cfa6..009d9a903ed68 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php @@ -39,7 +39,7 @@ class General extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\View\Design\Theme\LabelFactory $labelFactory * @param \Magento\Core\Model\System\Store $systemStore @@ -47,7 +47,7 @@ class General extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\View\Design\Theme\LabelFactory $labelFactory, \Magento\Core\Model\System\Store $systemStore, diff --git a/app/code/Magento/Backend/Block/System/Store/Edit.php b/app/code/Magento/Backend/Block/System/Store/Edit.php index f11bee0abbdf6..4aaea1598b12e 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit.php @@ -33,18 +33,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php index 43cf0d2329499..89201999748f5 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php @@ -54,7 +54,7 @@ class Group /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Catalog\Model\Config\Source\Category $category * @param \Magento\Core\Model\StoreFactory $storeFactory @@ -63,7 +63,7 @@ class Group */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Catalog\Model\Config\Source\Category $category, \Magento\Core\Model\StoreFactory $storeFactory, diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php index 61818b498f8e1..3941aaf288f12 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php @@ -49,7 +49,7 @@ class Store /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Store\Group\Factory $groupFactory * @param \Magento\Core\Model\Website\Factory $websiteFactory @@ -57,7 +57,7 @@ class Store */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Store\Group\Factory $groupFactory, \Magento\Core\Model\Website\Factory $websiteFactory, diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php index 54e44698bd4de..663b5f2b8b064 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php @@ -44,14 +44,14 @@ class Website /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Store\GroupFactory $groupFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Store\GroupFactory $groupFactory, array $data = array() diff --git a/app/code/Magento/Backend/Block/System/Variable/Edit.php b/app/code/Magento/Backend/Block/System/Variable/Edit.php index 77d3383005727..73492316d4700 100644 --- a/app/code/Magento/Backend/Block/System/Variable/Edit.php +++ b/app/code/Magento/Backend/Block/System/Variable/Edit.php @@ -33,18 +33,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Backend/Block/Template.php b/app/code/Magento/Backend/Block/Template.php index 1db6abfaf20ea..e2df01f908ed3 100644 --- a/app/code/Magento/Backend/Block/Template.php +++ b/app/code/Magento/Backend/Block/Template.php @@ -58,6 +58,11 @@ class Template extends \Magento\View\Element\Template */ protected $formKey; + /** + * @var \Magento\Code\NameBuilder + */ + protected $nameBuilder; + /** * @param \Magento\Backend\Block\Template\Context $context * @param array $data @@ -71,6 +76,7 @@ public function __construct( $this->mathRandom = $context->getMathRandom(); $this->_backendSession = $context->getBackendSession(); $this->formKey = $context->getFormKey(); + $this->nameBuilder = $context->getNameBuilder(); parent::__construct($context, $data); } @@ -100,13 +106,13 @@ public function isOutputEnabled($moduleName = null) } return !$this->_storeConfig->getConfigFlag('advanced/modules_disable_output/' . $moduleName); } - + /** * Make this public so that templates can use it properly with template engine - * + * * @return \Magento\AuthorizationInterface */ - public function getAuthorization() + public function getAuthorization() { return $this->_authorization; } diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index 02a4259018653..406d4b42b2b1e 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -49,7 +49,12 @@ class Context extends \Magento\View\Element\Template\Context * @var \Magento\Data\Form\FormKey */ protected $formKey; - + + /** + * @var \Magento\Code\NameBuilder + */ + protected $nameBuilder; + /** * @param \Magento\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout @@ -79,8 +84,9 @@ class Context extends \Magento\View\Element\Template\Context * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Math\Random $mathRandom * @param \Magento\Data\Form\FormKey $formKey + * @param \Magento\Code\NameBuilder $nameBuilder * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -112,12 +118,14 @@ public function __construct( \Magento\Backend\Model\Session $backendSession, \Magento\Math\Random $mathRandom, \Magento\Data\Form\FormKey $formKey, + \Magento\Code\NameBuilder $nameBuilder, array $data = array() ) { $this->_authorization = $authorization; $this->_backendSession = $backendSession; $this->mathRandom = $mathRandom; $this->formKey = $formKey; + $this->nameBuilder = $nameBuilder; parent::__construct( $request, $layout, @@ -198,4 +206,12 @@ public function getFormKey() { return $this->formKey; } + + /** + * @return \Magento\Data\Form\FormKey + */ + public function getNameBuilder() + { + return $this->nameBuilder; + } } diff --git a/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php b/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php index 33656740e9b1f..4f4534b33349b 100644 --- a/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php +++ b/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php @@ -71,7 +71,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory @@ -81,7 +81,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\CategoryFactory $categoryFactory, diff --git a/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Edit/Form.php b/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Edit/Form.php index 8851881ab15ed..0b5daa4f3704d 100644 --- a/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Edit/Form.php +++ b/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Edit/Form.php @@ -62,7 +62,7 @@ class Form extends \Magento\Backend\Block\Urlrewrite\Edit\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory * @param \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory @@ -78,7 +78,7 @@ class Form extends \Magento\Backend\Block\Urlrewrite\Edit\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory, diff --git a/app/code/Magento/Backend/Block/Urlrewrite/Cms/Page/Edit/Form.php b/app/code/Magento/Backend/Block/Urlrewrite/Cms/Page/Edit/Form.php index 21946e8581938..b2d863e56f596 100644 --- a/app/code/Magento/Backend/Block/Urlrewrite/Cms/Page/Edit/Form.php +++ b/app/code/Magento/Backend/Block/Urlrewrite/Cms/Page/Edit/Form.php @@ -55,7 +55,7 @@ class Form extends \Magento\Backend\Block\Urlrewrite\Edit\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory * @param \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory @@ -70,7 +70,7 @@ class Form extends \Magento\Backend\Block\Urlrewrite\Edit\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory, diff --git a/app/code/Magento/Backend/Block/Urlrewrite/Edit/Form.php b/app/code/Magento/Backend/Block/Urlrewrite/Edit/Form.php index 3bf8165897099..dbb83a8c0141a 100644 --- a/app/code/Magento/Backend/Block/Urlrewrite/Edit/Form.php +++ b/app/code/Magento/Backend/Block/Urlrewrite/Edit/Form.php @@ -89,7 +89,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory * @param \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory @@ -102,7 +102,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory, diff --git a/app/code/Magento/Backend/Block/Widget/Form/Container.php b/app/code/Magento/Backend/Block/Widget/Form/Container.php index 7e12d739fd22f..cd55df72c13c9 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Container.php @@ -125,7 +125,7 @@ protected function _prepareLayout() */ protected function _buildFormClassName() { - return \Magento\Core\Helper\String::buildClassName(array( + return $this->nameBuilder->buildClassName(array( $this->_blockGroup, 'Block', $this->_controller, diff --git a/app/code/Magento/Backend/Block/Widget/Form/Generic.php b/app/code/Magento/Backend/Block/Widget/Form/Generic.php index 3ca9484e66af4..ac8e2bb1d65b8 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Generic.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Generic.php @@ -43,19 +43,19 @@ class Generic extends \Magento\Backend\Block\Widget\Form /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, array $data = array() ) { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php index d4f2006b8daf7..c9f3e8fcd15a8 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php @@ -36,14 +36,14 @@ class Additional extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\View\Layout\Argument\Interpreter\Options $optionsInterpreter * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\View\Layout\Argument\Interpreter\Options $optionsInterpreter, array $data = array() diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php index 3e52c3cc4496f..c5e6908a7e360 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php @@ -32,7 +32,7 @@ class Design extends Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -43,12 +43,12 @@ class Design extends Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Core\Filter\Date $dateFilter */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Core\Filter\Date $dateFilter ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php index f2c28135d3850..34cfdcb6a76de 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php @@ -39,7 +39,7 @@ class Store extends Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -50,12 +50,12 @@ class Store extends Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Filter\FilterManager $filterManager */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Filter\FilterManager $filterManager ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php index ceacf3557d669..00b9d4fa88bd5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php @@ -39,17 +39,17 @@ class Variable extends Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php index 36bc7a2e60f90..8662f6e8da7ba 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php @@ -52,8 +52,8 @@ class Custom extends \Magento\Core\Model\Config\Value protected $_configWriter; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\App\Config\Storage\WriterInterface $configWriter @@ -62,8 +62,8 @@ class Custom extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\App\Config\Storage\WriterInterface $configWriter, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php index 1eea1145c89bc..aa1b56c67f3cc 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php @@ -38,7 +38,7 @@ class Observer /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -59,14 +59,14 @@ class Observer /** * @param \Magento\Backend\Helper\Data $backendData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Backend\Model\Auth\Session $authSession * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Backend\Helper\Data $backendData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Core\Model\App $app, \Magento\Core\Model\StoreManagerInterface $storeManager diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php index 1549e350d6e82..bcb813ac243b6 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php @@ -42,8 +42,8 @@ class Robots extends \Magento\Core\Model\Config\Value protected $_file; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\App\Filesystem $filesystem @@ -52,8 +52,8 @@ class Robots extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\App\Filesystem $filesystem, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php index 456c090a35635..af9ee8e6b1354 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php @@ -40,8 +40,8 @@ class Usecustom extends \Magento\Core\Model\Config\Value protected $_configWriter; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\App\Config\Storage\WriterInterface $configWriter @@ -50,8 +50,8 @@ class Usecustom extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\App\Config\Storage\WriterInterface $configWriter, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php index 639ad905e6c5f..a067e696abd2f 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php @@ -37,8 +37,8 @@ class Usesecretkey extends \Magento\Core\Model\Config\Value protected $_backendUrl; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Backend\Model\UrlInterface $backendUrl @@ -47,8 +47,8 @@ class Usesecretkey extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Backend\Model\UrlInterface $backendUrl, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php index d57aa466d5960..76689c4988b57 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php @@ -31,8 +31,8 @@ class Baseurl extends \Magento\Core\Model\Config\Value protected $_mergeService; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\View\Asset\MergeService $mergeService @@ -41,8 +41,8 @@ class Baseurl extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\View\Asset\MergeService $mergeService, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php index 0378619ca6c90..e471b6fee474f 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php @@ -48,8 +48,8 @@ abstract class AbstractCurrency extends \Magento\Core\Model\Config\Value /** * Constructor * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -58,8 +58,8 @@ abstract class AbstractCurrency extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Store\Config $coreStoreConfig, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php index 323ccf82df0cf..502e3d9daf448 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php @@ -38,8 +38,8 @@ class Allow extends AbstractCurrency protected $_locale; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -49,8 +49,8 @@ class Allow extends AbstractCurrency * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Store\Config $coreStoreConfig, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php index 74e69679fa51c..e76e973d53865 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php @@ -39,8 +39,8 @@ class Cron extends \Magento\Core\Model\Config\Value protected $_configValueFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory @@ -49,8 +49,8 @@ class Cron extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php b/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php index 2f052eeef0721..ed8fc844a32a0 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php @@ -37,8 +37,8 @@ class Encrypted protected $_encryptor; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Encryption\EncryptorInterface $encryptor @@ -47,8 +47,8 @@ class Encrypted * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Encryption\EncryptorInterface $encryptor, diff --git a/app/code/Magento/Backend/Model/Config/Backend/File.php b/app/code/Magento/Backend/Model/Config/Backend/File.php index 78c9a5ef6b25d..61342b3c1d8e1 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/File.php +++ b/app/code/Magento/Backend/Model/Config/Backend/File.php @@ -61,8 +61,8 @@ class File extends \Magento\Core\Model\Config\Value protected $_uploaderFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory @@ -73,8 +73,8 @@ class File extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\File\UploaderFactory $uploaderFactory, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php b/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php index ec2216bebc15b..4ac4e8b5103d8 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php @@ -42,8 +42,8 @@ class Adapter extends \Magento\Core\Model\Config\Value protected $_imageFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Image\AdapterFactory $imageFactory @@ -52,8 +52,8 @@ class Adapter extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Image\AdapterFactory $imageFactory, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Locale.php b/app/code/Magento/Backend/Model/Config/Backend/Locale.php index 1942420a94a33..36b304696b0af 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Locale.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Locale.php @@ -52,8 +52,8 @@ class Locale extends \Magento\Core\Model\Config\Value protected $_storeFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Resource\Config\Data\CollectionFactory $configsFactory @@ -67,8 +67,8 @@ class Locale extends \Magento\Core\Model\Config\Value * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Resource\Config\Data\CollectionFactory $configsFactory, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php b/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php index 706b9915b1171..50711b3d56a99 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php @@ -45,8 +45,8 @@ class Cron extends \Magento\Core\Model\Config\Value protected $_runModelPath = ''; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory @@ -56,8 +56,8 @@ class Cron extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Secure.php b/app/code/Magento/Backend/Model/Config/Backend/Secure.php index 9df57bb89290f..27a35ca25419f 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Secure.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Secure.php @@ -31,8 +31,8 @@ class Secure extends \Magento\Core\Model\Config\Value protected $_mergeService; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\View\Asset\MergeService $mergeService @@ -41,8 +41,8 @@ class Secure extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\View\Asset\MergeService $mergeService, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php index afa74d82e774f..4e034da610a40 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php @@ -37,8 +37,8 @@ class Database extends \Magento\Core\Model\Config\Value protected $_coreFileStorage = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Helper\File\Storage $coreFileStorage @@ -47,8 +47,8 @@ class Database extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Helper\File\Storage $coreFileStorage, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Translate.php b/app/code/Magento/Backend/Model/Config/Backend/Translate.php index d4a7279d46077..a8633e64f70d0 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Translate.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Translate.php @@ -53,8 +53,8 @@ class Translate extends \Magento\Core\Model\Config\Value /** * Constructor * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -64,8 +64,8 @@ class Translate extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Store\Config $coreStoreConfig, diff --git a/app/code/Magento/Backend/Model/Config/Source/Admin/Page.php b/app/code/Magento/Backend/Model/Config/Source/Admin/Page.php index b646800c5c452..9cf451b43384c 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Admin/Page.php +++ b/app/code/Magento/Backend/Model/Config/Source/Admin/Page.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Source\Admin; -class Page implements \Magento\Core\Model\Option\ArrayInterface +class Page implements \Magento\Option\ArrayInterface { /** * Menu model diff --git a/app/code/Magento/Backend/Model/Config/Source/Checktype.php b/app/code/Magento/Backend/Model/Config/Source/Checktype.php index 581d1f7db72bd..333938f14896f 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Checktype.php +++ b/app/code/Magento/Backend/Model/Config/Source/Checktype.php @@ -34,7 +34,7 @@ */ namespace Magento\Backend\Model\Config\Source; -class Checktype implements \Magento\Core\Model\Option\ArrayInterface +class Checktype implements \Magento\Option\ArrayInterface { /** * Retrieve Check Type Option array diff --git a/app/code/Magento/Backend/Model/Config/Source/Currency.php b/app/code/Magento/Backend/Model/Config/Source/Currency.php index 14246d1c9ccb1..41ad819e5404f 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Currency.php +++ b/app/code/Magento/Backend/Model/Config/Source/Currency.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Source; -class Currency implements \Magento\Core\Model\Option\ArrayInterface +class Currency implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Backend/Model/Config/Source/Date/Short.php b/app/code/Magento/Backend/Model/Config/Source/Date/Short.php index 7ba4596e0c0cf..4361c3867d00e 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Date/Short.php +++ b/app/code/Magento/Backend/Model/Config/Source/Date/Short.php @@ -27,7 +27,7 @@ namespace Magento\Backend\Model\Config\Source\Date; -class Short implements \Magento\Core\Model\Option\ArrayInterface +class Short implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Design/Robots.php b/app/code/Magento/Backend/Model/Config/Source/Design/Robots.php index d879e4fee49c0..c0934ba3b0631 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Design/Robots.php +++ b/app/code/Magento/Backend/Model/Config/Source/Design/Robots.php @@ -27,7 +27,7 @@ namespace Magento\Backend\Model\Config\Source\Design; -class Robots implements \Magento\Core\Model\Option\ArrayInterface +class Robots implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php b/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php index 26b2b3bc53399..bd7ce11ec7258 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php +++ b/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Source\Dev; -class Dbautoup implements \Magento\Core\Model\Option\ArrayInterface +class Dbautoup implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Email/Identity.php b/app/code/Magento/Backend/Model/Config/Source/Email/Identity.php index d7e677ce91df2..bcf9308800717 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Email/Identity.php +++ b/app/code/Magento/Backend/Model/Config/Source/Email/Identity.php @@ -27,7 +27,7 @@ namespace Magento\Backend\Model\Config\Source\Email; -class Identity implements \Magento\Core\Model\Option\ArrayInterface +class Identity implements \Magento\Option\ArrayInterface { /** * Email Identity options diff --git a/app/code/Magento/Backend/Model/Config/Source/Email/Method.php b/app/code/Magento/Backend/Model/Config/Source/Email/Method.php index a6c569ecaa57f..77adaf68fff54 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Email/Method.php +++ b/app/code/Magento/Backend/Model/Config/Source/Email/Method.php @@ -34,7 +34,7 @@ */ namespace Magento\Backend\Model\Config\Source\Email; -class Method implements \Magento\Core\Model\Option\ArrayInterface +class Method implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Email/Smtpauth.php b/app/code/Magento/Backend/Model/Config/Source/Email/Smtpauth.php index 5706498c3cb11..e3766ce86f25e 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Email/Smtpauth.php +++ b/app/code/Magento/Backend/Model/Config/Source/Email/Smtpauth.php @@ -27,7 +27,7 @@ namespace Magento\Backend\Model\Config\Source\Email; -class Smtpauth implements \Magento\Core\Model\Option\ArrayInterface +class Smtpauth implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Email/Template.php b/app/code/Magento/Backend/Model/Config/Source/Email/Template.php index 9d304653b0bc0..b409f338288a2 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Email/Template.php +++ b/app/code/Magento/Backend/Model/Config/Source/Email/Template.php @@ -24,10 +24,10 @@ namespace Magento\Backend\Model\Config\Source\Email; class Template extends \Magento\Object - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ private $_coreRegistry; @@ -42,13 +42,13 @@ class Template extends \Magento\Object protected $_templatesFactory; /** - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Email\Model\Resource\Template\CollectionFactory $templatesFactory * @param \Magento\Email\Model\Template\Config $emailConfig * @param array $data */ public function __construct( - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Email\Model\Resource\Template\CollectionFactory $templatesFactory, \Magento\Email\Model\Template\Config $emailConfig, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Source/Enabledisable.php b/app/code/Magento/Backend/Model/Config/Source/Enabledisable.php index 3e5ec55f7edb0..93ec48730a79f 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Enabledisable.php +++ b/app/code/Magento/Backend/Model/Config/Source/Enabledisable.php @@ -27,7 +27,7 @@ namespace Magento\Backend\Model\Config\Source; -class Enabledisable implements \Magento\Core\Model\Option\ArrayInterface +class Enabledisable implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php b/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php index f386ef15f7e1f..116e7a53b16af 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php +++ b/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Source\Image; -class Adapter implements \Magento\Core\Model\Option\ArrayInterface +class Adapter implements \Magento\Option\ArrayInterface { /** * @var \Magento\Image\Adapter\ConfigInterface diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale.php b/app/code/Magento/Backend/Model/Config/Source/Locale.php index ab6b1b4c01892..2dfb3ee4f7ee4 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale.php @@ -23,13 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - + /** * Locale source */ namespace Magento\Backend\Model\Config\Source; -class Locale implements \Magento\Core\Model\Option\ArrayInterface +class Locale implements \Magento\Option\ArrayInterface { /** * @var \Magento\Core\Model\LocaleInterface diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale/Country.php b/app/code/Magento/Backend/Model/Config/Source/Locale/Country.php index 14cd7a18f9c97..995d7431b51e3 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale/Country.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale/Country.php @@ -23,13 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - + /** * Locale country source */ namespace Magento\Backend\Model\Config\Source\Locale; -class Country implements \Magento\Core\Model\Option\ArrayInterface +class Country implements \Magento\Option\ArrayInterface { /** * @var \Magento\Core\Model\LocaleInterface diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale/Currency.php b/app/code/Magento/Backend/Model/Config/Source/Locale/Currency.php index 444c3f6db203a..61949a54a8870 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale/Currency.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale/Currency.php @@ -23,13 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - + /** * Locale currency source */ namespace Magento\Backend\Model\Config\Source\Locale; -class Currency implements \Magento\Core\Model\Option\ArrayInterface +class Currency implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale/Currency/All.php b/app/code/Magento/Backend/Model/Config/Source/Locale/Currency/All.php index fa71072e9e569..1d7a806179287 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale/Currency/All.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale/Currency/All.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Source\Locale\Currency; -class All implements \Magento\Core\Model\Option\ArrayInterface +class All implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale/Timezone.php b/app/code/Magento/Backend/Model/Config/Source/Locale/Timezone.php index 587822063b728..e67bb0c3ba249 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale/Timezone.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale/Timezone.php @@ -23,13 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - + /** * Locale timezone source */ namespace Magento\Backend\Model\Config\Source\Locale; -class Timezone implements \Magento\Core\Model\Option\ArrayInterface +class Timezone implements \Magento\Option\ArrayInterface { /** * @var \Magento\Core\Model\LocaleInterface diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdaycodes.php b/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdaycodes.php index f1119e9371476..13e8cf164394e 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdaycodes.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdaycodes.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Source\Locale; -class Weekdaycodes implements \Magento\Core\Model\Option\ArrayInterface +class Weekdaycodes implements \Magento\Option\ArrayInterface { /** * @var \Magento\Core\Model\LocaleInterface diff --git a/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdays.php b/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdays.php index 0959a534c19c8..ab6d059fba1b9 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdays.php +++ b/app/code/Magento/Backend/Model/Config/Source/Locale/Weekdays.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Source\Locale; -class Weekdays implements \Magento\Core\Model\Option\ArrayInterface +class Weekdays implements \Magento\Option\ArrayInterface { /** * @var \Magento\Core\Model\LocaleInterface diff --git a/app/code/Magento/Backend/Model/Config/Source/Nooptreq.php b/app/code/Magento/Backend/Model/Config/Source/Nooptreq.php index 14772971f7ace..a655c4fda42cb 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Nooptreq.php +++ b/app/code/Magento/Backend/Model/Config/Source/Nooptreq.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Source; -class Nooptreq implements \Magento\Core\Model\Option\ArrayInterface +class Nooptreq implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Reports/Scope.php b/app/code/Magento/Backend/Model/Config/Source/Reports/Scope.php index c5cb584099ec3..b75aa3615531b 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Reports/Scope.php +++ b/app/code/Magento/Backend/Model/Config/Source/Reports/Scope.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Model\Config\Source\Reports; -class Scope implements \Magento\Core\Model\Option\ArrayInterface +class Scope implements \Magento\Option\ArrayInterface { /** * Scope filter diff --git a/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php b/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php index 3ac0d9dec4654..7760080de623b 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php +++ b/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php @@ -31,7 +31,7 @@ use Magento\App\Arguments; -class Database implements \Magento\Core\Model\Option\ArrayInterface +class Database implements \Magento\Option\ArrayInterface { /** * @var Arguments diff --git a/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Storage.php b/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Storage.php index acd10d8e7e763..8d9a85d664be7 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Storage.php +++ b/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Storage.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Source\Storage\Media; -class Storage implements \Magento\Core\Model\Option\ArrayInterface +class Storage implements \Magento\Option\ArrayInterface { /** * Options getter diff --git a/app/code/Magento/Backend/Model/Config/Source/Store.php b/app/code/Magento/Backend/Model/Config/Source/Store.php index d6cc0b773b535..e4397cba50c3b 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Store.php +++ b/app/code/Magento/Backend/Model/Config/Source/Store.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Source; -class Store implements \Magento\Core\Model\Option\ArrayInterface +class Store implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Backend/Model/Config/Source/Web/Protocol.php b/app/code/Magento/Backend/Model/Config/Source/Web/Protocol.php index fd24b6b35765e..c6ed413df68eb 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Web/Protocol.php +++ b/app/code/Magento/Backend/Model/Config/Source/Web/Protocol.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Source\Web; -class Protocol implements \Magento\Core\Model\Option\ArrayInterface +class Protocol implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Web/Redirect.php b/app/code/Magento/Backend/Model/Config/Source/Web/Redirect.php index 74d9b74af715f..f5aa5645ebf92 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Web/Redirect.php +++ b/app/code/Magento/Backend/Model/Config/Source/Web/Redirect.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Source\Web; -class Redirect implements \Magento\Core\Model\Option\ArrayInterface +class Redirect implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Backend/Model/Config/Source/Website.php b/app/code/Magento/Backend/Model/Config/Source/Website.php index 535b696c26a8a..b4df7debf3490 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Website.php +++ b/app/code/Magento/Backend/Model/Config/Source/Website.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Source; -class Website implements \Magento\Core\Model\Option\ArrayInterface +class Website implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Backend/Model/Config/Source/Website/OptionHash.php b/app/code/Magento/Backend/Model/Config/Source/Website/OptionHash.php index 6800391e71c48..7f31b833b5ecc 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Website/OptionHash.php +++ b/app/code/Magento/Backend/Model/Config/Source/Website/OptionHash.php @@ -29,7 +29,7 @@ use Magento\Core\Model\System\Store; class OptionHash - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * System Store Model diff --git a/app/code/Magento/Backend/Model/Config/Source/Yesno.php b/app/code/Magento/Backend/Model/Config/Source/Yesno.php index 6eb1e531842a1..2d3f96b5e02ef 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Yesno.php +++ b/app/code/Magento/Backend/Model/Config/Source/Yesno.php @@ -30,7 +30,7 @@ */ namespace Magento\Backend\Model\Config\Source; -class Yesno implements \Magento\Core\Model\Option\ArrayInterface +class Yesno implements \Magento\Option\ArrayInterface { /** diff --git a/app/code/Magento/Backend/Model/Config/Source/Yesnocustom.php b/app/code/Magento/Backend/Model/Config/Source/Yesnocustom.php index 406b7bee56856..e73456ad38acb 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Yesnocustom.php +++ b/app/code/Magento/Backend/Model/Config/Source/Yesnocustom.php @@ -30,7 +30,7 @@ */ namespace Magento\Backend\Model\Config\Source; -class Yesnocustom implements \Magento\Core\Model\Option\ArrayInterface +class Yesnocustom implements \Magento\Option\ArrayInterface { /** diff --git a/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php b/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php index 06893120c06a4..6410772379ffb 100644 --- a/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php +++ b/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php @@ -30,6 +30,16 @@ */ class Iterator extends \FilterIterator { + /** + * Constructor + * + * @param \Iterator $iterator + */ + public function __construct(\Iterator $iterator) + { + parent::__construct($iterator); + } + /** * Check whether the current element of the iterator is acceptable * diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 7cb58d420780c..ea21e78278f36 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -123,12 +123,12 @@ Magento\Acl\Loader\Resource - + backend_acl_resources - + Magento_Adminhtml::all diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index.php b/app/code/Magento/Backup/Controller/Adminhtml/Index.php index 28d56779742c1..84b77f77cecab 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index.php @@ -35,7 +35,7 @@ class Index extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -56,14 +56,14 @@ class Index extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Backup\Factory $backupFactory * @param \Magento\App\Response\Http\FileFactory $fileFactory * @param \Magento\Backup\Model\BackupFactory $backupModelFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Backup\Factory $backupFactory, \Magento\App\Response\Http\FileFactory $fileFactory, \Magento\Backup\Model\BackupFactory $backupModelFactory diff --git a/app/code/Magento/Backup/Model/Config/Backend/Cron.php b/app/code/Magento/Backup/Model/Config/Backend/Cron.php index 62370583bd624..72f2f62a74b8c 100644 --- a/app/code/Magento/Backup/Model/Config/Backend/Cron.php +++ b/app/code/Magento/Backup/Model/Config/Backend/Cron.php @@ -48,8 +48,8 @@ class Cron extends \Magento\Core\Model\Config\Value protected $_runModelPath = ''; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory @@ -59,8 +59,8 @@ class Cron extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, diff --git a/app/code/Magento/Backup/Model/Config/Source/Type.php b/app/code/Magento/Backup/Model/Config/Source/Type.php index ad3f6c6f8b9db..5661989cb8c32 100644 --- a/app/code/Magento/Backup/Model/Config/Source/Type.php +++ b/app/code/Magento/Backup/Model/Config/Source/Type.php @@ -30,7 +30,7 @@ * * @author Magento Core Team */ -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * Backup data diff --git a/app/code/Magento/Backup/Model/Grid/Options.php b/app/code/Magento/Backup/Model/Grid/Options.php index 856116df32fb9..3d4c9571241fb 100644 --- a/app/code/Magento/Backup/Model/Grid/Options.php +++ b/app/code/Magento/Backup/Model/Grid/Options.php @@ -33,7 +33,7 @@ */ namespace Magento\Backup\Model\Grid; -class Options implements \Magento\Core\Model\Option\ArrayInterface +class Options implements \Magento\Option\ArrayInterface { /** diff --git a/app/code/Magento/Backup/Model/Observer.php b/app/code/Magento/Backup/Model/Observer.php index c48ad2d8a7cd8..d960a11f7bbc2 100644 --- a/app/code/Magento/Backup/Model/Observer.php +++ b/app/code/Magento/Backup/Model/Observer.php @@ -56,7 +56,7 @@ class Observer /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -86,7 +86,7 @@ class Observer /** * @param \Magento\Backup\Helper\Data $backupData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\Filesystem $filesystem @@ -94,7 +94,7 @@ class Observer */ public function __construct( \Magento\Backup\Helper\Data $backupData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\Filesystem $filesystem, diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index b1ef2c9a83e35..2e7b761fe3738 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -42,18 +42,18 @@ class Extend /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index 5aaeaea1e6214..1c6e8f98ca438 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -43,18 +43,18 @@ class Bundle extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 0276a35f7ed72..c9bfc0c19d635 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -70,7 +70,7 @@ class Option extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -88,14 +88,14 @@ class Option extends \Magento\Backend\Block\Widget * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Model\Config\Source\Yesno $yesno * @param \Magento\Bundle\Model\Source\Option\Type $optionTypes - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Model\Config\Source\Yesno $yesno, \Magento\Bundle\Model\Source\Option\Type $optionTypes, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index 3b725e7f782df..198f763b95ed6 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -48,7 +48,7 @@ class Selection /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -67,7 +67,7 @@ class Selection * @param \Magento\Backend\Model\Config\Source\Yesno $yesno * @param \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -75,7 +75,7 @@ public function __construct( \Magento\Backend\Model\Config\Source\Yesno $yesno, \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_catalogData = $catalogData; diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php index fdf60e0f7b964..57bf52f50a904 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php @@ -45,7 +45,7 @@ class Price extends \Magento\Catalog\Block\Product\Price * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Stdlib\String $string * @param \Magento\Math\Random $mathRandom * @param \Magento\Checkout\Helper\Cart $cartHelper @@ -57,7 +57,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Stdlib\String $string, \Magento\Math\Random $mathRandom, \Magento\Checkout\Helper\Cart $cartHelper, diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 1c8bf217c85f0..3090b1c0d3164 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -70,7 +70,7 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -86,13 +86,13 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView * @param \Magento\Json\EncoderInterface $jsonEncoder * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index 62598657fdb49..954e294bda877 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -60,14 +60,14 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Stdlib\String $string * @param \Magento\Math\Random $mathRandom * @param \Magento\Checkout\Helper\Cart $cartHelper * @param \Magento\Tax\Model\Calculation $taxCalc * @param \Magento\Core\Helper\Data $coreHelper * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -75,7 +75,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Stdlib\String $string, \Magento\Math\Random $mathRandom, \Magento\Checkout\Helper\Cart $cartHelper, diff --git a/app/code/Magento/Bundle/Model/Price/Index.php b/app/code/Magento/Bundle/Model/Price/Index.php index 06c5c7fc20591..de5cb6b8794be 100644 --- a/app/code/Magento/Bundle/Model/Price/Index.php +++ b/app/code/Magento/Bundle/Model/Price/Index.php @@ -58,8 +58,8 @@ class Index extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -67,8 +67,8 @@ class Index extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Bundle/Model/Product/CatalogPrice.php b/app/code/Magento/Bundle/Model/Product/CatalogPrice.php index 2e544ed26caeb..26620b58eb3e4 100644 --- a/app/code/Magento/Bundle/Model/Product/CatalogPrice.php +++ b/app/code/Magento/Bundle/Model/Product/CatalogPrice.php @@ -40,19 +40,19 @@ class CatalogPrice implements \Magento\Catalog\Model\Product\CatalogPriceInterfa protected $commonPriceModel; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $coreRegistry; /** * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\CatalogPrice $commonPriceModel - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\CatalogPrice $commonPriceModel, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->storeManager = $storeManager; $this->commonPriceModel = $commonPriceModel; diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index 6d1cd960fe6fc..dfb269540f687 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -151,7 +151,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Catalog\Helper\Data $catalogData @@ -175,7 +175,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Catalog\Helper\Data $catalogData, diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 86f22d882b24c..547c818cbef2f 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -39,8 +39,8 @@ class Creditmemo extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractIte protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -50,8 +50,8 @@ class Creditmemo extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractIte * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index 0f70db38908b5..981483e926368 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -37,8 +37,8 @@ class Invoice extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -48,8 +48,8 @@ class Invoice extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractItems * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index 68a3656f529fc..f8594e2b644fc 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -37,8 +37,8 @@ class Shipment extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -48,8 +48,8 @@ class Shipment extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractItems * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Bundle/Model/Selection.php b/app/code/Magento/Bundle/Model/Selection.php index fa35ddec8d751..794312cd92fb4 100644 --- a/app/code/Magento/Bundle/Model/Selection.php +++ b/app/code/Magento/Bundle/Model/Selection.php @@ -64,16 +64,16 @@ class Selection extends \Magento\Core\Model\AbstractModel protected $_catalogData = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Bundle\Model\Resource\Selection $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Helper\Data $catalogData, \Magento\Bundle\Model\Resource\Selection $resource, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Bundle/Model/Source/Option/Selection/Price/Type.php b/app/code/Magento/Bundle/Model/Source/Option/Selection/Price/Type.php index 5fc08315089f1..0d80b57cd090c 100644 --- a/app/code/Magento/Bundle/Model/Source/Option/Selection/Price/Type.php +++ b/app/code/Magento/Bundle/Model/Source/Option/Selection/Price/Type.php @@ -33,7 +33,7 @@ */ namespace Magento\Bundle\Model\Source\Option\Selection\Price; -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/Bundle/Model/Source/Option/Type.php b/app/code/Magento/Bundle/Model/Source/Option/Type.php index c7ed5286bd761..935bb914bef1f 100644 --- a/app/code/Magento/Bundle/Model/Source/Option/Type.php +++ b/app/code/Magento/Bundle/Model/Source/Option/Type.php @@ -25,7 +25,7 @@ */ namespace Magento\Bundle\Model\Source\Option; -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_shipment_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml similarity index 100% rename from app/code/Magento/Bundle/view/adminhtml/layout/sales_order_shipment_new.xml rename to app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_shipment_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml similarity index 100% rename from app/code/Magento/Bundle/view/adminhtml/layout/sales_order_shipment_view.xml rename to app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml diff --git a/app/code/Magento/Captcha/Model/Config/Font.php b/app/code/Magento/Captcha/Model/Config/Font.php index 7dc27ad754f54..db10d4320a56c 100644 --- a/app/code/Magento/Captcha/Model/Config/Font.php +++ b/app/code/Magento/Captcha/Model/Config/Font.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Model\Config; -class Font implements \Magento\Core\Model\Option\ArrayInterface +class Font implements \Magento\Option\ArrayInterface { /** * Captcha data diff --git a/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php b/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php index 94fc59ba21fc2..4928cc0f1fbbb 100644 --- a/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php +++ b/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php @@ -34,7 +34,7 @@ namespace Magento\Captcha\Model\Config\Form; abstract class AbstractForm extends \Magento\Core\Model\Config\Value - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var string diff --git a/app/code/Magento/Captcha/Model/Config/Mode.php b/app/code/Magento/Captcha/Model/Config/Mode.php index e02006de68eea..5953b109dfc91 100644 --- a/app/code/Magento/Captcha/Model/Config/Mode.php +++ b/app/code/Magento/Captcha/Model/Config/Mode.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Model\Config; -class Mode implements \Magento\Core\Model\Option\ArrayInterface +class Mode implements \Magento\Option\ArrayInterface { /** * Get options for captcha mode selection field diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php index e6981da383143..83da6c7a40c0c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php @@ -41,7 +41,7 @@ class AbstractCategory extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -53,13 +53,13 @@ class AbstractCategory extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_categoryTree = $categoryTree; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php index a3ccc9017facd..f21a2ba952dd6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php @@ -58,13 +58,13 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory * @param Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Json\EncoderInterface $jsonEncoder, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php index ad90d0f94929f..3fdf4460833d5 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php @@ -43,14 +43,14 @@ class Attributes extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php index d6454b41f5e53..abf6051088281 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php @@ -42,7 +42,7 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -55,14 +55,14 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_productFactory = $productFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php index 344ce00de9def..f6410bfc6575f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php @@ -46,7 +46,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Core registry * - * @var \Magento\Core\Model\Registry|null + * @var \Magento\Registry|null */ protected $_coreRegistry = null; @@ -68,7 +68,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs * @param \Magento\Backend\Model\Auth\Session $authSession * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory * @param \Magento\Catalog\Helper\Catalog $helperCatalog - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -77,7 +77,7 @@ public function __construct( \Magento\Backend\Model\Auth\Session $authSession, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, \Magento\Catalog\Helper\Catalog $helperCatalog, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_collectionFactory = $collectionFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index df55cd8bb028b..678d47d865b39 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -73,7 +73,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\HelperPool $helperPool * @param \Magento\Backend\Model\Auth\Session $backendSession * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory @@ -82,7 +82,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Core\Model\Resource\HelperPool $helperPool, \Magento\Backend\Model\Auth\Session $backendSession, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php index 55e0c330f41fe..43444e02b14bd 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php @@ -45,14 +45,14 @@ class Content extends Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php index a4985da797258..2cc792783e0e7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php @@ -42,18 +42,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 4433d308b7bcc..421af44996e20 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -54,7 +54,7 @@ class Advanced extends Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param Yesno $yesNo * @param Data $eavData @@ -62,7 +62,7 @@ class Advanced extends Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, Yesno $yesNo, Data $eavData, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php index d7cdee0afb351..dcc2f7a563c9e 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php @@ -47,14 +47,14 @@ class Front extends Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param Yesno $yesNo * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, Yesno $yesNo, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php index f122f84205864..41837bb2af700 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -49,7 +49,7 @@ class Main extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -84,7 +84,7 @@ class Main extends \Magento\Backend\Block\Template * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory * @param \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param AttributeMapperInterface $attributeMapper * @param array $data */ @@ -94,7 +94,7 @@ public function __construct( \Magento\Eav\Model\Entity\TypeFactory $typeFactory, \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, AttributeMapperInterface $attributeMapper, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php index a7514ff85a922..93e56c6ef7dce 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php @@ -44,14 +44,14 @@ class Formgroup /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Eav\Model\Entity\TypeFactory $typeFactory, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php index 165dcd8cf6bef..07d691305f6ed 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php @@ -38,14 +38,14 @@ class Formset /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php index 5d4abf2645f1e..50265cd028797 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php @@ -44,14 +44,14 @@ class Filter /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php index 56584b5954205..9e266e7d47b88 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php @@ -48,7 +48,7 @@ class Configure extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -60,13 +60,13 @@ class Configure extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\Product $product - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Product $product, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_catalogProduct = $product; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php index a062fb6cec0eb..cf02daecae77f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php @@ -38,7 +38,7 @@ class Error extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -50,13 +50,13 @@ class Error extends \Magento\View\Element\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php index 69f8b0d1138b1..2c4da47addc27 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php @@ -34,18 +34,18 @@ class Qty extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php index c7ce96b27c3c0..16ebdc3f6c716 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php @@ -47,7 +47,7 @@ class Result extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -60,14 +60,14 @@ class Result extends \Magento\View\Element\Template * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Backend\Helper\Js $adminhtmlJs - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Backend\Helper\Js $adminhtmlJs, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php index 7d7a3f7ba4146..bd78eb58df7c4 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php @@ -43,7 +43,7 @@ class Edit extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -66,7 +66,7 @@ class Edit extends \Magento\Backend\Block\Widget * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Helper\Product $productHelper * @param array $data */ @@ -74,7 +74,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Helper\Product $productHelper, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php index 8b17998f3e4dd..8ac763c9bd369 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -52,7 +52,7 @@ class Attributes /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $attributeAction @@ -60,7 +60,7 @@ class Attributes */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Helper\Product\Edit\Action\Attribute $attributeAction, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php index caa824af9d354..fbbadcafb2786 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php @@ -38,18 +38,18 @@ class AttributeSet extends \Magento\Backend\Block\Widget\Form /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php index 71d56a00bbcfb..eee5cd98fa223 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php @@ -31,18 +31,18 @@ class Js extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php index 298d2066a0cc6..0e0e7a431b186 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php @@ -51,14 +51,14 @@ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\CategoryFactory $categoryFactory, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php index 109be40b628ba..97623f977c0c9 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php @@ -49,7 +49,7 @@ class Attributes extends \Magento\Catalog\Block\Adminhtml\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param \Magento\Catalog\Helper\Data $catalogData @@ -57,7 +57,7 @@ class Attributes extends \Magento\Catalog\Block\Adminhtml\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, \Magento\Catalog\Helper\Data $catalogData, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php index 199be8aa211f5..9f430d99f99e4 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php @@ -38,7 +38,7 @@ class Search extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -56,14 +56,14 @@ class Search extends \Magento\Backend\Block\Widget * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Core\Model\Resource\HelperPool $helperPool * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Core\Model\Resource\HelperPool $helperPool, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_helperPool = $helperPool; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php index 543b13dc40b76..d45749c92a325 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php @@ -42,7 +42,7 @@ class Crosssell extends Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -85,9 +85,9 @@ class Crosssell extends Extended * @param \Magento\Catalog\Model\Product\Type $type * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $status * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -99,7 +99,7 @@ public function __construct( \Magento\Catalog\Model\Product\Type $type, \Magento\Catalog\Model\Product\Attribute\Source\Status $status, \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_linkFactory = $linkFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php index 636587c2dca65..a0a0d622ead68 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php @@ -48,7 +48,7 @@ class Inventory extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -67,7 +67,7 @@ class Inventory extends \Magento\Backend\Block\Widget * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders * @param \Magento\CatalogInventory\Model\Source\Stock $stock * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -75,7 +75,7 @@ public function __construct( \Magento\CatalogInventory\Model\Source\Backorders $backorders, \Magento\CatalogInventory\Model\Source\Stock $stock, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_stock = $stock; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php index 5f949d9712d36..057f05adde6de 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php @@ -57,7 +57,7 @@ class Option extends Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -86,7 +86,7 @@ class Option extends Widget * @param \Magento\Backend\Model\Config\Source\Yesno $configYesNo * @param \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType * @param Product $product - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig * @param array $data */ @@ -95,7 +95,7 @@ public function __construct( \Magento\Backend\Model\Config\Source\Yesno $configYesNo, \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType, Product $product, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php index d500589524184..dcb2025e7f7a0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php @@ -68,7 +68,7 @@ abstract class AbstractGroup /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -87,7 +87,7 @@ abstract class AbstractGroup * @param \Magento\Customer\Model\GroupFactory $groupFactory * @param \Magento\Directory\Helper\Data $directoryHelper * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -95,7 +95,7 @@ public function __construct( \Magento\Customer\Model\GroupFactory $groupFactory, \Magento\Directory\Helper\Data $directoryHelper, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_groupFactory = $groupFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php index 9d75d75d8c46e..8a166fc65e39d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php @@ -35,18 +35,18 @@ class Recurring /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php index 1d46c98fcd0e2..9e482e49e45aa 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php @@ -41,7 +41,7 @@ class Related extends Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -84,9 +84,9 @@ class Related extends Extended * @param \Magento\Catalog\Model\Product\Type $type * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $status * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -98,7 +98,7 @@ public function __construct( \Magento\Catalog\Model\Product\Type $type, \Magento\Catalog\Model\Product\Attribute\Source\Status $status, \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_linkFactory = $linkFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php index c54b896284daf..21aa6bdbe698a 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php @@ -38,7 +38,7 @@ class Upsell extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -81,9 +81,9 @@ class Upsell extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Catalog\Model\Product\Type $type * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $status * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -95,7 +95,7 @@ public function __construct( \Magento\Catalog\Model\Product\Type $type, \Magento\Catalog\Model\Product\Attribute\Source\Status $status, \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_linkFactory = $linkFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php index f5472863ae22a..b1f1b77c56253 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php @@ -48,7 +48,7 @@ class Websites extends \Magento\Backend\Block\Store\Switcher /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -57,7 +57,7 @@ class Websites extends \Magento\Backend\Block\Store\Switcher * @param \Magento\Core\Model\Website\Factory $websiteFactory * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -65,7 +65,7 @@ public function __construct( \Magento\Core\Model\Website\Factory $websiteFactory, \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, \Magento\Core\Model\StoreFactory $storeFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php index f6324619beea2..f64b6aef90f9f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php @@ -48,7 +48,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -89,7 +89,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory * @param \Magento\Catalog\Helper\Catalog $helperCatalog * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Translate\InlineInterface $translateInline, * @param array $data */ @@ -101,7 +101,7 @@ public function __construct( \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, \Magento\Catalog\Helper\Catalog $helperCatalog, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Translate\InlineInterface $translateInline, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php index 0f8dcf20482b1..561fa8700095d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php @@ -38,10 +38,10 @@ class Ajax extends \Magento\Backend\Block\AbstractBlock /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Core data * @@ -64,7 +64,7 @@ class Ajax extends \Magento\Backend\Block\AbstractBlock * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -72,7 +72,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php index 55aa523847389..d7fd90046d7ec 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php @@ -34,18 +34,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $coreRegistry; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php index e0d7a6c78ccc0..c4c8e36ce01c6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php @@ -43,14 +43,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $systemStore, array $data = array() diff --git a/app/code/Magento/Catalog/Block/Category/View.php b/app/code/Magento/Catalog/Block/Category/View.php index ba666afb9bd22..fbd25bc687ae9 100644 --- a/app/code/Magento/Catalog/Block/Category/View.php +++ b/app/code/Magento/Catalog/Block/Category/View.php @@ -38,7 +38,7 @@ class View extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -57,14 +57,14 @@ class View extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Layer $catalogLayer - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Helper\Category $categoryHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer $catalogLayer, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Helper\Category $categoryHelper, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index 64b44f44740b1..bfdceeefa76ed 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -61,7 +61,7 @@ class Navigation extends \Magento\View\Element\Template protected $_catalogCategory; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -98,7 +98,7 @@ class Navigation extends \Magento\View\Element\Template * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Category $catalogCategory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Indexer\Category\Flat\State $flatState * @param array $data */ @@ -109,7 +109,7 @@ public function __construct( \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Category $catalogCategory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Model\Indexer\Category\Flat\State $flatState, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index 3936cc70dc602..dfc9b9d1906ec 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -102,7 +102,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -160,7 +160,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -177,7 +177,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php index 78277a259f10d..0f8a55f50774e 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php @@ -115,7 +115,7 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -131,13 +131,13 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare * @param \Magento\Customer\Model\Session $customerSession * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/Gallery.php b/app/code/Magento/Catalog/Block/Product/Gallery.php index e06f810114528..1c2254ecee6b2 100644 --- a/app/code/Magento/Catalog/Block/Product/Gallery.php +++ b/app/code/Magento/Catalog/Block/Product/Gallery.php @@ -42,18 +42,18 @@ class Gallery extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index b0ba12e203058..e36830e5a14c8 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -70,7 +70,7 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -83,13 +83,13 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index bece75cfdeefe..69e82649a41b1 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -69,7 +69,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -83,13 +83,13 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Customer\Model\Session $customerSession * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/Price.php b/app/code/Magento/Catalog/Block/Product/Price.php index 9bb09395db79a..199ee331d60c0 100644 --- a/app/code/Magento/Catalog/Block/Product/Price.php +++ b/app/code/Magento/Catalog/Block/Product/Price.php @@ -48,10 +48,10 @@ class Price extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Tax data * @@ -91,7 +91,7 @@ class Price extends \Magento\View\Element\Template * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Stdlib\String $string * @param \Magento\Math\Random $mathRandom * @param \Magento\Checkout\Helper\Cart $cartHelper @@ -102,7 +102,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Stdlib\String $string, \Magento\Math\Random $mathRandom, \Magento\Checkout\Helper\Cart $cartHelper, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php index 11ab978e106ce..28209babe6afc 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php @@ -47,7 +47,7 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -62,13 +62,13 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct * @param CollectionFactory $productCollectionFactory * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php index 7a6e1db50f194..02e581ab0a3ee 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php @@ -50,7 +50,7 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -65,13 +65,13 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 9987f309131ce..b1286581aac01 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -71,7 +71,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -85,13 +85,13 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index 97d15a168a148..415cdad407ae8 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -87,7 +87,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -101,13 +101,13 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/Send.php b/app/code/Magento/Catalog/Block/Product/Send.php index 43a34fc0c56dd..dbbe05a2570ab 100644 --- a/app/code/Magento/Catalog/Block/Product/Send.php +++ b/app/code/Magento/Catalog/Block/Product/Send.php @@ -46,7 +46,7 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -58,13 +58,13 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Customer\Model\Session $customerSession * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php index a2a94fe7f3c95..c51eec5fd5516 100644 --- a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php +++ b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php @@ -36,7 +36,7 @@ class TemplateSelector extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -57,14 +57,14 @@ class TemplateSelector extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Model\Resource\Helper $resourceHelper, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 37a8d9a19f712..f746af3273654 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -82,7 +82,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -106,7 +106,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php index bdc3759abfede..b3995daf0ce62 100644 --- a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php +++ b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php @@ -43,7 +43,7 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -55,13 +55,13 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Catalog/Block/Product/View/Attributes.php b/app/code/Magento/Catalog/Block/Product/View/Attributes.php index 5e48b6ef58570..1954d4dd28e50 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Attributes.php +++ b/app/code/Magento/Catalog/Block/Product/View/Attributes.php @@ -46,18 +46,18 @@ class Attributes extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Product/View/Description.php b/app/code/Magento/Catalog/Block/Product/View/Description.php index a0bf623ba8d6c..e912ce78e1e43 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Description.php +++ b/app/code/Magento/Catalog/Block/Product/View/Description.php @@ -46,18 +46,18 @@ class Description extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index 817d064fce8a8..de0ff31a06a16 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -53,7 +53,7 @@ class Options extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry = null; @@ -87,7 +87,7 @@ class Options extends \Magento\View\Element\Template * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Model\Product\Option $option - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param array $data */ @@ -97,7 +97,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Model\Product\Option $option, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Stdlib\ArrayUtils $arrayUtils, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Block/Product/View/Price.php b/app/code/Magento/Catalog/Block/Product/View/Price.php index 9508584f370a7..77ed346ae8e18 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Price.php +++ b/app/code/Magento/Catalog/Block/Product/View/Price.php @@ -34,18 +34,18 @@ class Price extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php index 0904deea705aa..0eb5f9d750687 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php @@ -67,8 +67,8 @@ protected function _initCategory($getRootInstead = false) if ($activeTabId) { $this->_objectManager->get('Magento\Backend\Model\Auth\Session')->setActiveTabId($activeTabId); } - $this->_objectManager->get('Magento\Core\Model\Registry')->register('category', $category); - $this->_objectManager->get('Magento\Core\Model\Registry')->register('current_category', $category); + $this->_objectManager->get('Magento\Registry')->register('category', $category); + $this->_objectManager->get('Magento\Registry')->register('current_category', $category); $this->_objectManager->get('Magento\Cms\Model\Wysiwyg\Config')->setStoreId($this->getRequest()->getParam('store')); return $category; } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php index 73b3f1415062d..ffec1db67152b 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php @@ -39,17 +39,17 @@ class Widget extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php index 029aab1ec917e..543ea4347586e 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php @@ -48,7 +48,7 @@ class Product extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $registry = null; @@ -89,7 +89,7 @@ class Product extends \Magento\Backend\App\Action /** * @param Action\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Filter\Date $dateFilter * @param Product\Initialization\Helper $initializationHelper * @param Product\Initialization\StockDataFilter $stockFilter @@ -100,7 +100,7 @@ class Product extends \Magento\Backend\App\Action */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Filter\Date $dateFilter, \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper $initializationHelper, \Magento\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter $stockFilter, diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index a0d8791434b9b..7f7315f65e467 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -44,19 +44,19 @@ class Attribute extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Cache\FrontendInterface $attributeLabelCache - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Cache\FrontendInterface $attributeLabelCache, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; $this->_attributeLabelCache = $attributeLabelCache; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php index 4d6ce38aae0b0..a9807f3410d33 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php @@ -27,7 +27,7 @@ use Magento\App\RequestInterface; use Magento\Catalog\Model\ProductFactory; use Magento\Cms\Model\Wysiwyg; -use Magento\Core\Model\Registry; +use Magento\Registry; use Magento\Logger; class Builder @@ -43,7 +43,7 @@ class Builder protected $logger; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $registry; @@ -108,4 +108,4 @@ public function build(RequestInterface $request) $this->wysiwygConfig->setStoreId($request->getParam('store')); return $product; } -} +} diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php index e5b2602b2b1c5..4d93042b2db04 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php @@ -40,17 +40,17 @@ class Review extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php index f082eca4f0b9b..3d8851898e594 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php @@ -37,17 +37,17 @@ class Set extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Search.php b/app/code/Magento/Catalog/Controller/Adminhtml/Search.php index 377ecdf552bf5..41e9a09c3112a 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Search.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Search.php @@ -33,17 +33,17 @@ class Search extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Controller/Category.php b/app/code/Magento/Catalog/Controller/Category.php index f7867fa51ce57..b79d6c5c05b35 100644 --- a/app/code/Magento/Catalog/Controller/Category.php +++ b/app/code/Magento/Catalog/Controller/Category.php @@ -37,7 +37,7 @@ class Category extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -72,7 +72,7 @@ class Category extends \Magento\App\Action\Action * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( @@ -80,7 +80,7 @@ public function __construct( \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Model\Session $catalogSession, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Helper/Data.php b/app/code/Magento/Catalog/Helper/Data.php index 1bde0389d6d16..f00bb2a200596 100644 --- a/app/code/Magento/Catalog/Helper/Data.php +++ b/app/code/Magento/Catalog/Helper/Data.php @@ -72,7 +72,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -157,7 +157,7 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Stdlib\String $string * @param Category $catalogCategory * @param Product $catalogProduct - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory * @param \Magento\Escaper $escaper @@ -173,7 +173,7 @@ public function __construct( \Magento\Stdlib\String $string, Category $catalogCategory, Product $catalogProduct, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory, \Magento\Escaper $escaper, diff --git a/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php b/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php deleted file mode 100644 index 7157dc49df4eb..0000000000000 --- a/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ -namespace Magento\Catalog\Helper\Flat; - -abstract class AbstractFlat extends \Magento\App\Helper\AbstractHelper -{ - /** - * Catalog Flat index process code - * - * @var null|string - */ - protected $_indexerCode = null; - - /** - * Store catalog Flat index process instance - * - * @var \Magento\Index\Model\Process|null - */ - protected $_process = null; - - /** - * Check if Catalog Category Flat Data is enabled - * - * @return bool - */ - abstract public function isEnabled(); - - /** - * Process factory - * - * @var \Magento\Index\Model\ProcessFactory - */ - protected $_processFactory; - - /** - * @var bool - */ - protected $_isAvailable; - - /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\Index\Model\ProcessFactory $processFactory - * @param bool $isAvailable - */ - public function __construct( - \Magento\App\Helper\Context $context, - \Magento\Index\Model\ProcessFactory $processFactory, - $isAvailable = true - ) { - $this->_processFactory = $processFactory; - $this->_isAvailable = $isAvailable; - parent::__construct($context); - } - - /** - * Check if Catalog Category Flat Data is available for use - * - * @return bool - */ - public function isAvailable() - { - return $this->_isAvailable - && $this->isEnabled() - && !$this->getProcess()->isLocked() - && $this->getProcess()->getStatus() != \Magento\Index\Model\Process::STATUS_RUNNING; - } - - /** - * Retrieve Catalog Flat index process - * - * @return \Magento\Index\Model\Process - */ - public function getProcess() - { - if (is_null($this->_process)) { - $this->_process = $this->_processFactory->create() - ->load($this->_indexerCode, 'indexer_code'); - } - return $this->_process; - } -} diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 221195de6b248..416668e0f1e92 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Catalog\Helper; use Magento\App\Helper\AbstractHelper; /** * Catalog image helper - * - * @author Magento Core Team */ class Image extends AbstractHelper { @@ -342,7 +341,7 @@ public function rotate($angle) * @param int $imageOpacity * @return $this */ - public function watermark($fileName, $position, $size=null, $imageOpacity=null) + public function watermark($fileName, $position, $size = null, $imageOpacity = null) { $this->setWatermark($fileName) ->setWatermarkPosition($position) @@ -410,7 +409,21 @@ public function __toString() $url = $model->saveFile()->getUrl(); } } catch (\Exception $e) { + $url = $this->getDefaultPlaceholderUrl(); + } + return $url; + } + + /** + * @return string + */ + protected function getDefaultPlaceholderUrl() + { + try { $url = $this->_viewUrl->getViewFileUrl($this->getPlaceholder()); + } catch (\Exception $e) { + $this->_logger->logException($e); + $url = $this->_urlBuilder->getUrl('', array('_direct' => 'core/index/notfound')); } return $url; } diff --git a/app/code/Magento/Catalog/Helper/Product.php b/app/code/Magento/Catalog/Helper/Product.php index 3db04544e015f..8da045500b1ca 100644 --- a/app/code/Magento/Catalog/Helper/Product.php +++ b/app/code/Magento/Catalog/Helper/Product.php @@ -70,7 +70,7 @@ class Product extends \Magento\Core\Helper\Url /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -129,7 +129,7 @@ class Product extends \Magento\Core\Helper\Url * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\View\Url $viewUrl - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\ConfigInterface $coreConfig @@ -142,7 +142,7 @@ public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Session $catalogSession, \Magento\View\Url $viewUrl, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Catalog\Model\Attribute\Config $attributeConfig, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\ConfigInterface $coreConfig, @@ -160,7 +160,7 @@ public function __construct( $this->_coreConfig = $coreConfig; $this->_coreStoreConfig = $coreStoreConfig; $this->_logger = $context->getLogger(); - parent::__construct($context, $storeManager); + parent::__construct($context, $storeManager); } /** diff --git a/app/code/Magento/Catalog/Helper/Product/Composite.php b/app/code/Magento/Catalog/Helper/Product/Composite.php index f87d519dccf7f..9eaa38498168b 100644 --- a/app/code/Magento/Catalog/Helper/Product/Composite.php +++ b/app/code/Magento/Catalog/Helper/Product/Composite.php @@ -37,10 +37,10 @@ class Composite extends \Magento\App\Helper\AbstractHelper /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Catalog product * @@ -74,7 +74,7 @@ class Composite extends \Magento\App\Helper\AbstractHelper * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\ViewInterface $view */ public function __construct( @@ -83,7 +83,7 @@ public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\ViewInterface $view ) { $this->_customerFactory = $customerFactory; diff --git a/app/code/Magento/Catalog/Helper/Product/Flat.php b/app/code/Magento/Catalog/Helper/Product/Flat.php deleted file mode 100644 index 6e4dace1fec50..0000000000000 --- a/app/code/Magento/Catalog/Helper/Product/Flat.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ -namespace Magento\Catalog\Helper\Product; - -class Flat extends \Magento\Catalog\Helper\Flat\AbstractFlat -{ - /** - * Catalog Product Flat Config - */ - const XML_PATH_USE_PRODUCT_FLAT = 'catalog/frontend/flat_catalog_product'; - - /** - * @var int - */ - protected $_addFilterableAttrs; - - /** - * @var int - */ - protected $_addChildData; - - /** - * Catalog Flat Product index process code - */ - const CATALOG_FLAT_PROCESS_CODE = 'catalog_product_flat'; - - /** - * Catalog Product Flat index process code - * - * @var string - */ - protected $_indexerCode = self::CATALOG_FLAT_PROCESS_CODE; - - /** - * Catalog Product Flat index process instance - * - * @var \Magento\Index\Model\Process|null - */ - protected $_process = null; - - /** - * Store flags which defines if Catalog Product Flat functionality is enabled - * - * @deprecated after 1.7.0.0 - * - * @var array - */ - protected $_isEnabled = array(); - - /** - * Core store config - * - * @var \Magento\Core\Model\Store\Config - */ - protected $_coreStoreConfig; - - /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\Index\Model\ProcessFactory $processFactory - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param mixed $addFilterableAttrs - * @param mixed $addChildData - * @param bool $isAvailable - */ - public function __construct( - \Magento\App\Helper\Context $context, - \Magento\Index\Model\ProcessFactory $processFactory, - \Magento\Core\Model\Store\Config $coreStoreConfig, - $addFilterableAttrs = 0, - $addChildData = 0, - $isAvailable = true - ) { - $this->_coreStoreConfig = $coreStoreConfig; - parent::__construct($context, $processFactory, $isAvailable); - $this->_addFilterableAttrs = intval($addFilterableAttrs); - $this->_addChildData = intval($addChildData); - } - - /** - * Check Catalog Product Flat functionality is enabled - * - * @return bool - */ - public function isEnabled() - { - return $this->_coreStoreConfig->getConfigFlag(self::XML_PATH_USE_PRODUCT_FLAT); - } - - /** - * Is add filterable attributes to Flat table - * - * @return int - */ - public function isAddFilterableAttributes() - { - return $this->_addFilterableAttrs; - } - - /** - * Is add child data to Flat - * - * @return int - */ - public function isAddChildData() - { - return $this->_addChildData; - } -} diff --git a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php index f1dc4ce14064a..f0b8f86305647 100644 --- a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php +++ b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php @@ -44,11 +44,6 @@ class Indexer extends \Magento\App\Helper\AbstractHelper */ const BATCH_SIZE = 500; - /** - * @var \Magento\Catalog\Helper\Product\Flat - */ - protected $_flatHelper; - /** * Resource instance * @@ -131,36 +126,57 @@ class Indexer extends \Magento\App\Helper\AbstractHelper */ protected $_storeManager; + /** + * @var bool + */ + protected $_addFilterableAttrs; + + /** + * @var bool + */ + protected $_addChildData; + + /** + * @var \Magento\Mview\View\Changelog + */ + protected $_changelog; + /** * @param \Magento\App\Helper\Context $context * @param \Magento\App\Resource $resource - * @param \Magento\Catalog\Helper\Product\Flat $flatHelper * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig * @param \Magento\Catalog\Model\Resource\ConfigFactory $configFactory * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Mview\View\Changelog $changelog + * @param bool $addFilterableAttrs + * @param bool $addChildData * @param array $flatAttributeGroups */ public function __construct( \Magento\App\Helper\Context $context, \Magento\App\Resource $resource, - \Magento\Catalog\Helper\Product\Flat $flatHelper, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Attribute\Config $attributeConfig, \Magento\Catalog\Model\Resource\ConfigFactory $configFactory, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Mview\View\Changelog $changelog, + $addFilterableAttrs = false, + $addChildData = false, $flatAttributeGroups = array() ) { $this->_configFactory = $configFactory; - $this->_flatHelper = $flatHelper; $this->_resource = $resource; $this->_eavConfig = $eavConfig; $this->_attributeConfig = $attributeConfig; $this->_attributeFactory = $attributeFactory; $this->_flatAttributeGroups = $flatAttributeGroups; $this->_storeManager = $storeManager; + $this->_changelog = $changelog; + $this->_addFilterableAttrs = $addFilterableAttrs; + $this->_addChildData = $addChildData; parent::__construct($context); } @@ -181,7 +197,7 @@ public function getFlatColumnsDdlDefinition() 'primary' => true, 'comment' => 'Entity Id' ); - if ($this->_flatHelper->isAddChildData()) { + if ($this->isAddChildData()) { $columns['child_id'] = array( 'type' => \Magento\DB\Ddl\Table::TYPE_INTEGER, 'length' => null, @@ -219,6 +235,26 @@ public function getFlatColumnsDdlDefinition() return $columns; } + /** + * Check whether filterable attributes should be added + * + * @return bool + */ + public function isAddFilterableAttributes() + { + return $this->_addFilterableAttrs; + } + + /** + * Check whether child data should be added + * + * @return bool + */ + public function isAddChildData() + { + return $this->_addChildData; + } + /** * Retrieve catalog product flat table columns array * @@ -231,8 +267,8 @@ public function getFlatColumns() foreach ($this->getAttributes() as $attribute) { /** @var $attribute \Magento\Eav\Model\Entity\Attribute\AbstractAttribute */ $columns = $attribute - ->setFlatAddFilterableAttributes($this->_flatHelper->isAddFilterableAttributes()) - ->setFlatAddChildData($this->_flatHelper->isAddChildData()) + ->setFlatAddFilterableAttributes($this->isAddFilterableAttributes()) + ->setFlatAddChildData($this->isAddChildData()) ->getFlatColumns(); if ($columns !== null) { $this->_columns = array_merge($this->_columns, $columns); @@ -333,7 +369,7 @@ public function getAttributeCodes() $adapter->quoteInto('additional_table.used_for_sort_by = ?', 1), $adapter->quoteInto('main_table.attribute_code IN(?)', $this->_systemAttributes) ); - if ($this->_flatHelper->isAddFilterableAttributes()) { + if ($this->isAddFilterableAttributes()) { $whereCondition[] = $adapter->quoteInto('additional_table.is_filterable > ?', 0); } @@ -358,7 +394,7 @@ public function getFlatIndexes() { if ($this->_indexes === null) { $this->_indexes = array(); - if ($this->_flatHelper->isAddChildData()) { + if ($this->isAddChildData()) { $this->_indexes['PRIMARY'] = array( 'type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_PRIMARY, 'fields' => array('entity_id', 'child_id') @@ -389,8 +425,8 @@ public function getFlatIndexes() foreach ($this->getAttributes() as $attribute) { /** @var $attribute \Magento\Eav\Model\Entity\Attribute */ $indexes = $attribute - ->setFlatAddFilterableAttributes($this->_flatHelper->isAddFilterableAttributes()) - ->setFlatAddChildData($this->_flatHelper->isAddChildData()) + ->setFlatAddFilterableAttributes($this->isAddFilterableAttributes()) + ->setFlatAddChildData($this->isAddChildData()) ->getFlatIndexes(); if ($indexes !== null) { $this->_indexes = array_merge($this->_indexes, $indexes); @@ -475,7 +511,12 @@ public function deleteAbandonedStoreFlatTables() { $connection = $this->_resource->getConnection('write'); $existentTables = $connection->getTables($connection->getTableName('catalog_product_flat_%')); - + $this->_changelog->setViewId('catalog_product_flat'); + foreach ($existentTables as $key => $tableName) { + if ($this->_changelog->getName() == $tableName) { + unset($existentTables[$key]); + } + } $actualStoreTables = array(); foreach ($this->_storeManager->getStores() as $store) { $actualStoreTables[] = $this->getFlatTableName($store->getId()); diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 946d73ff0a37e..57851c380e397 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -49,10 +49,10 @@ class View extends \Magento\App\Helper\AbstractHelper /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Catalog product * @@ -97,7 +97,7 @@ class View extends \Magento\App\Helper\AbstractHelper * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Theme\Helper\Layout $pageLayout - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\ViewInterface $view * @param \Magento\Message\ManagerInterface $messageManager * @param array $messageGroups @@ -108,7 +108,7 @@ public function __construct( \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Theme\Helper\Layout $pageLayout, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\ViewInterface $view, \Magento\Message\ManagerInterface $messageManager, array $messageGroups = array() diff --git a/app/code/Magento/Catalog/Model/AbstractModel.php b/app/code/Magento/Catalog/Model/AbstractModel.php index 7d559d8220a97..ca936a4128617 100644 --- a/app/code/Magento/Catalog/Model/AbstractModel.php +++ b/app/code/Magento/Catalog/Model/AbstractModel.php @@ -81,16 +81,16 @@ abstract class AbstractModel extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index e15b8d8fe506b..13a77872b55b5 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -185,8 +185,8 @@ class Category extends \Magento\Catalog\Model\AbstractModel protected $productIndexer; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTreeResource * @param \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory @@ -206,8 +206,8 @@ class Category extends \Magento\Catalog\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Category\Tree $categoryTreeResource, \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory, @@ -931,7 +931,7 @@ public function getProductCount() * @param bool $sorted * @param bool $asCollection * @param bool $toLoad - * @return mixed + * @return \Magento\Data\Tree\Node\Collection|\Magento\Catalog\Model\Resource\Category\Collection */ public function getCategories($parent, $recursionLevel = 0, $sorted = false, $asCollection = false, $toLoad = true) { @@ -943,7 +943,7 @@ public function getCategories($parent, $recursionLevel = 0, $sorted = false, $as /** * Return parent categories of current category * - * @return array + * @return \Magento\Object[]|\Magento\Catalog\Model\Category[] */ public function getParentCategories() { @@ -951,9 +951,9 @@ public function getParentCategories() } /** - * Retuen children categories of current category + * Return children categories of current category * - * @return array + * @return \Magento\Catalog\Model\Resource\Category\Collection|\Magento\Catalog\Model\Category[] */ public function getChildrenCategories() { diff --git a/app/code/Magento/Catalog/Model/Config/Backend/Category.php b/app/code/Magento/Catalog/Model/Config/Backend/Category.php index 18aad4f97ea3d..b058f0d7b26c8 100644 --- a/app/code/Magento/Catalog/Model/Config/Backend/Category.php +++ b/app/code/Magento/Catalog/Model/Config/Backend/Category.php @@ -44,8 +44,8 @@ class Category extends \Magento\Core\Model\Config\Value /** * Constructor * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Catalog\Model\Category $catalogCategory @@ -54,8 +54,8 @@ class Category extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Catalog\Model\Category $catalogCategory, diff --git a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php index c84d18b7ff765..5b962256d64f1 100644 --- a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php +++ b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php @@ -48,8 +48,8 @@ class Image extends \Magento\Core\Model\Config\Value protected $_attributeCollectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory @@ -59,8 +59,8 @@ class Image extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, diff --git a/app/code/Magento/Catalog/Model/Config/Source/Category.php b/app/code/Magento/Catalog/Model/Config/Source/Category.php index 8e667a3a4a621..10869c903a811 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Category.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Category.php @@ -30,7 +30,7 @@ * * @SuppressWarnings(PHPMD.LongVariable) */ -class Category implements \Magento\Core\Model\Option\ArrayInterface +class Category implements \Magento\Option\ArrayInterface { /** * Category collection factory diff --git a/app/code/Magento/Catalog/Model/Config/Source/GridPerPage.php b/app/code/Magento/Catalog/Model/Config/Source/GridPerPage.php index 9036ec752aa06..c86e75ae5f736 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/GridPerPage.php +++ b/app/code/Magento/Catalog/Model/Config/Source/GridPerPage.php @@ -32,7 +32,7 @@ * @package Magento_Catalog * @author Magento Core Team */ -class GridPerPage implements \Magento\Core\Model\Option\ArrayInterface +class GridPerPage implements \Magento\Option\ArrayInterface { /** * Options diff --git a/app/code/Magento/Catalog/Model/Config/Source/ListMode.php b/app/code/Magento/Catalog/Model/Config/Source/ListMode.php index 84c8b62aa46a2..f8038725e64aa 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/ListMode.php +++ b/app/code/Magento/Catalog/Model/Config/Source/ListMode.php @@ -25,9 +25,7 @@ */ namespace Magento\Catalog\Model\Config\Source; -use Magento\Core\Model\Option\ArrayInterface; - -class ListMode implements ArrayInterface +class ListMode implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Catalog/Model/Config/Source/ListPerPage.php b/app/code/Magento/Catalog/Model/Config/Source/ListPerPage.php index 350336fa9bf0e..4908baddbe17d 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/ListPerPage.php +++ b/app/code/Magento/Catalog/Model/Config/Source/ListPerPage.php @@ -32,7 +32,7 @@ * @package Magento_Catalog * @author Magento Core Team */ -class ListPerPage implements \Magento\Core\Model\Option\ArrayInterface +class ListPerPage implements \Magento\Option\ArrayInterface { /** * Pager Options diff --git a/app/code/Magento/Catalog/Model/Config/Source/ListSort.php b/app/code/Magento/Catalog/Model/Config/Source/ListSort.php index 63e6ffaa794bb..ca5b41e35277a 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/ListSort.php +++ b/app/code/Magento/Catalog/Model/Config/Source/ListSort.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Model\Config\Source; -class ListSort implements \Magento\Core\Model\Option\ArrayInterface +class ListSort implements \Magento\Option\ArrayInterface { /** * Catalog config diff --git a/app/code/Magento/Catalog/Model/Config/Source/Price/Scope.php b/app/code/Magento/Catalog/Model/Config/Source/Price/Scope.php index db248883d3cae..04057d3b039f5 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Price/Scope.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Price/Scope.php @@ -25,9 +25,7 @@ */ namespace Magento\Catalog\Model\Config\Source\Price; -use Magento\Core\Model\Option\ArrayInterface; - -class Scope implements ArrayInterface +class Scope implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Catalog/Model/Config/Source/Price/Step.php b/app/code/Magento/Catalog/Model/Config/Source/Price/Step.php index 488b468184860..cbff39b70cc63 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Price/Step.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Price/Step.php @@ -25,9 +25,7 @@ */ namespace Magento\Catalog\Model\Config\Source\Price; -use Magento\Core\Model\Option\ArrayInterface; - -class Step implements ArrayInterface +class Step implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Price.php b/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Price.php index 62fc3de539c57..8ea71ba347623 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Price.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Price.php @@ -32,7 +32,7 @@ * @package Magento_Catalog * @author Magento Core Team */ -class Price implements \Magento\Core\Model\Option\ArrayInterface +class Price implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Type.php b/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Type.php index 7f4d9a33f5114..ec48b7709d87d 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Type.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Product/Options/Type.php @@ -26,7 +26,7 @@ /** * Product option types mode source */ -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * Product Option Config diff --git a/app/code/Magento/Catalog/Model/Config/Source/Product/Thumbnail.php b/app/code/Magento/Catalog/Model/Config/Source/Product/Thumbnail.php index 2fd17f82e1bc7..8564cd2a53e19 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Product/Thumbnail.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Product/Thumbnail.php @@ -31,7 +31,7 @@ * @category Magento * @package Magento_Catalog */ -class Thumbnail implements \Magento\Core\Model\Option\ArrayInterface +class Thumbnail implements \Magento\Option\ArrayInterface { const OPTION_USE_PARENT_IMAGE = 'parent'; const OPTION_USE_OWN_IMAGE = 'itself'; diff --git a/app/code/Magento/Catalog/Model/Config/Source/TimeFormat.php b/app/code/Magento/Catalog/Model/Config/Source/TimeFormat.php index 03795dfba8a95..9fd455b495672 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/TimeFormat.php +++ b/app/code/Magento/Catalog/Model/Config/Source/TimeFormat.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Model\Config\Source; -class TimeFormat implements \Magento\Core\Model\Option\ArrayInterface +class TimeFormat implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Catalog/Model/Config/Source/Watermark/Position.php b/app/code/Magento/Catalog/Model/Config/Source/Watermark/Position.php index 7c2428e900b6f..fe91362ded82c 100644 --- a/app/code/Magento/Catalog/Model/Config/Source/Watermark/Position.php +++ b/app/code/Magento/Catalog/Model/Config/Source/Watermark/Position.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Model\Config\Source\Watermark; -class Position implements \Magento\Core\Model\Option\ArrayInterface +class Position implements \Magento\Option\ArrayInterface { /** diff --git a/app/code/Magento/Catalog/Model/Design.php b/app/code/Magento/Catalog/Model/Design.php index 6da61ad22bbaf..6a4ff5a355eac 100644 --- a/app/code/Magento/Catalog/Model/Design.php +++ b/app/code/Magento/Catalog/Model/Design.php @@ -52,8 +52,8 @@ class Design extends \Magento\Core\Model\AbstractModel protected $_locale; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -61,8 +61,8 @@ class Design extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $locale, \Magento\View\DesignInterface $design, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Catalog/Model/Entity/Attribute.php b/app/code/Magento/Catalog/Model/Entity/Attribute.php index 1f1ec92ef3a96..ac657aaa3d08c 100644 --- a/app/code/Magento/Catalog/Model/Entity/Attribute.php +++ b/app/code/Magento/Catalog/Model/Entity/Attribute.php @@ -96,8 +96,8 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute protected $attrLockValidator; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory @@ -112,8 +112,8 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\Data $coreData, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory, diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php index eb64fe93de11b..55ffa2c1ad8ac 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php @@ -35,8 +35,8 @@ class Mode extends \Magento\Core\Model\Config\Value protected $flatIndexer; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Indexer\Model\IndexerInterface $flatIndexer @@ -45,8 +45,8 @@ class Mode extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Indexer\Model\IndexerInterface $flatIndexer, diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php index 5c9feef1f8e68..6b7a6d7f51046 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php @@ -49,13 +49,6 @@ abstract class AbstractAction */ protected $_valueFieldSuffix = '_value'; - /** - * Logger instance - * - * @var \Magento\Logger - */ - protected $_logger; - /** * Resource instance * @@ -82,13 +75,6 @@ abstract class AbstractAction */ protected $_coreStoreConfig; - /** - * Current store number representation - * - * @var int - */ - protected $_storeId; - /** * Suffix for drop table (uses on flat table rename) * @@ -108,13 +94,6 @@ abstract class AbstractAction */ protected $_coreData; - /** - * Product flat helper - * - * @var \Magento\Catalog\Helper\Product\Flat - */ - protected $_productFlatHelper; - /** * @var \Magento\DB\Adapter\AdapterInterface */ @@ -132,13 +111,6 @@ abstract class AbstractAction */ protected $_flatTablesExist = array(); - /** - * Contains list of created "value" tables - * - * @var array - */ - protected $_valueTables = array(); - /** * List of product types available in installation * @@ -147,62 +119,52 @@ abstract class AbstractAction protected $_productTypes = array(); /** - * Calls amount during current session - * - * @var int + * @var \Magento\Catalog\Model\Indexer\Product\Flat\Processor */ - protected static $_calls = 0; + protected $_flatProductProcessor; /** - * @var \Magento\App\ConfigInterface $config + * @var TableBuilder */ - protected $_config; + protected $_tableBuilder; /** - * @var \Magento\Catalog\Helper\Product\Flat + * @var FlatTableBuilder */ - protected $_flatProductHelper; + protected $_flatTableBuilder; /** - * @var \Magento\Catalog\Model\Indexer\Product\Flat\Processor - */ - protected $_flatProductProcessor; - - /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Catalog\Helper\Product\Flat\Indexer $productHelper * @param \Magento\Catalog\Model\Product\Type $productType - * @param \Magento\App\ConfigInterface $config - * @param \Magento\Catalog\Helper\Product\Flat $flatProductHelper * @param Processor $flatProductProcessor + * @param TableBuilder $tableBuilder + * @param FlatTableBuilder $flatTableBuilder */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Catalog\Helper\Product\Flat\Indexer $productHelper, \Magento\Catalog\Model\Product\Type $productType, - \Magento\App\ConfigInterface $config, - \Magento\Catalog\Helper\Product\Flat $flatProductHelper, - \Magento\Catalog\Model\Indexer\Product\Flat\Processor $flatProductProcessor + \Magento\Catalog\Model\Indexer\Product\Flat\Processor $flatProductProcessor, + \Magento\Catalog\Model\Indexer\Product\Flat\TableBuilder $tableBuilder, + \Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder $flatTableBuilder ) { - $this->_logger = $logger; $this->_resource = $resource; $this->_storeManager = $storeManager; $this->_resourceHelper = $resourceHelper; $this->_coreStoreConfig = $coreStoreConfig; $this->_productIndexerHelper = $productHelper; $this->_productType = $productType; - $this->_config = $config; $this->_connection = $resource->getConnection('default'); - $this->_flatProductHelper = $flatProductHelper; $this->_flatProductProcessor = $flatProductProcessor; + $this->_tableBuilder = $tableBuilder; + $this->_flatTableBuilder = $flatTableBuilder; } /** @@ -236,521 +198,19 @@ protected function _getTemporaryTableName($tableName) return sprintf('%s_tmp_indexer', $tableName); } - /** - * Create empty temporary table with given columns list - * - * @param string $tableName Table name - * @param array $columns array('columnName' => \Magento\Catalog\Model\Resource\Eav\Attribute, ...) - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _createTemporaryTable($tableName, array $columns) - { - if (!empty($columns)) { - $valueTableName = $tableName . $this->_valueFieldSuffix; - $temporaryTable = $this->_connection->newTable($tableName); - $valueTemporaryTable = $this->_connection->newTable($valueTableName); - $flatColumns = $this->_productIndexerHelper->getFlatColumns(); - - $temporaryTable->addColumn( - 'entity_id', - \Magento\DB\Ddl\Table::TYPE_INTEGER - ); - - $temporaryTable->addColumn( - 'type_id', - \Magento\DB\Ddl\Table::TYPE_TEXT - ); - - $temporaryTable->addColumn( - 'attribute_set_id', - \Magento\DB\Ddl\Table::TYPE_INTEGER - ); - - $valueTemporaryTable->addColumn( - 'entity_id', - \Magento\DB\Ddl\Table::TYPE_INTEGER - ); - - /** @var $attribute \Magento\Catalog\Model\Resource\Eav\Attribute */ - foreach ($columns as $columnName => $attribute) { - $attributeCode = $attribute->getAttributeCode(); - if (isset($flatColumns[$attributeCode])) { - $column = $flatColumns[$attributeCode]; - } else { - $column = $attribute->_getFlatColumnsDdlDefinition(); - $column = $column[$attributeCode]; - } - - $temporaryTable->addColumn( - $columnName, - $column['type'], - isset($column['length']) ? $column['length'] : null - ); - - $columnValueName = $attributeCode . $this->_valueFieldSuffix; - if (isset($flatColumns[$columnValueName])) { - $columnValue = $flatColumns[$columnValueName]; - $valueTemporaryTable->addColumn( - $columnValueName, - $columnValue['type'], - isset($columnValue['length']) ? $columnValue['length'] : null - ); - } - } - $this->_connection->dropTemporaryTable($tableName); - $this->_connection->createTemporaryTable($temporaryTable); - - if (count($valueTemporaryTable->getColumns()) > 1) { - $this->_connection->dropTemporaryTable($valueTableName); - $this->_connection->createTemporaryTable($valueTemporaryTable); - $this->_valueTables[$valueTableName] = $valueTableName; - } - } - return $this; - } - - /** - * Fill temporary entity table - * - * @param string $tableName - * @param array $columns - * @param array $changedIds - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _fillTemporaryEntityTable($tableName, array $columns, array $changedIds = array()) - { - if (!empty($columns)) { - $select = $this->_connection->select(); - $temporaryEntityTable = $this->_getTemporaryTableName($tableName); - $idsColumns = array( - 'entity_id', - 'type_id', - 'attribute_set_id', - ); - - $columns = array_merge($idsColumns, array_keys($columns)); - - $select->from(array('e' => $tableName), $columns); - $onDuplicate = false; - if (!empty($changedIds)) { - $select->where( - $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) - ); - $onDuplicate = true; - } - $sql = $select->insertFromSelect($temporaryEntityTable, $columns, $onDuplicate); - $this->_connection->query($sql); - } - - return $this; - } - - /** - * Fill temporary table by data from products EAV attributes by type - * - * @param string $tableName - * @param array $tableColumns - * @param array $changedIds - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _fillTemporaryTable($tableName, array $tableColumns, array $changedIds) - { - if (!empty($tableColumns)) { - - $columnsChunks = array_chunk($tableColumns, self::ATTRIBUTES_CHUNK_SIZE, true); - foreach ($columnsChunks as $columnsList) { - $select = $this->_connection->select(); - $selectValue = $this->_connection->select(); - $entityTableName = $this->_getTemporaryTableName( - $this->_productIndexerHelper->getTable('catalog_product_entity') - ); - $temporaryTableName = $this->_getTemporaryTableName($tableName); - $temporaryValueTableName = $temporaryTableName . $this->_valueFieldSuffix; - $keyColumn = array('entity_id'); - $columns = array_merge($keyColumn, array_keys($columnsList)); - $valueColumns = $keyColumn; - $flatColumns = $this->_productIndexerHelper->getFlatColumns(); - $iterationNum = 1; - - $select->from( - array('e' => $entityTableName), - $keyColumn - ); - - $selectValue->from( - array('e' => $temporaryTableName), - $keyColumn - ); - - /** @var $attribute \Magento\Catalog\Model\Resource\Eav\Attribute */ - foreach ($columnsList as $columnName => $attribute) { - $countTableName = 't' . $iterationNum++; - $joinCondition = sprintf( - 'e.entity_id = %1$s.entity_id AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0', - $countTableName, - $attribute->getId() - ); - - $select->joinLeft( - array($countTableName => $tableName), - $joinCondition, - array($columnName => 'value') - ); - - if ($attribute->getFlatUpdateSelect($this->_storeId) instanceof \Magento\DB\Select) { - $attributeCode = $attribute->getAttributeCode(); - $columnValueName = $attributeCode . $this->_valueFieldSuffix; - if (isset($flatColumns[$columnValueName])) { - $valueJoinCondition = sprintf( - 'e.%1$s = %2$s.option_id AND %2$s.store_id = 0', - $attributeCode, - $countTableName - ); - $selectValue->joinLeft( - array($countTableName => $this->_productIndexerHelper->getTable('eav_attribute_option_value')), - $valueJoinCondition, - array($columnValueName => $countTableName . '.value') - ); - $valueColumns[] = $columnValueName; - } - } - } - - if (!empty($changedIds)) { - $select->where( - $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) - ); - } - - $sql = $select->insertFromSelect($temporaryTableName, $columns, true); - $this->_connection->query($sql); - - if (count($valueColumns) > 1) { - if (!empty($changedIds)) { - $selectValue->where( - $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) - ); - } - $sql = $selectValue->insertFromSelect($temporaryValueTableName, $valueColumns, true); - $this->_connection->query($sql); - } - } - } - - return $this; - } - - /** - * Add primary key to table by it name - * - * @param string $tableName - * @param string $columnName - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _addPrimaryKeyToTable($tableName, $columnName = 'entity_id') - { - $this->_connection->addIndex( - $tableName, - 'entity_id', - array($columnName), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_PRIMARY - ); - - return $this; - } - - /** - * Prepare flat table for store - * - * @throws \Magento\Core\Exception - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _createTemporaryFlatTable() - { - $columns = $this->_productIndexerHelper->getFlatColumns(); - - $indexesNeed = $this->_productIndexerHelper->getFlatIndexes(); - - $maxIndex = $this->_config->getValue(self::XML_NODE_MAX_INDEX_COUNT); - if ($maxIndex && count($indexesNeed) > $maxIndex) { - throw new \Magento\Core\Exception( - __("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes." - . "Currently there are %1\$d of them." - . "Please reduce the number of filterable/sortable attributes in order to use this module", - count($indexesNeed), $maxIndex) - ); - } - - $indexKeys = array(); - $indexProps = array_values($indexesNeed); - $upperPrimaryKey = strtoupper(\Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_PRIMARY); - foreach ($indexProps as $i => $indexProp) { - $indexName = $this->_connection->getIndexName( - $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($this->_storeId)), - $indexProp['fields'], - $indexProp['type'] - ); - $indexProp['type'] = strtoupper($indexProp['type']); - if ($indexProp['type'] == $upperPrimaryKey) { - $indexKey = $upperPrimaryKey; - } else { - $indexKey = $indexName; - } - - $indexProps[$i] = array( - 'KEY_NAME' => $indexName, - 'COLUMNS_LIST' => $indexProp['fields'], - 'INDEX_TYPE' => strtolower($indexProp['type']) - ); - $indexKeys[$i] = $indexKey; - } - $indexesNeed = array_combine($indexKeys, $indexProps); - - /** @var $table \Magento\DB\Ddl\Table */ - $table = $this->_connection->newTable( - $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($this->_storeId)) - ); - foreach ($columns as $fieldName => $fieldProp) { - $columnLength = isset($fieldProp['length']) ? $fieldProp['length'] : null; - - $columnDefinition = array( - 'nullable' => isset($fieldProp['nullable']) ? (bool)$fieldProp['nullable'] : false, - 'unsigned' => isset($fieldProp['unsigned']) ? (bool)$fieldProp['unsigned'] : false, - 'default' => isset($fieldProp['default']) ? $fieldProp['default'] : false, - 'primary' => false, - ); - - $columnComment = isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName; - - $table->addColumn( - $fieldName, - $fieldProp['type'], - $columnLength, - $columnDefinition, - $columnComment - ); - } - - foreach ($indexesNeed as $indexProp) { - $table->addIndex( - $indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], - array('type' => $indexProp['INDEX_TYPE']) - ); - } - - $table->setComment("Catalog Product Flat (Store {$this->_storeId})"); - - $this->_connection->dropTable( - $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($this->_storeId)) - ); - $this->_connection->createTable($table); - - return $this; - } - - /** - * Fill temporary flat table by data from temporary flat table parts - * - * @param array $tables - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _fillTemporaryFlatTable(array $tables) - { - $select = $this->_connection->select(); - $temporaryFlatTableName = $this->_getTemporaryTableName( - $this->_productIndexerHelper->getFlatTableName($this->_storeId) - ); - $flatColumns = $this->_productIndexerHelper->getFlatColumns(); - $entityTableName = $this->_productIndexerHelper->getTable('catalog_product_entity'); - $entityTemporaryTableName = $this->_getTemporaryTableName($entityTableName); - $columnsList = array_keys($tables[$entityTableName]); - $websiteId = (int)$this->_storeManager->getStore($this->_storeId)->getWebsiteId(); - - unset($tables[$entityTableName]); - - $allColumns = array_merge( - array( - 'entity_id', - 'type_id', - 'attribute_set_id', - ), - $columnsList - ); - - /* @var $status \Magento\Eav\Model\Entity\Attribute */ - $status = $this->_productIndexerHelper->getAttribute('status'); - $statusTable = $this->_getTemporaryTableName($status->getBackendTable()); - $statusConditions = array('e.entity_id = dstatus.entity_id', - 'dstatus.entity_type_id = ' . (int)$status->getEntityTypeId(), 'dstatus.store_id = ' . (int)$this->_storeId, - 'dstatus.attribute_id = ' . (int)$status->getId()); - $statusExpression = $this->_connection->getIfNullSql('dstatus.value', - $this->_connection->quoteIdentifier("$statusTable.status")); - - $select->from( - array('e' => $entityTemporaryTableName), - $allColumns - )->joinInner( - array('wp' => $this->_productIndexerHelper->getTable('catalog_product_website')), - 'wp.product_id = e.entity_id AND wp.website_id = ' . $websiteId, - array() - )->joinLeft( - array('dstatus' => $status->getBackend()->getTable()), - implode(' AND ', $statusConditions), - array() - )->where( - $statusExpression . ' = ' . \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED - ); - - foreach ($tables as $tableName => $columns) { - $columnValueNames = array(); - $temporaryTableName = $this->_getTemporaryTableName($tableName); - $temporaryValueTableName = $temporaryTableName . $this->_valueFieldSuffix; - $columnsNames = array_keys($columns); - - $select->joinLeft( - $temporaryTableName, - 'e.entity_id = ' . $temporaryTableName. '.entity_id', - $columnsNames - ); - $allColumns = array_merge($allColumns, $columnsNames); - - foreach ($columnsNames as $name ) { - $columnValueName = $name . $this->_valueFieldSuffix; - if (isset($flatColumns[$columnValueName])) { - $columnValueNames[] = $columnValueName; - } - } - if (!empty($columnValueNames)) { - $select->joinLeft( - $temporaryValueTableName, - 'e.entity_id = ' . $temporaryValueTableName. '.entity_id', - $columnValueNames - ); - $allColumns = array_merge($allColumns, $columnValueNames); - } - } - $sql = $select->insertFromSelect($temporaryFlatTableName, $allColumns, false); - $this->_connection->query($sql); - - return $this; - } - - /** - * Apply diff. between 0 store and current store to temporary flat table - * - * @param array $tables - * @param array $changedIds - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _updateTemporaryTableByStoreValues(array $tables, array $changedIds) - { - $flatColumns = $this->_productIndexerHelper->getFlatColumns(); - $temporaryFlatTableName = $this->_getTemporaryTableName( - $this->_productIndexerHelper->getFlatTableName($this->_storeId) - ); - - foreach ($tables as $tableName => $columns) { - foreach ($columns as $attribute) { - /* @var $attribute \Magento\Eav\Model\Entity\Attribute */ - $attributeCode = $attribute->getAttributeCode(); - if ($attribute->getBackend()->getType() != 'static') { - $joinCondition = 't.entity_id = e.entity_id' - . ' AND t.entity_type_id = ' . $attribute->getEntityTypeId() - . ' AND t.attribute_id=' . $attribute->getId() - . ' AND t.store_id = ' . $this->_storeId - . ' AND t.value IS NOT NULL'; - /** @var $select \Magento\DB\Select */ - $select = $this->_connection->select() - ->joinInner( - array('t' => $tableName), - $joinCondition, - array($attributeCode => 't.value') - ); - if (!empty($changedIds)) { - $select->where( - $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) - ); - } - $sql = $select->crossUpdateFromSelect(array('e' => $temporaryFlatTableName)); - $this->_connection->query($sql); - } - - //Update not simple attributes (eg. dropdown) - if (isset($flatColumns[$attributeCode . $this->_valueFieldSuffix])) { - $select = $this->_connection->select() - ->joinInner( - array('t' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')), - 't.option_id = e.' . $attributeCode . ' AND t.store_id=' . $this->_storeId, - array($attributeCode . $this->_valueFieldSuffix => 't.value') - ); - if (!empty($changedIds)) { - $select->where( - $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) - ); - } - $sql = $select->crossUpdateFromSelect(array('e' => $temporaryFlatTableName)); - $this->_connection->query($sql); - } - } - } - - return $this; - } - - /** - * Swap flat product table and temporary flat table and drop old one - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction - */ - protected function _moveDataToFlatTable() - { - $flatTable = $this->_productIndexerHelper->getFlatTableName($this->_storeId); - $flatDropName = $flatTable . $this->_tableDropSuffix; - $temporaryFlatTableName = $this->_getTemporaryTableName( - $this->_productIndexerHelper->getFlatTableName($this->_storeId) - ); - $renameTables = array(); - - if ($this->_connection->isTableExists($flatTable)) { - $renameTables[] = array( - 'oldName' => $flatTable, - 'newName' => $flatDropName, - ); - } - $renameTables[] = array( - 'oldName' => $temporaryFlatTableName, - 'newName' => $flatTable, - ); - - $this->_connection->dropTable($flatDropName); - $this->_connection->renameTablesBatch($renameTables); - $this->_connection->dropTable($flatDropName); - - return $this; - } - /** * Drop temporary tables created by reindex process * * @param array $tablesList - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction + * @param int|string $storeId */ - protected function _cleanOnFailure(array $tablesList) + protected function _cleanOnFailure(array $tablesList, $storeId) { foreach ($tablesList as $table => $columns) { $this->_connection->dropTemporaryTable($table); } - $tableName = $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($this->_storeId)); + $tableName = $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($storeId)); $this->_connection->dropTable($tableName); - return $this; } /** @@ -759,70 +219,24 @@ protected function _cleanOnFailure(array $tablesList) * @param int $storeId * @param array $changedIds * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction * @throws \Exception */ protected function _reindex($storeId, array $changedIds = array()) { - $this->_storeId = $storeId; - $entityTableName = $this->_productIndexerHelper->getTable('catalog_product_entity'); - $attributes = $this->_productIndexerHelper->getAttributes(); - $eavAttributes = $this->_productIndexerHelper->getTablesStructure($attributes); - $entityTableColumns = $eavAttributes[$entityTableName]; - try { - //We should prepare temp. tables only for first call of reindex all - if (!self::$_calls) { - $temporaryEavAttributes = $eavAttributes; - - //add status global value to the base table - /* @var $status \Magento\Eav\Model\Entity\Attribute */ - $status = $this->_productIndexerHelper->getAttribute('status'); - $temporaryEavAttributes[$status->getBackendTable()]['status'] = $status; - //Create list of temporary tables based on available attributes attributes - foreach ($temporaryEavAttributes as $tableName => $columns) { - $this->_createTemporaryTable($this->_getTemporaryTableName($tableName), $columns); - } - - //Fill "base" table which contains all available products - $this->_fillTemporaryEntityTable($entityTableName, $entityTableColumns, $changedIds); - - //Add primary key to "base" temporary table for increase speed of joins in future - $this->_addPrimaryKeyToTable($this->_getTemporaryTableName($entityTableName)); - unset($temporaryEavAttributes[$entityTableName]); - - foreach ($temporaryEavAttributes as $tableName => $columns) { - $temporaryTableName = $this->_getTemporaryTableName($tableName); - - //Add primary key to temporary table for increase speed of joins in future - $this->_addPrimaryKeyToTable($temporaryTableName); - - //Create temporary table for composite attributes - if (isset($this->_valueTables[$temporaryTableName . $this->_valueFieldSuffix])) { - $this->_addPrimaryKeyToTable($temporaryTableName . $this->_valueFieldSuffix); - } - - //Fill temporary tables with attributes grouped by it type - $this->_fillTemporaryTable($tableName, $columns, $changedIds); - } - } - //Create and fill flat temporary table - $this->_createTemporaryFlatTable(); - $this->_fillTemporaryFlatTable($eavAttributes); - //Update zero based attributes by values from current store - $this->_updateTemporaryTableByStoreValues($eavAttributes, $changedIds); + $this->_tableBuilder->build($storeId, $changedIds, $this->_valueFieldSuffix); + $this->_flatTableBuilder->build( + $storeId, $changedIds, $this->_valueFieldSuffix, $this->_tableDropSuffix, true + ); - //Rename current flat table to "drop", rename temporary flat to flat and drop "drop" table - $this->_moveDataToFlatTable(); - $this->_updateRelationProducts($this->_storeId, $changedIds); - $this->_cleanRelationProducts($this->_storeId); - self::$_calls++; + $this->_updateRelationProducts($storeId, $changedIds); + $this->_cleanRelationProducts($storeId); } catch (\Exception $e) { - $this->_cleanOnFailure($eavAttributes); + $attributes = $this->_productIndexerHelper->getAttributes(); + $eavAttributes = $this->_productIndexerHelper->getTablesStructure($attributes); + $this->_cleanOnFailure($eavAttributes, $storeId); throw $e; } - - return $this; } /** @@ -877,7 +291,7 @@ protected function _getProductTypeInstances() */ protected function _updateRelationProducts($storeId, $productIds = null) { - if (!$this->_flatProductHelper->isAddChildData() || !$this->_isFlatTableExists($storeId)) { + if (!$this->_productIndexerHelper->isAddChildData() || !$this->_isFlatTableExists($storeId)) { return $this; } @@ -934,7 +348,7 @@ protected function _updateRelationProducts($storeId, $productIds = null) */ protected function _cleanRelationProducts($storeId) { - if (!$this->_flatProductHelper->isAddChildData()) { + if (!$this->_productIndexerHelper->isAddChildData()) { return $this; } @@ -994,13 +408,12 @@ protected function _cleanRelationProducts($storeId) */ protected function _reindexSingleProduct($storeId, $productId) { - $this->_storeId = $storeId; - - $flatTable = $this->_productIndexerHelper->getFlatTableName($this->_storeId); + $flatTable = $this->_productIndexerHelper->getFlatTableName($storeId); if (!$this->_connection->isTableExists($flatTable)) { - $this->_createTemporaryFlatTable(); - $this->_moveDataToFlatTable(); + $this->_flatTableBuilder->build( + $storeId, array($productId), $this->_valueFieldSuffix, $this->_tableDropSuffix, false + ); } $attributes = $this->_productIndexerHelper->getAttributes(); @@ -1050,7 +463,7 @@ protected function _reindexSingleProduct($storeId, $productId) array('t2' => $tableName), 't.entity_id = t2.entity_id ' . ' AND t.attribute_id = t2.attribute_id ' - . $this->_connection->quoteInto(' AND t2.store_id = ?', $this->_storeId), + . $this->_connection->quoteInto(' AND t2.store_id = ?', $storeId), array() )->where( 'e.entity_id = ' . $productId diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows.php index f6666302857ba..9c9ff84e3011e 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows.php @@ -55,42 +55,4 @@ public function execute($ids) } return $this; } - - /** - * Move data from temporary flat table into regular flat table. - * - * @return \Magento\Catalog\Model\Indexer\Product\Flat\Action\Rows - */ - protected function _moveDataToFlatTable() - { - $flatTable = $this->_productIndexerHelper->getFlatTableName($this->_storeId); - - if (!$this->_connection->isTableExists($flatTable)) { - parent::_moveDataToFlatTable(); - } else { - $describe = $this->_connection->describeTable( - $this->_productIndexerHelper->getFlatTableName($this->_storeId) - ); - $columns = $this->_productIndexerHelper->getFlatColumns(); - $columns = array_keys(array_intersect_key($describe, $columns)); - $select = $this->_connection->select(); - - $select->from( - array( - 'tf' => $this->_getTemporaryTableName( - $this->_productIndexerHelper->getFlatTableName($this->_storeId) - ), - ), - $columns - ); - $sql = $select->insertFromSelect($flatTable, $columns); - $this->_connection->query($sql); - - $this->_connection->dropTable( - $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($this->_storeId)) - ); - } - - return $this; - } } diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php new file mode 100644 index 0000000000000..0033c0c8f6f13 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php @@ -0,0 +1,96 @@ +_resource = $resource; + $this->_productIndexerHelper = $productIndexerHelper; + } + + /** + * Move data from temporary tables to flat + * + * @param string $flatTable + * @param string $flatDropName + * @param string $temporaryFlatTableName + */ + public function move($flatTable, $flatDropName, $temporaryFlatTableName) + { + $connection = $this->_resource->getConnection('write'); + if (!$connection->isTableExists($flatTable)) { + $connection->dropTable($flatDropName); + $connection->renameTablesBatch(array( + 'oldName' => $temporaryFlatTableName, + 'newName' => $flatTable + )); + $connection->dropTable($flatDropName); + } else { + $describe = $connection->describeTable($flatTable); + $columns = $this->_productIndexerHelper->getFlatColumns(); + $columns = array_keys(array_intersect_key($describe, $columns)); + $select = $connection->select(); + + $select->from( + array('tf' => sprintf('%s_tmp_indexer', $flatTable)), + $columns + ); + $sql = $select->insertFromSelect($flatTable, $columns); + $connection->query($sql); + + $connection->dropTable( + sprintf('%s_tmp_indexer', $flatTable) + ); + } + } +} diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php new file mode 100644 index 0000000000000..33db716642088 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php @@ -0,0 +1,357 @@ +_productIndexerHelper = $productIndexerHelper; + $this->_connection = $resource->getConnection('write'); + $this->_config = $config; + $this->_storeManager = $storeManager; + $this->_tableData = $tableData; + } + + /** + * Prepare temporary flat tables + * + * @param int|string $storeId + * @param array $changedIds + * @param string $valueFieldSuffix + * @param string $tableDropSuffix + * @param bool $fillTmpTables + */ + public function build($storeId, $changedIds, $valueFieldSuffix, $tableDropSuffix, $fillTmpTables) + { + $attributes = $this->_productIndexerHelper->getAttributes(); + $eavAttributes = $this->_productIndexerHelper->getTablesStructure($attributes); + + + $this->_createTemporaryFlatTable($storeId); + + if ($fillTmpTables) { + $this->_fillTemporaryFlatTable($eavAttributes, $storeId, $valueFieldSuffix); + //Update zero based attributes by values from current store + $this->_updateTemporaryTableByStoreValues($eavAttributes, $changedIds, $storeId, $valueFieldSuffix); + } + + $flatTable = $this->_productIndexerHelper->getFlatTableName($storeId); + $flatDropName = $flatTable . $tableDropSuffix; + $temporaryFlatTableName = $this->_getTemporaryTableName( + $this->_productIndexerHelper->getFlatTableName($storeId) + ); + $this->_tableData->move($flatTable, $flatDropName, $temporaryFlatTableName); + } + + /** + * Prepare flat table for store + * + * @param int|string $storeId + * @throws \Magento\Core\Exception + */ + protected function _createTemporaryFlatTable($storeId) + { + $columns = $this->_productIndexerHelper->getFlatColumns(); + + $indexesNeed = $this->_productIndexerHelper->getFlatIndexes(); + + $maxIndex = $this->_config->getValue( + \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction::XML_NODE_MAX_INDEX_COUNT + ); + if ($maxIndex && count($indexesNeed) > $maxIndex) { + throw new \Magento\Core\Exception( + __("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes." + . "Currently there are %1\$d of them." + . "Please reduce the number of filterable/sortable attributes in order to use this module", + count($indexesNeed), $maxIndex) + ); + } + + $indexKeys = array(); + $indexProps = array_values($indexesNeed); + $upperPrimaryKey = strtoupper(\Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_PRIMARY); + foreach ($indexProps as $i => $indexProp) { + $indexName = $this->_connection->getIndexName( + $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($storeId)), + $indexProp['fields'], + $indexProp['type'] + ); + $indexProp['type'] = strtoupper($indexProp['type']); + if ($indexProp['type'] == $upperPrimaryKey) { + $indexKey = $upperPrimaryKey; + } else { + $indexKey = $indexName; + } + + $indexProps[$i] = array( + 'KEY_NAME' => $indexName, + 'COLUMNS_LIST' => $indexProp['fields'], + 'INDEX_TYPE' => strtolower($indexProp['type']) + ); + $indexKeys[$i] = $indexKey; + } + $indexesNeed = array_combine($indexKeys, $indexProps); + + /** @var $table \Magento\DB\Ddl\Table */ + $table = $this->_connection->newTable( + $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($storeId)) + ); + foreach ($columns as $fieldName => $fieldProp) { + $columnLength = isset($fieldProp['length']) ? $fieldProp['length'] : null; + + $columnDefinition = array( + 'nullable' => isset($fieldProp['nullable']) ? (bool)$fieldProp['nullable'] : false, + 'unsigned' => isset($fieldProp['unsigned']) ? (bool)$fieldProp['unsigned'] : false, + 'default' => isset($fieldProp['default']) ? $fieldProp['default'] : false, + 'primary' => false, + ); + + $columnComment = isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName; + + $table->addColumn( + $fieldName, + $fieldProp['type'], + $columnLength, + $columnDefinition, + $columnComment + ); + } + + foreach ($indexesNeed as $indexProp) { + $table->addIndex( + $indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], + array('type' => $indexProp['INDEX_TYPE']) + ); + } + + $table->setComment("Catalog Product Flat (Store {$storeId})"); + + $this->_connection->dropTable( + $this->_getTemporaryTableName($this->_productIndexerHelper->getFlatTableName($storeId)) + ); + $this->_connection->createTable($table); + } + + /** + * Fill temporary flat table by data from temporary flat table parts + * + * @param array $tables + * @param int|string $storeId + * @param string $valueFieldSuffix + */ + protected function _fillTemporaryFlatTable(array $tables, $storeId, $valueFieldSuffix) + { + $select = $this->_connection->select(); + $temporaryFlatTableName = $this->_getTemporaryTableName( + $this->_productIndexerHelper->getFlatTableName($storeId) + ); + $flatColumns = $this->_productIndexerHelper->getFlatColumns(); + $entityTableName = $this->_productIndexerHelper->getTable('catalog_product_entity'); + $entityTemporaryTableName = $this->_getTemporaryTableName($entityTableName); + $columnsList = array_keys($tables[$entityTableName]); + $websiteId = (int)$this->_storeManager->getStore($storeId)->getWebsiteId(); + + unset($tables[$entityTableName]); + + $allColumns = array_merge( + array( + 'entity_id', + 'type_id', + 'attribute_set_id', + ), + $columnsList + ); + + /* @var $status \Magento\Eav\Model\Entity\Attribute */ + $status = $this->_productIndexerHelper->getAttribute('status'); + $statusTable = $this->_getTemporaryTableName($status->getBackendTable()); + $statusConditions = array('e.entity_id = dstatus.entity_id', + 'dstatus.entity_type_id = ' . (int)$status->getEntityTypeId(), 'dstatus.store_id = ' . (int)$storeId, + 'dstatus.attribute_id = ' . (int)$status->getId()); + $statusExpression = $this->_connection->getIfNullSql('dstatus.value', + $this->_connection->quoteIdentifier("$statusTable.status")); + + $select->from( + array('e' => $entityTemporaryTableName), + $allColumns + )->joinInner( + array('wp' => $this->_productIndexerHelper->getTable('catalog_product_website')), + 'wp.product_id = e.entity_id AND wp.website_id = ' . $websiteId, + array() + )->joinLeft( + array('dstatus' => $status->getBackend()->getTable()), + implode(' AND ', $statusConditions), + array() + )->where( + $statusExpression . ' = ' . \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED + ); + + foreach ($tables as $tableName => $columns) { + $columnValueNames = array(); + $temporaryTableName = $this->_getTemporaryTableName($tableName); + $temporaryValueTableName = $temporaryTableName . $valueFieldSuffix; + $columnsNames = array_keys($columns); + + $select->joinLeft( + $temporaryTableName, + 'e.entity_id = ' . $temporaryTableName. '.entity_id', + $columnsNames + ); + $allColumns = array_merge($allColumns, $columnsNames); + + foreach ($columnsNames as $name ) { + $columnValueName = $name . $valueFieldSuffix; + if (isset($flatColumns[$columnValueName])) { + $columnValueNames[] = $columnValueName; + } + } + if (!empty($columnValueNames)) { + $select->joinLeft( + $temporaryValueTableName, + 'e.entity_id = ' . $temporaryValueTableName. '.entity_id', + $columnValueNames + ); + $allColumns = array_merge($allColumns, $columnValueNames); + } + } + $sql = $select->insertFromSelect($temporaryFlatTableName, $allColumns, false); + $this->_connection->query($sql); + } + + /** + * Apply diff. between 0 store and current store to temporary flat table + * + * @param array $tables + * @param array $changedIds + * @param int|string $storeId + * @param string $valueFieldSuffix + */ + protected function _updateTemporaryTableByStoreValues(array $tables, array $changedIds, $storeId, $valueFieldSuffix) + { + $flatColumns = $this->_productIndexerHelper->getFlatColumns(); + $temporaryFlatTableName = $this->_getTemporaryTableName( + $this->_productIndexerHelper->getFlatTableName($storeId) + ); + + foreach ($tables as $tableName => $columns) { + foreach ($columns as $attribute) { + /* @var $attribute \Magento\Eav\Model\Entity\Attribute */ + $attributeCode = $attribute->getAttributeCode(); + if ($attribute->getBackend()->getType() != 'static') { + $joinCondition = 't.entity_id = e.entity_id' + . ' AND t.entity_type_id = ' . $attribute->getEntityTypeId() + . ' AND t.attribute_id=' . $attribute->getId() + . ' AND t.store_id = ' . $storeId + . ' AND t.value IS NOT NULL'; + /** @var $select \Magento\DB\Select */ + $select = $this->_connection->select() + ->joinInner( + array('t' => $tableName), + $joinCondition, + array($attributeCode => 't.value') + ); + if (!empty($changedIds)) { + $select->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) + ); + } + $sql = $select->crossUpdateFromSelect(array('e' => $temporaryFlatTableName)); + $this->_connection->query($sql); + } + + //Update not simple attributes (eg. dropdown) + if (isset($flatColumns[$attributeCode . $valueFieldSuffix])) { + $select = $this->_connection->select() + ->joinInner( + array('t' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')), + 't.option_id = e.' . $attributeCode . ' AND t.store_id=' . $storeId, + array($attributeCode . $valueFieldSuffix => 't.value') + ); + if (!empty($changedIds)) { + $select->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) + ); + } + $sql = $select->crossUpdateFromSelect(array('e' => $temporaryFlatTableName)); + $this->_connection->query($sql); + } + } + } + } + + /** + * Retrieve temporary table name by regular table name + * + * @param string $tableName + * @return string + */ + protected function _getTemporaryTableName($tableName) + { + return sprintf('%s_tmp_indexer', $tableName); + } +} diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Plugin/IndexerConfigData.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Plugin/IndexerConfigData.php index 812e5a0ac7e80..8d2956b113566 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Plugin/IndexerConfigData.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Plugin/IndexerConfigData.php @@ -29,17 +29,17 @@ class IndexerConfigData { /** - * @var \Magento\Catalog\Helper\Product\Flat + * @var \Magento\Catalog\Model\Indexer\Product\Flat\State */ - protected $_helper; + protected $_state; /** - * @param \Magento\Catalog\Helper\Product\Flat $helper + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $state */ public function __construct( - \Magento\Catalog\Helper\Product\Flat $helper + \Magento\Catalog\Model\Indexer\Product\Flat\State $state ) { - $this->_helper = $helper; + $this->_state = $state; } /** @@ -54,7 +54,7 @@ public function aroundGet(array $arguments, \Magento\Code\Plugin\InvocationChain { $data = $invocationChain->proceed($arguments); - if (!$this->_helper->isEnabled()) { + if (!$this->_state->isFlatEnabled()) { $indexerId = \Magento\Catalog\Model\Indexer\Product\Flat\Processor::INDEXER_ID; if ((!isset($arguments['path']) || !$arguments['path']) && isset($data[$indexerId])) { unset($data[$indexerId]); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Processor.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Processor.php index 1320a77316115..168b0c9a3b788 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Processor.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Processor.php @@ -39,20 +39,20 @@ class Processor protected $_indexer; /** - * @var \Magento\Catalog\Helper\Product\Flat + * @var \Magento\Catalog\Model\Indexer\Product\Flat\State */ - protected $_helper; + protected $_state; /** * @param \Magento\Indexer\Model\Indexer $indexer - * @param \Magento\Catalog\Helper\Product\Flat $helper + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $state */ public function __construct( \Magento\Indexer\Model\Indexer $indexer, - \Magento\Catalog\Helper\Product\Flat $helper + \Magento\Catalog\Model\Indexer\Product\Flat\State $state ) { $this->_indexer = $indexer; - $this->_helper = $helper; + $this->_state = $state; } /** @@ -75,7 +75,7 @@ public function getIndexer() */ public function reindexRow($id) { - if (!$this->_helper->isEnabled() || $this->getIndexer()->isScheduled()) { + if (!$this->_state->isFlatEnabled() || $this->getIndexer()->isScheduled()) { return; } $this->getIndexer()->reindexRow($id); @@ -88,7 +88,7 @@ public function reindexRow($id) */ public function reindexList($ids) { - if (!$this->_helper->isEnabled() || $this->getIndexer()->isScheduled()) { + if (!$this->_state->isFlatEnabled() || $this->getIndexer()->isScheduled()) { return; } $this->getIndexer()->reindexList($ids); @@ -99,7 +99,7 @@ public function reindexList($ids) */ public function reindexAll() { - if (!$this->_helper->isEnabled()) { + if (!$this->_state->isFlatEnabled()) { return; } $this->getIndexer()->reindexAll(); @@ -110,6 +110,9 @@ public function reindexAll() */ public function markIndexerAsInvalid() { + if (!$this->_state->isFlatEnabled()) { + return; + } $this->getIndexer()->invalidate(); } } diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php new file mode 100644 index 0000000000000..5570afcffd098 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php @@ -0,0 +1,70 @@ +storeConfig = $storeConfig; + $this->flatIndexer = $flatIndexer; + $this->_productFlatIndexerHelper = $flatIndexerHelper; + $this->isAvailable = $isAvailable; + parent::__construct($storeConfig, $flatIndexer, $isAvailable); + } + + /** + * @return \Magento\Catalog\Helper\Product\Flat\Indexer + */ + public function getFlatIndexerHelper() + { + return $this->_productFlatIndexerHelper; + } +} diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php index 4b4e62d1d7073..92a0e25b66f39 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php @@ -35,8 +35,8 @@ class Mode extends \Magento\Core\Model\Config\Value protected $_productFlatIndexerProcessor; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor @@ -45,8 +45,8 @@ class Mode extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor, diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php new file mode 100644 index 0000000000000..c03c65157ca73 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php @@ -0,0 +1,353 @@ +_productIndexerHelper = $productIndexerHelper; + $this->_connection = $resource->getConnection('write'); + } + + /** + * Prepare temporary tables only for first call of reindex all + * + * @param $storeId + * @param $changedIds + * @param $valueFieldSuffix + */ + public function build($storeId, $changedIds, $valueFieldSuffix) + { + if ($this->_isExecuted) { + return; + } + $entityTableName = $this->_productIndexerHelper->getTable('catalog_product_entity'); + $attributes = $this->_productIndexerHelper->getAttributes(); + $eavAttributes = $this->_productIndexerHelper->getTablesStructure($attributes); + $entityTableColumns = $eavAttributes[$entityTableName]; + + $temporaryEavAttributes = $eavAttributes; + + //add status global value to the base table + /* @var $status \Magento\Eav\Model\Entity\Attribute */ + $status = $this->_productIndexerHelper->getAttribute('status'); + $temporaryEavAttributes[$status->getBackendTable()]['status'] = $status; + //Create list of temporary tables based on available attributes attributes + $valueTables = array(); + foreach ($temporaryEavAttributes as $tableName => $columns) { + $valueTables = array_merge( + $valueTables, + $this->_createTemporaryTable($this->_getTemporaryTableName($tableName), $columns, $valueFieldSuffix) + ); + } + + //Fill "base" table which contains all available products + $this->_fillTemporaryEntityTable($entityTableName, $entityTableColumns, $changedIds); + + //Add primary key to "base" temporary table for increase speed of joins in future + $this->_addPrimaryKeyToTable($this->_getTemporaryTableName($entityTableName)); + unset($temporaryEavAttributes[$entityTableName]); + + foreach ($temporaryEavAttributes as $tableName => $columns) { + $temporaryTableName = $this->_getTemporaryTableName($tableName); + + //Add primary key to temporary table for increase speed of joins in future + $this->_addPrimaryKeyToTable($temporaryTableName); + + //Create temporary table for composite attributes + if (isset($valueTables[$temporaryTableName . $valueFieldSuffix])) { + $this->_addPrimaryKeyToTable($temporaryTableName . $valueFieldSuffix); + } + + //Fill temporary tables with attributes grouped by it type + $this->_fillTemporaryTable($tableName, $columns, $changedIds, $valueFieldSuffix, $storeId); + } + $this->_isExecuted = true; + } + + /** + * Create empty temporary table with given columns list + * + * @param string $tableName Table name + * @param array $columns array('columnName' => \Magento\Catalog\Model\Resource\Eav\Attribute, ...) + * @param string $valueFieldSuffix + * + * @return array + */ + protected function _createTemporaryTable($tableName, array $columns, $valueFieldSuffix) + { + $valueTables = array(); + if (!empty($columns)) { + $valueTableName = $tableName . $valueFieldSuffix; + $temporaryTable = $this->_connection->newTable($tableName); + $valueTemporaryTable = $this->_connection->newTable($valueTableName); + $flatColumns = $this->_productIndexerHelper->getFlatColumns(); + + $temporaryTable->addColumn( + 'entity_id', + \Magento\DB\Ddl\Table::TYPE_INTEGER + ); + + $temporaryTable->addColumn( + 'type_id', + \Magento\DB\Ddl\Table::TYPE_TEXT + ); + + $temporaryTable->addColumn( + 'attribute_set_id', + \Magento\DB\Ddl\Table::TYPE_INTEGER + ); + + $valueTemporaryTable->addColumn( + 'entity_id', + \Magento\DB\Ddl\Table::TYPE_INTEGER + ); + + /** @var $attribute \Magento\Catalog\Model\Resource\Eav\Attribute */ + foreach ($columns as $columnName => $attribute) { + $attributeCode = $attribute->getAttributeCode(); + if (isset($flatColumns[$attributeCode])) { + $column = $flatColumns[$attributeCode]; + } else { + $column = $attribute->_getFlatColumnsDdlDefinition(); + $column = $column[$attributeCode]; + } + + $temporaryTable->addColumn( + $columnName, + $column['type'], + isset($column['length']) ? $column['length'] : null + ); + + $columnValueName = $attributeCode . $valueFieldSuffix; + if (isset($flatColumns[$columnValueName])) { + $columnValue = $flatColumns[$columnValueName]; + $valueTemporaryTable->addColumn( + $columnValueName, + $columnValue['type'], + isset($columnValue['length']) ? $columnValue['length'] : null + ); + } + } + $this->_connection->dropTemporaryTable($tableName); + $this->_connection->createTemporaryTable($temporaryTable); + + if (count($valueTemporaryTable->getColumns()) > 1) { + $this->_connection->dropTemporaryTable($valueTableName); + $this->_connection->createTemporaryTable($valueTemporaryTable); + $valueTables[$valueTableName] = $valueTableName; + } + } + return $valueTables; + } + + /** + * Retrieve temporary table name by regular table name + * + * @param string $tableName + * @return string + */ + protected function _getTemporaryTableName($tableName) + { + return sprintf('%s_tmp_indexer', $tableName); + } + + /** + * Fill temporary entity table + * + * @param string $tableName + * @param array $columns + * @param array $changedIds + */ + protected function _fillTemporaryEntityTable($tableName, array $columns, array $changedIds = array()) + { + if (!empty($columns)) { + $select = $this->_connection->select(); + $temporaryEntityTable = $this->_getTemporaryTableName($tableName); + $idsColumns = array( + 'entity_id', + 'type_id', + 'attribute_set_id', + ); + + $columns = array_merge($idsColumns, array_keys($columns)); + + $select->from(array('e' => $tableName), $columns); + $onDuplicate = false; + if (!empty($changedIds)) { + $select->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) + ); + $onDuplicate = true; + } + $sql = $select->insertFromSelect($temporaryEntityTable, $columns, $onDuplicate); + $this->_connection->query($sql); + } + } + + /** + * Add primary key to table by it name + * + * @param string $tableName + * @param string $columnName + */ + protected function _addPrimaryKeyToTable($tableName, $columnName = 'entity_id') + { + $this->_connection->addIndex( + $tableName, + 'entity_id', + array($columnName), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_PRIMARY + ); + } + + /** + * Fill temporary table by data from products EAV attributes by type + * + * @param string $tableName + * @param array $tableColumns + * @param array $changedIds + * @param string $valueFieldSuffix + * @param int $storeId + */ + protected function _fillTemporaryTable( + $tableName, array $tableColumns, array $changedIds, $valueFieldSuffix, $storeId + ) { + if (!empty($tableColumns)) { + + $columnsChunks = array_chunk( + $tableColumns, \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction::ATTRIBUTES_CHUNK_SIZE, true + ); + foreach ($columnsChunks as $columnsList) { + $select = $this->_connection->select(); + $selectValue = $this->_connection->select(); + $entityTableName = $this->_getTemporaryTableName( + $this->_productIndexerHelper->getTable('catalog_product_entity') + ); + $temporaryTableName = $this->_getTemporaryTableName($tableName); + $temporaryValueTableName = $temporaryTableName . $valueFieldSuffix; + $keyColumn = array('entity_id'); + $columns = array_merge($keyColumn, array_keys($columnsList)); + $valueColumns = $keyColumn; + $flatColumns = $this->_productIndexerHelper->getFlatColumns(); + $iterationNum = 1; + + $select->from( + array('e' => $entityTableName), + $keyColumn + ); + + $selectValue->from( + array('e' => $temporaryTableName), + $keyColumn + ); + + /** @var $attribute \Magento\Catalog\Model\Resource\Eav\Attribute */ + foreach ($columnsList as $columnName => $attribute) { + $countTableName = 't' . $iterationNum++; + $joinCondition = sprintf( + 'e.entity_id = %1$s.entity_id AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0', + $countTableName, + $attribute->getId() + ); + + $select->joinLeft( + array($countTableName => $tableName), + $joinCondition, + array($columnName => 'value') + ); + + if ($attribute->getFlatUpdateSelect($storeId) instanceof \Magento\DB\Select) { + $attributeCode = $attribute->getAttributeCode(); + $columnValueName = $attributeCode . $valueFieldSuffix; + if (isset($flatColumns[$columnValueName])) { + $valueJoinCondition = sprintf( + 'e.%1$s = %2$s.option_id AND %2$s.store_id = 0', + $attributeCode, + $countTableName + ); + $selectValue->joinLeft( + array($countTableName => $this->_productIndexerHelper + ->getTable('eav_attribute_option_value') + ), + $valueJoinCondition, + array($columnValueName => $countTableName . '.value') + ); + $valueColumns[] = $columnValueName; + } + } + } + + if (!empty($changedIds)) { + $select->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) + ); + } + + $sql = $select->insertFromSelect($temporaryTableName, $columns, true); + $this->_connection->query($sql); + + if (count($valueColumns) > 1) { + if (!empty($changedIds)) { + $selectValue->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds) + ); + } + $sql = $selectValue->insertFromSelect($temporaryValueTableName, $valueColumns, true); + $this->_connection->query($sql); + } + } + } + } +} diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php new file mode 100644 index 0000000000000..b0bb56f54df46 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php @@ -0,0 +1,80 @@ +_resource = $resource; + } + + /** + * Move data from temporary tables to flat + * + * @param string $flatTable + * @param string $flatDropName + * @param string $temporaryFlatTableName + */ + public function move($flatTable, $flatDropName, $temporaryFlatTableName) + { + $connection = $this->_resource->getConnection('write'); + $renameTables = array(); + + if ($connection->isTableExists($flatTable)) { + $renameTables[] = array( + 'oldName' => $flatTable, + 'newName' => $flatDropName, + ); + } + $renameTables[] = array( + 'oldName' => $temporaryFlatTableName, + 'newName' => $flatTable, + ); + + $connection->dropTable($flatDropName); + $connection->renameTablesBatch($renameTables); + $connection->dropTable($flatDropName); + } +} diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableDataInterface.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableDataInterface.php new file mode 100644 index 0000000000000..b01ff01599eae --- /dev/null +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableDataInterface.php @@ -0,0 +1,42 @@ +_layerStateFactory = $layerStateFactory; diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Category.php b/app/code/Magento/Catalog/Model/Layer/Filter/Category.php index f0e3fd6659ae5..a1b344c96c5fd 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Category.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Category.php @@ -59,7 +59,7 @@ class Category extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -78,7 +78,7 @@ class Category extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Escaper $escaper - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -87,7 +87,7 @@ public function __construct( \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Escaper $escaper, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_categoryFactory = $categoryFactory; @@ -195,9 +195,8 @@ public function getCategory() */ protected function _getItemsData() { - $categoty = $this->getCategory(); - /** @var $category \Magento\Catalog\Model\Categeory */ - $categories = $categoty->getChildrenCategories(); + $category = $this->getCategory(); + $categories = $category->getChildrenCategories(); $this->getLayer()->getProductCollection() ->addCountToCategories($categories); diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php index 9022eb4cfb478..a61aa6b617e31 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php @@ -65,7 +65,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -90,7 +90,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * @param \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -100,7 +100,7 @@ public function __construct( \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_resource = $filterPriceFactory->create(); diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 83663d93be957..11bc51f7596fe 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -253,8 +253,8 @@ class Product extends \Magento\Catalog\Model\AbstractModel protected $_productFlatIndexerProcessor; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param Product\Url $url * @param Product\Link $productLink @@ -282,8 +282,8 @@ class Product extends \Magento\Catalog\Model\AbstractModel * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, Product\Url $url, Product\Link $productLink, diff --git a/app/code/Magento/Catalog/Model/Product/Action.php b/app/code/Magento/Catalog/Model/Product/Action.php index 1b68d930d865d..ea9d77ed79571 100644 --- a/app/code/Magento/Catalog/Model/Product/Action.php +++ b/app/code/Magento/Catalog/Model/Product/Action.php @@ -54,8 +54,8 @@ class Action extends \Magento\Core\Model\AbstractModel protected $categoryIndexer; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Indexer\Model\IndexerInterface $categoryIndexer @@ -64,8 +64,8 @@ class Action extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory, \Magento\Index\Model\Indexer $indexIndexer, \Magento\Indexer\Model\IndexerInterface $categoryIndexer, diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Group.php b/app/code/Magento/Catalog/Model/Product/Attribute/Group.php index 09e9f07068fa1..15db2aad2e82c 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Group.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Group.php @@ -38,16 +38,16 @@ class Group extends \Magento\Eav\Model\Entity\Attribute\Group protected $_attributeCollectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Inputtype.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Inputtype.php index 4b70899f9851e..d5bddd122c056 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Inputtype.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Inputtype.php @@ -33,10 +33,10 @@ class Inputtype extends \Magento\Eav\Model\Adminhtml\System\Config\Source\Inputt /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Core event manager proxy * @@ -46,11 +46,11 @@ class Inputtype extends \Magento\Eav\Model\Adminhtml\System\Config\Source\Inputt /** * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_eventManager = $eventManager; $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Catalog/Model/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/Product/Compare/Item.php index 5298d7e7d9098..5a70c2cd51be2 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/Item.php @@ -90,8 +90,8 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession @@ -101,8 +101,8 @@ class Item extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php index adbedcf7f72ba..d73c035290461 100644 --- a/app/code/Magento/Catalog/Model/Product/Image.php +++ b/app/code/Magento/Catalog/Model/Product/Image.php @@ -182,8 +182,8 @@ class Image extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase @@ -197,8 +197,8 @@ class Image extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, diff --git a/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php b/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php index 9ab9f641a5e3f..15831083d59ee 100644 --- a/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php +++ b/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php @@ -66,16 +66,16 @@ class Eav extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_eavConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Product/Link.php b/app/code/Magento/Catalog/Model/Product/Link.php index 60cb878810ca6..2cc4d23b7573e 100644 --- a/app/code/Magento/Catalog/Model/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Product/Link.php @@ -70,8 +70,8 @@ class Link extends \Magento\Core\Model\AbstractModel protected $_linkCollectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Resource\Product\Link\CollectionFactory $linkCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory $productCollectionFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -79,8 +79,8 @@ class Link extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\Resource\Product\Link\CollectionFactory $linkCollectionFactory, \Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory $productCollectionFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Catalog/Model/Product/Option.php b/app/code/Magento/Catalog/Model/Product/Option.php index 8506ddde4c11e..fa83f15364acf 100644 --- a/app/code/Magento/Catalog/Model/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Product/Option.php @@ -111,8 +111,8 @@ class Option extends AbstractModel protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param Option\Value $productOptionValue * @param \Magento\Catalog\Model\Product\Option\Type\Factory $optionFactory * @param \Magento\Stdlib\String $string @@ -121,8 +121,8 @@ class Option extends AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, Option\Value $productOptionValue, \Magento\Catalog\Model\Product\Option\Type\Factory $optionFactory, \Magento\Stdlib\String $string, diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index 08a2cc7e3e4da..c28870911d4a5 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -68,16 +68,16 @@ class Value extends \Magento\Core\Model\AbstractModel protected $_valueCollectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $valueCollectionFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $valueCollectionFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index c5f661fe23055..7dfd8017b80aa 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -132,7 +132,7 @@ abstract public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $ /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -187,7 +187,7 @@ abstract public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $ * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param array $data */ @@ -200,7 +200,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, array $data = array() ) { @@ -506,7 +506,8 @@ public function processFileQueue() $path = dirname($dst); try { - $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR)->create($path); + $rootDir = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $rootDir->create($rootDir->getRelativePath($path)); } catch (\Magento\Filesystem\FilesystemException $e) { throw new \Magento\Core\Exception( __("We can't create writeable directory \"%1\".", $path) diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index 7e1d06eb5c5c0..4b555acb6297e 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -484,7 +484,7 @@ public function getProductCount($category) * * @param \Magento\Catalog\Model\Category $category * @param bool $isActive - * @return array + * @return \Magento\Catalog\Model\Category[] */ public function getParentCategories($category, $isActive = true) { @@ -540,7 +540,7 @@ public function getParentDesignCategory($category) * Return children categories of category * * @param \Magento\Catalog\Model\Category $category - * @return array + * @return \Magento\Catalog\Model\Category[] */ public function getChildrenCategories($category) { diff --git a/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php index 65b3d9b8258c1..6baa5772cd55b 100644 --- a/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php @@ -119,13 +119,13 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute protected $_productFlatIndexerProcessor; /** - * @var \Magento\Catalog\Helper\Product\Flat + * @var \Magento\Catalog\Helper\Product\Flat\Indexer */ - protected $_productFlatHelper; + protected $_productFlatIndexerHelper; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory @@ -136,15 +136,15 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute * @param \Magento\Catalog\Model\ProductFactory $catalogProductFactory * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor - * @param \Magento\Catalog\Helper\Product\Flat $productFlatHelper + * @param \Magento\Catalog\Helper\Product\Flat\Indexer $productFlatIndexerHelper * @param LockValidatorInterface $lockValidator * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\Data $coreData, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory, @@ -155,7 +155,7 @@ public function __construct( \Magento\Catalog\Model\ProductFactory $catalogProductFactory, \Magento\Index\Model\Indexer $indexIndexer, \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor, - \Magento\Catalog\Helper\Product\Flat $productFlatHelper, + \Magento\Catalog\Helper\Product\Flat\Indexer $productFlatIndexerHelper, LockValidatorInterface $lockValidator, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -163,7 +163,7 @@ public function __construct( ) { $this->_indexIndexer = $indexIndexer; $this->_productFlatIndexerProcessor = $productFlatIndexerProcessor; - $this->_productFlatHelper = $productFlatHelper; + $this->_productFlatIndexerHelper = $productFlatIndexerHelper; $this->attrLockValidator = $lockValidator; parent::__construct( $context, @@ -239,11 +239,11 @@ protected function _afterSave() $this->_eavConfig->clear(); $enableBefore = ($this->getOrigData('backend_type') == 'static') - || ($this->_productFlatHelper->isAddFilterableAttributes() && $this->getOrigData('is_filterable') > 0) + || ($this->_productFlatIndexerHelper->isAddFilterableAttributes() && $this->getOrigData('is_filterable') > 0) || ($this->getOrigData('used_in_product_listing') == 1) || ($this->getOrigData('used_for_sort_by') == 1); $enableAfter = ($this->getData('backend_type') == 'static') - || ($this->_productFlatHelper->isAddFilterableAttributes() && $this->getData('is_filterable') > 0) + || ($this->_productFlatIndexerHelper->isAddFilterableAttributes() && $this->getData('is_filterable') > 0) || ($this->getData('used_in_product_listing') == 1) || ($this->getData('used_for_sort_by') == 1); diff --git a/app/code/Magento/Catalog/Model/Resource/Product.php b/app/code/Magento/Catalog/Model/Resource/Product.php index 43c889c85d67b..f5e1f7050d169 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product.php +++ b/app/code/Magento/Catalog/Model/Resource/Product.php @@ -381,7 +381,8 @@ public function getAvailableInCategories($object) // fetching all parent IDs, including those are higher on the tree $select = $this->_getReadAdapter()->select()->distinct() ->from($this->getTable('catalog_category_product_index'), array('category_id')) - ->where('product_id = ? AND is_parent = 1', (int)$object->getEntityId()); + ->where('product_id = ? AND is_parent = 1', (int)$object->getEntityId()) + ->where('visibility != ?', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_NOT_VISIBLE); return $this->_getReadAdapter()->fetchCol($select); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php index 17ea71cc4bac2..533023987b1fc 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php @@ -201,9 +201,9 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl /** * Catalog product flat * - * @var \Magento\Catalog\Helper\Product\Flat + * @var \Magento\Catalog\Model\Indexer\Product\Flat\State */ - protected $_catalogProductFlat = null; + protected $_catalogProductFlatState = null; /** * Catalog data @@ -271,15 +271,15 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat - * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState + * @param Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Stdlib\DateTime $dateTime * @param \Zend_Db_Adapter_Abstract $connection - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -294,7 +294,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -304,7 +304,7 @@ public function __construct( $connection = null ) { $this->_catalogData = $catalogData; - $this->_catalogProductFlat = $catalogProductFlat; + $this->_catalogProductFlatState = $catalogProductFlatState; $this->_coreStoreConfig = $coreStoreConfig; $this->_productOptionFactory = $productOptionFactory; $this->_catalogUrl = $catalogUrl; @@ -414,11 +414,11 @@ public function getCurrencyRate() /** * Retrieve Catalog Product Flat Helper object * - * @return \Magento\Catalog\Helper\Product\Flat + * @return \Magento\Catalog\Model\Indexer\Product\Flat\State */ - public function getFlatHelper() + public function getFlatState() { - return $this->_catalogProductFlat; + return $this->_catalogProductFlatState; } /** @@ -430,7 +430,7 @@ public function getFlatHelper() public function isEnabledFlat() { if (!isset($this->_flatEnabled[$this->getStoreId()])) { - $this->_flatEnabled[$this->getStoreId()] = $this->getFlatHelper()->isAvailable(); + $this->_flatEnabled[$this->getStoreId()] = $this->getFlatState()->isAvailable(); } return $this->_flatEnabled[$this->getStoreId()]; } @@ -548,7 +548,7 @@ protected function _initSelect() ->from(array(self::MAIN_TABLE_ALIAS => $this->getEntity()->getFlatTableName()), null) ->columns(array('status' => new \Zend_Db_Expr(ProductStatus::STATUS_ENABLED))); $this->addAttributeToSelect(array('entity_id', 'type_id', 'attribute_set_id')); - if ($this->getFlatHelper()->isAddChildData()) { + if ($this->_catalogProductFlatState->getFlatIndexerHelper()->isAddChildData()) { $this->getSelect() ->where('e.is_child=?', 0); $this->addAttributeToSelect(array('child_id', 'is_child')); @@ -2065,16 +2065,15 @@ public function clear() if ($item->hasStockItem()) { $item->unsStockItem(); } - $item = $this->_items[$i] = null; + $this->_items[$i] = null; } foreach ($this->_itemsById as $i => $item) { - $item = $this->_itemsById[$i] = null; + $this->_itemsById[$i] = null; } unset($this->_items, $this->_data, $this->_itemsById); $this->_data = array(); - $this->_itemsById = array(); return parent::clear(); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php index abb1b7c647841..913d0ac97dead 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -83,7 +83,7 @@ class Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -108,7 +108,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -133,7 +133,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php index 8c7d423f7e866..f5427e9c804bf 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php @@ -39,8 +39,8 @@ class Suffix extends \Magento\Core\Model\Config\Value protected $_coreUrlRewrite = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite @@ -49,8 +49,8 @@ class Suffix extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite, diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 52a5d0e53e2d3..2aa4eef40e586 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -57,6 +57,9 @@ + + + false diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 21c19a51f6d17..e7f59d1044c03 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -152,8 +152,8 @@ - - + + @@ -219,4 +219,22 @@ Magento\Indexer\Model\IndexerInterface + + + + Magento\Catalog\Model\Indexer\Product\Flat\Action\Rows\TableData + + + + + + rowsFlatTableBuilder + + + + + + Magento\Catalog\Model\Indexer\Product\Flat\TableData + + diff --git a/app/code/Magento/Catalog/etc/frontend/di.xml b/app/code/Magento/Catalog/etc/frontend/di.xml index 0e83b79c05233..ed2f5b780f206 100644 --- a/app/code/Magento/Catalog/etc/frontend/di.xml +++ b/app/code/Magento/Catalog/etc/frontend/di.xml @@ -63,4 +63,9 @@ Magento\Catalog\Block\ShortcutButtons::POSITION_AFTER + + + true + + diff --git a/app/code/Magento/Catalog/i18n/de_DE.csv b/app/code/Magento/Catalog/i18n/de_DE.csv index 74d31880fe13f..ef810ff0aa76f 100644 --- a/app/code/Magento/Catalog/i18n/de_DE.csv +++ b/app/code/Magento/Catalog/i18n/de_DE.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","Kann für den Versand in mehrere Pakete unterteilt werden" "Can be used only with catalog input type Dropdown","Kann nur mit Katalogeingabeart Dropdown verwendet werden" "Can be used only with catalog input type Dropdown, Multiple Select and Price","Kann nur mit Katalogeingabeart Dropdown, Mehrfachauswahl und Preis verwendet werden." -"Can\'t create image.","Kann kein Bild erzeugen." +"Can't create image.","Kann kein Bild erzeugen." "Cancel","Abbrechen" "Cannot create image.","Kann kein Bild erzeugen." "Cannot create writeable directory '%s'.","Kann keine schreibbares Verzeichnis erstellen.'%s'." @@ -393,7 +393,7 @@ "Minimum Advertised Price","Beworbener Mindestpreis" "Minimum Lines per Page","Minimale Zeilenanzahl pro Seite" "Minimum Quantity Allowed in Shopping Cart","Minimal im Warenkorb zulässige Menge" -"Minimum Quantity for Item\'s Status to be Out of Stock","Minimale Stückzahl für Nicht auf Lager-Status" +"Minimum Quantity for Item's Status to be Out of Stock","Minimale Stückzahl für Nicht auf Lager-Status" "Missing SKU, skipping the record.","Artikelnummer fehlt, Eintrag übersprungen." "More Views","Mehr Ansichten" "Move","Verschieben" @@ -460,8 +460,8 @@ "Please specify the number of products, that will not be divided into subintervals.","Geben sie bitte die Anzahl an Artikeln an, die nicht in Teilintervalle geteilt werden." "Please specify the product required option(s)","Bitte die obligatorischen Produktoption(en) angeben" "Please specify the product required option(s).","Geben Sie bitte die obligatorischen Produktoption(en) an." -"Please specify the product\'s option(s).","Bitte die Produkt-Optionen angeben." -"Please specify the product\'s required option(s).","Geben Sie bitte die obligatorischen Option(en) für das Produkt an." +"Please specify the product's option(s).","Bitte die Produkt-Optionen angeben." +"Please specify the product's required option(s).","Geben Sie bitte die obligatorischen Option(en) für das Produkt an." "Please specify the quantity of product(s).","Geben Sie bitte die Anzahl an Produkten an." "Please specify time required option(s).","Bitte die benötigten Zeit-Optionen angeben." "Please wait...","Bitte warten..." @@ -526,7 +526,7 @@ "Quantity","Anzahl" "Quantity Increments","Menge Zuwachsrate" "Quantity Uses Decimals","Stückzahl kann dezimal sein" -"Quantity for Item\'s Status to Become Out of Stock","Menge, bei der der Produktstatus zu ""Nicht vorrätig"" wechselt" +"Quantity for Item's Status to Become Out of Stock","Menge, bei der der Produktstatus zu ""Nicht vorrätig"" wechselt" "Quantity:","Anzahl:" "Quantity","Menge" "Quick Create","Schnellanlegen" diff --git a/app/code/Magento/Catalog/i18n/en_US.csv b/app/code/Magento/Catalog/i18n/en_US.csv index 1107cf1fbd1a5..a558c4df83231 100644 --- a/app/code/Magento/Catalog/i18n/en_US.csv +++ b/app/code/Magento/Catalog/i18n/en_US.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","Can be Divided into Multiple Boxes for Shipping" "Can be used only with catalog input type Dropdown","Can be used only with catalog input type Dropdown" "Can be used only with catalog input type Dropdown, Multiple Select and Price","Can be used only with catalog input type Dropdown, Multiple Select and Price" -"Can\'t create image.","Can\'t create image." +"Can't create image.","Can't create image." "Cancel","Cancel" "Cannot create image.","Cannot create image." "Cannot create writeable directory '%s'.","Cannot create writeable directory '%s'." @@ -394,7 +394,7 @@ "Minimum Advertised Price","Minimum Advertised Price" "Minimum Lines per Page","Minimum Lines per Page" "Minimum Quantity Allowed in Shopping Cart","Minimum Quantity Allowed in Shopping Cart" -"Minimum Quantity for Item\'s Status to be Out of Stock","Minimum Quantity for Item\'s Status to be Out of Stock" +"Minimum Quantity for Item's Status to be Out of Stock","Minimum Quantity for Item's Status to be Out of Stock" "Missing SKU, skipping the record.","Missing SKU, skipping the record." "More Views","More Views" "Move","Move" @@ -461,8 +461,8 @@ "Please specify the number of products, that will not be divided into subintervals.","Please specify the number of products, that will not be divided into subintervals." "Please specify the product required option(s)","Please specify the product required option(s)" "Please specify the product required option(s).","Please specify the product required option(s)." -"Please specify the product\'s option(s).","Please specify the product\'s option(s)." -"Please specify the product\'s required option(s).","Please specify the product\'s required option(s)." +"Please specify the product's option(s).","Please specify the product's option(s)." +"Please specify the product's required option(s).","Please specify the product's required option(s)." "Please specify the quantity of product(s).","Please specify the quantity of product(s)." "Please specify time required option(s).","Please specify time required option(s)." "Please wait...","Please wait..." @@ -528,7 +528,7 @@ "Quantity","Quantity" "Quantity Increments","Quantity Increments" "Quantity Uses Decimals","Quantity Uses Decimals" -"Quantity for Item\'s Status to Become Out of Stock","Quantity for Item\'s Status to Become Out of Stock" +"Quantity for Item's Status to Become Out of Stock","Quantity for Item's Status to Become Out of Stock" "Quantity:","Quantity:" "Quantity","Quantity" "Quick Create","Quick Create" diff --git a/app/code/Magento/Catalog/i18n/es_ES.csv b/app/code/Magento/Catalog/i18n/es_ES.csv index fa906909ddfe3..426fe13571247 100644 --- a/app/code/Magento/Catalog/i18n/es_ES.csv +++ b/app/code/Magento/Catalog/i18n/es_ES.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","Puede dividirse en varias cajas para el envío" "Can be used only with catalog input type Dropdown","Sólo puede utilizarse con el tipo de entrada de catálogo Lista desplegable" "Can be used only with catalog input type Dropdown, Multiple Select and Price","Sólo puede utilizarse con los tipos de entrada de catálogo Lista desplegable, Selección múltiple y Precio" -"Can\'t create image.","No se puede crear la imagen." +"Can't create image.","No se puede crear la imagen." "Cancel","Cancelar" "Cannot create image.","No se puede crear la imagen." "Cannot create writeable directory '%s'.","No se puede crear el directorio con permiso de escritura '%s'." @@ -393,7 +393,7 @@ "Minimum Advertised Price","Precio mínimo anunciado" "Minimum Lines per Page","Cant. máxima de líneas por página" "Minimum Quantity Allowed in Shopping Cart","Cantidad mínima permitida en el carro de la compra" -"Minimum Quantity for Item\'s Status to be Out of Stock","Cant. mínima para que el estado del artículo pase a ""Sin inventario""" +"Minimum Quantity for Item's Status to be Out of Stock","Cant. mínima para que el estado del artículo pase a ""Sin inventario""" "Missing SKU, skipping the record.","Falta el código de producto (SKU). Se omitirá el registro." "More Views","Más vistas" "Move","Mover" @@ -460,8 +460,8 @@ "Please specify the number of products, that will not be divided into subintervals.","Por favor, especifica el número de productos, que no será dividido en subintervalos." "Please specify the product required option(s)","Por favor, especifique la(s) opcioón/opciones obligatoria(s) de producto" "Please specify the product required option(s).","Por favor, especifique la(s) opción/opciones obligatoria(s) de producto" -"Please specify the product\'s option(s).","Especifique las opciones del producto." -"Please specify the product\'s required option(s).","Por favor, especifique la(s) opción/opciones obligatoria(s) del producto." +"Please specify the product's option(s).","Especifique las opciones del producto." +"Please specify the product's required option(s).","Por favor, especifique la(s) opción/opciones obligatoria(s) del producto." "Please specify the quantity of product(s).","Por favor, especifique la cantidad de producto(s)." "Please specify time required option(s).","Especifique las opciones obligatorias de la hora." "Please wait...","Por favor, espera..." @@ -526,7 +526,7 @@ "Quantity","Cantidad" "Quantity Increments","Incrementos de cantidad" "Quantity Uses Decimals","La Cantidad Usa Decimales" -"Quantity for Item\'s Status to Become Out of Stock","La cant. para el estado del artículo se va a quedar sin unidades disponibles" +"Quantity for Item's Status to Become Out of Stock","La cant. para el estado del artículo se va a quedar sin unidades disponibles" "Quantity:","Cantidad:" "Quantity","Cantidad" "Quick Create","Creación Rápida" diff --git a/app/code/Magento/Catalog/i18n/fr_FR.csv b/app/code/Magento/Catalog/i18n/fr_FR.csv index 73f60c7d7e88b..88d596b28e6cd 100644 --- a/app/code/Magento/Catalog/i18n/fr_FR.csv +++ b/app/code/Magento/Catalog/i18n/fr_FR.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","Peut être divisé en plusieurs boîtes pour le transport" "Can be used only with catalog input type Dropdown","Ne peut être utilisé qu'avec un type d'entrée catalogue Menu Déroulant" "Can be used only with catalog input type Dropdown, Multiple Select and Price","Ne peut être utilisé qu'avec un type d'entrée catalogue Menu Déroulant, Sélection Multiple et Prix" -"Can\'t create image.","Ne peut pas créer l'image." +"Can't create image.","Ne peut pas créer l'image." "Cancel","Annuler" "Cannot create image.","Ne peut pas créer l'image." "Cannot create writeable directory '%s'.","Ne peut pas créer un répertoire enregistrable '%s'." @@ -393,7 +393,7 @@ "Minimum Advertised Price","Prix minimum annoncés" "Minimum Lines per Page","Lignes minimum par page" "Minimum Quantity Allowed in Shopping Cart","Quantité minimum autorisée dans le panier" -"Minimum Quantity for Item\'s Status to be Out of Stock","Quantité minimum pour que le statut de l'article soit ""Rupture de stock""" +"Minimum Quantity for Item's Status to be Out of Stock","Quantité minimum pour que le statut de l'article soit ""Rupture de stock""" "Missing SKU, skipping the record.","SKU manquant, le dossier est sauté." "More Views","Plus de vues" "Move","Déplacer" @@ -460,8 +460,8 @@ "Please specify the number of products, that will not be divided into subintervals.","Veuillez spécifier le nombre de produits qui ne seront pas divisés en sous-intervalles." "Please specify the product required option(s)","Veuillez spécifier l'option/ les options requise(s) pour le produit" "Please specify the product required option(s).","Veuillez spécifier l'option/les options requise(s) pour le produit." -"Please specify the product\'s option(s).","Veuillez spécifier les options du produit." -"Please specify the product\'s required option(s).","Veuillez spécifier l'option/les options requise(s) du produit." +"Please specify the product's option(s).","Veuillez spécifier les options du produit." +"Please specify the product's required option(s).","Veuillez spécifier l'option/les options requise(s) du produit." "Please specify the quantity of product(s).","Veuillez spécifier la quantité de produit(s)." "Please specify time required option(s).","Veuillez spécifier les options dépendant du temps." "Please wait...","Veuillez patienter..." @@ -526,7 +526,7 @@ "Quantity","Qté" "Quantity Increments","Augmentation de la quantité" "Quantity Uses Decimals","La quantité utilise des décimales" -"Quantity for Item\'s Status to Become Out of Stock","Nombre de statuts de produits bientôt épuisés" +"Quantity for Item's Status to Become Out of Stock","Nombre de statuts de produits bientôt épuisés" "Quantity:","Qté:" "Quantity","Quantité" "Quick Create","Création Rapide" diff --git a/app/code/Magento/Catalog/i18n/nl_NL.csv b/app/code/Magento/Catalog/i18n/nl_NL.csv index 6cb2a1e1f0a6b..8cd20429f813e 100644 --- a/app/code/Magento/Catalog/i18n/nl_NL.csv +++ b/app/code/Magento/Catalog/i18n/nl_NL.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","Kan Worden Verdeeld over Meerdere Dozen bij Verzending" "Can be used only with catalog input type Dropdown","Kan worden gebruikt met catalogusinvoer type Dropdown" "Can be used only with catalog input type Dropdown, Multiple Select and Price","Kan alleen worden gebruikt met catalogusinvoer type Dropdown. Meervoudige selectie en Prijs" -"Can\'t create image.","Kan geen beeld maken" +"Can't create image.","Kan geen beeld maken" "Cancel","Annuleren" "Cannot create image.","Kan beeld niet creëren." "Cannot create writeable directory '%s'.","Kan geen beschrijfbare directory '%s' aanmaken" @@ -393,7 +393,7 @@ "Minimum Advertised Price","Minimum Geadverteerde Prijs" "Minimum Lines per Page","Minimum Regels per Pagina" "Minimum Quantity Allowed in Shopping Cart","Minimum Quantity Toegestaan in Winkelwagen" -"Minimum Quantity for Item\'s Status to be Out of Stock","Minimum aantal waarbij Status van Item op geen voorraad komt" +"Minimum Quantity for Item's Status to be Out of Stock","Minimum aantal waarbij Status van Item op geen voorraad komt" "Missing SKU, skipping the record.","SKU mist, record wordt overgeslagen." "More Views","Meer Views" "Move","Verplaats" @@ -460,8 +460,8 @@ "Please specify the number of products, that will not be divided into subintervals.","Geef het aantal producten op, die niet in sub-intervallen zullen worden verdeeld." "Please specify the product required option(s)","Specificeer alstublieft de benodige optie(s) voor het product." "Please specify the product required option(s).","Specificeer alstublieft de benodige optie(s) voor de datum." -"Please specify the product\'s option(s).","Specificeer de product optie(s)." -"Please specify the product\'s required option(s).","Gelieve het artikel's benodigde optie(s) te specificeren." +"Please specify the product's option(s).","Specificeer de product optie(s)." +"Please specify the product's required option(s).","Gelieve het artikel's benodigde optie(s) te specificeren." "Please specify the quantity of product(s).","Specificeer alstublieft de hoeveelheid product(en)." "Please specify time required option(s).","Specificeer alstublieft de benodigde optie(s) voor de tijd." "Please wait...","Even geduld..." @@ -526,7 +526,7 @@ "Quantity","Hoeveelheid" "Quantity Increments","Hoeveelheid Stappen" "Quantity Uses Decimals","Hoeveelheid Gebruikt Decimalen" -"Quantity for Item\'s Status to Become Out of Stock","Hoeveelheid voor Status van Items die niet Op Voorraad Zijn" +"Quantity for Item's Status to Become Out of Stock","Hoeveelheid voor Status van Items die niet Op Voorraad Zijn" "Quantity:","Hoeveelheid:" "Quantity","Hoeveelheid" "Quick Create","Snel aanmaken" diff --git a/app/code/Magento/Catalog/i18n/pt_BR.csv b/app/code/Magento/Catalog/i18n/pt_BR.csv index 12bf8bcf8a921..aacea18485187 100644 --- a/app/code/Magento/Catalog/i18n/pt_BR.csv +++ b/app/code/Magento/Catalog/i18n/pt_BR.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","Pode ser dividido em várias caixas para envio" "Can be used only with catalog input type Dropdown","Pode ser usado somente com o tipo de catálogo de entrada Dropdown" "Can be used only with catalog input type Dropdown, Multiple Select and Price","Pode ser usado somente com o tipo de catálogo de entrada Dropdown, Seleção Múltipla e Preço" -"Can\'t create image.","Não é possível criar imagem." +"Can't create image.","Não é possível criar imagem." "Cancel","Cancelar" "Cannot create image.","Não é possível criar imagem." "Cannot create writeable directory '%s'.","Não é possível criar diretório gravável ""%s"" ." @@ -393,7 +393,7 @@ "Minimum Advertised Price","Preço Mínimo Anunciado" "Minimum Lines per Page","Número Mínimo de Linhas por Página" "Minimum Quantity Allowed in Shopping Cart","Qtde Mínima Permitida no Carrinho de Compras" -"Minimum Quantity for Item\'s Status to be Out of Stock","Qtde. Mínima de Itens para Estado Atual como Fora do Estoque" +"Minimum Quantity for Item's Status to be Out of Stock","Qtde. Mínima de Itens para Estado Atual como Fora do Estoque" "Missing SKU, skipping the record.","Unid. Manut. Estoque ausente. Saltando o registro." "More Views","Mais Visualizações" "Move","Mover" @@ -460,8 +460,8 @@ "Please specify the number of products, that will not be divided into subintervals.","Por favor especifique o número de produtos, que não será dividido em subintervalos." "Please specify the product required option(s)","Favor especificar opção(ões) obrigatória(s) do produto" "Please specify the product required option(s).","Favor especificar opção(ões) obrigatória(s) do produto." -"Please specify the product\'s option(s).","Por favor especifique a(s) opção/opções do produto." -"Please specify the product\'s required option(s).","Por favor especifique a(s) opção/opções necessária(s) do produto." +"Please specify the product's option(s).","Por favor especifique a(s) opção/opções do produto." +"Please specify the product's required option(s).","Por favor especifique a(s) opção/opções necessária(s) do produto." "Please specify the quantity of product(s).","Favor especificar a quantidade de produto(s)." "Please specify time required option(s).","Favor especificar opção(ões) obrigatória(s) para hora." "Please wait...","Por favor aguarde..." @@ -526,7 +526,7 @@ "Quantity","Quant." "Quantity Increments","Incrementos de Quantidade" "Quantity Uses Decimals","Qtde: Usa Decimais" -"Quantity for Item\'s Status to Become Out of Stock","Quantidade para que o status do item se torne ""Fora de estoque""" +"Quantity for Item's Status to Become Out of Stock","Quantidade para que o status do item se torne ""Fora de estoque""" "Quantity:","Quantidade:" "Quantity","Quantidade" "Quick Create","Criação Rápida" diff --git a/app/code/Magento/Catalog/i18n/zh_CN.csv b/app/code/Magento/Catalog/i18n/zh_CN.csv index 8eba15cdcc82f..8669e613a9c2c 100644 --- a/app/code/Magento/Catalog/i18n/zh_CN.csv +++ b/app/code/Magento/Catalog/i18n/zh_CN.csv @@ -129,7 +129,7 @@ "Can be Divided into Multiple Boxes for Shipping","可拆分为多个箱发货" "Can be used only with catalog input type Dropdown","仅可用于类别输入类型 下拉" "Can be used only with catalog input type Dropdown, Multiple Select and Price","仅可用于类别输入类型 下拉、多选和价格" -"Can\'t create image.","无法创建图片。" +"Can't create image.","无法创建图片。" "Cancel","取消" "Cannot create image.","无法创建图片。" "Cannot create writeable directory '%s'.","无法创建可写的目录 '%s'。" @@ -393,7 +393,7 @@ "Minimum Advertised Price","最低广告价格" "Minimum Lines per Page","每页最低行数" "Minimum Quantity Allowed in Shopping Cart","购物车里允许的最少数量" -"Minimum Quantity for Item\'s Status to be Out of Stock","商品状态的最小数量为缺货" +"Minimum Quantity for Item's Status to be Out of Stock","商品状态的最小数量为缺货" "Missing SKU, skipping the record.","丢失SKU,正在跳过该记录。" "More Views","更多视图" "Move","移动" @@ -460,8 +460,8 @@ "Please specify the number of products, that will not be divided into subintervals.","请注明不会被划分成子区间的产品的数量。" "Please specify the product required option(s)","请指定产品需要的选项" "Please specify the product required option(s).","请指定产品需要的选项。" -"Please specify the product\'s option(s).","请指定产品的选项。" -"Please specify the product\'s required option(s).","请指定产品的必要选项。" +"Please specify the product's option(s).","请指定产品的选项。" +"Please specify the product's required option(s).","请指定产品的必要选项。" "Please specify the quantity of product(s).","请指定产品数量。" "Please specify time required option(s).","请指定时间需要的选项。" "Please wait...","请稍候..." @@ -526,7 +526,7 @@ "Quantity","数量" "Quantity Increments","数量增量" "Quantity Uses Decimals","数量使用小数" -"Quantity for Item\'s Status to Become Out of Stock","项目的状态变为无货时的数量" +"Quantity for Item's Status to Become Out of Stock","项目的状态变为无货时的数量" "Quantity:","数量:" "Quantity","数量" "Quick Create","快速创建" diff --git a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php index febed058ee073..ca53988242a5e 100644 --- a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php @@ -46,18 +46,18 @@ class Qtyincrements extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php index 1f2905f6592bb..bf8d1225087c7 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php @@ -41,18 +41,18 @@ abstract class AbstractStockqty extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php index a20391225a94d..26d6b22d3f4b7 100644 --- a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php +++ b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php @@ -43,8 +43,8 @@ class Managestock protected $_stockStatus; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus @@ -53,8 +53,8 @@ class Managestock * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\CatalogInventory\Model\Stock\Status $stockStatus, diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php index cfeb7dcdcec58..74652796e342d 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php @@ -98,8 +98,8 @@ class Stock extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_indexer; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -107,8 +107,8 @@ class Stock extends \Magento\Index\Model\Indexer\AbstractIndexer * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Index\Model\Indexer $indexer, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/CatalogInventory/Model/Source/Backorders.php b/app/code/Magento/CatalogInventory/Model/Source/Backorders.php index 3e5bc33cc5f25..94d32b4f18b87 100644 --- a/app/code/Magento/CatalogInventory/Model/Source/Backorders.php +++ b/app/code/Magento/CatalogInventory/Model/Source/Backorders.php @@ -26,7 +26,7 @@ namespace Magento\CatalogInventory\Model\Source; -class Backorders implements \Magento\Core\Model\Option\ArrayInterface +class Backorders implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/CatalogInventory/Model/Source/Stock.php b/app/code/Magento/CatalogInventory/Model/Source/Stock.php index 5514e9f0b5073..872c0ce4ffff6 100644 --- a/app/code/Magento/CatalogInventory/Model/Source/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Source/Stock.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogInventory\Model\Source; -class Stock implements \Magento\Core\Model\Option\ArrayInterface +class Stock implements \Magento\Option\ArrayInterface { /** * Retrieve option array diff --git a/app/code/Magento/CatalogInventory/Model/Stock.php b/app/code/Magento/CatalogInventory/Model/Stock.php index 3145cc0a97568..c68655c78eece 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Stock.php @@ -74,8 +74,8 @@ class Stock extends \Magento\Core\Model\AbstractModel protected $_collectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\CatalogInventory\Model\Resource\Stock\Item\CollectionFactory $collectionFactory * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -85,8 +85,8 @@ class Stock extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\CatalogInventory\Model\Resource\Stock\Item\CollectionFactory $collectionFactory, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Stock/Item.php index e2afd9b0e534f..feaccc4285bb6 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Item.php @@ -192,8 +192,8 @@ class Item extends \Magento\Core\Model\AbstractModel protected $mathDivision; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Index\Model\Indexer $indexer * @param Status $stockStatus @@ -208,8 +208,8 @@ class Item extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Index\Model\Indexer $indexer, Status $stockStatus, diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Stock/Status.php index dbfe2d2b2607f..5cb0cad131526 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Status.php @@ -94,8 +94,8 @@ class Status extends \Magento\Core\Model\AbstractModel protected $_stockItemFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param Type $productType * @param \Magento\Catalog\Model\Product\Website $productWebsite * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -106,8 +106,8 @@ class Status extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, Type $productType, \Magento\Catalog\Model\Product\Website $productWebsite, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index cf01c32b07cf0..0980e26b536c7 100644 --- a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -40,8 +40,8 @@ class Minsaleqty extends \Magento\Core\Model\Config\Value protected $_catalogInventoryMinsaleqty = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty @@ -50,8 +50,8 @@ class Minsaleqty extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php index 756f5f4a96966..a90816ca1eec2 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php @@ -35,18 +35,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php index aee7d8179c86e..ccc526c66a315 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php @@ -44,7 +44,7 @@ class Conditions extends Generic implements TabInterface /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Rule\Block\Conditions $conditions * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset @@ -52,7 +52,7 @@ class Conditions extends Generic implements TabInterface */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Rule\Block\Conditions $conditions, \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php index f618fbc299cd4..631c5ce80bf5e 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php @@ -51,7 +51,7 @@ class Main extends Generic implements TabInterface /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup * @param \Magento\Core\Model\System\Store $systemStore @@ -59,7 +59,7 @@ class Main extends Generic implements TabInterface */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup, \Magento\Core\Model\System\Store $systemStore, diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php index 37d081627a28d..baacc29d1579e 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php @@ -38,7 +38,7 @@ use Magento\CatalogRule\Model\Rule\Job; use Magento\Core\Exception; use Magento\Core\Filter\Date; -use Magento\Core\Model\Registry; +use Magento\Registry; use Magento\Rule\Model\Condition\AbstractCondition; use Magento\Rule\Model\Action\AbstractAction; diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php index 3c92ec799cc3f..71e478af412fe 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php @@ -29,7 +29,7 @@ use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Catalog\Model\Category; -use Magento\Core\Model\Registry; +use Magento\Registry; class Widget extends Action { diff --git a/app/code/Magento/CatalogRule/Model/Observer.php b/app/code/Magento/CatalogRule/Model/Observer.php index ffce60cff9003..c89adb6b80089 100644 --- a/app/code/Magento/CatalogRule/Model/Observer.php +++ b/app/code/Magento/CatalogRule/Model/Observer.php @@ -36,7 +36,7 @@ use Magento\CatalogRule\Model\Rule; use Magento\CatalogRule\Model\Resource\Rule\Collection; use Magento\CatalogRule\Model\Rule\Product\Price; -use Magento\Core\Model\Registry; +use Magento\Registry; use Magento\Core\Model\StoreManagerInterface; use Magento\Core\Model\LocaleInterface; use Magento\Customer\Model\Group; diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index a4e99c5474c6a..95f6e6ae46b38 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -168,8 +168,8 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory @@ -189,8 +189,8 @@ class Rule extends \Magento\Rule\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, diff --git a/app/code/Magento/CatalogSearch/Block/Layer.php b/app/code/Magento/CatalogSearch/Block/Layer.php index 02ade565f8132..4d06359b0b340 100644 --- a/app/code/Magento/CatalogSearch/Block/Layer.php +++ b/app/code/Magento/CatalogSearch/Block/Layer.php @@ -34,7 +34,7 @@ use Magento\CatalogSearch\Helper\Data; use Magento\CatalogSearch\Model\Layer as ModelLayer; use Magento\CatalogSearch\Model\Resource\EngineProvider; -use Magento\Core\Model\Registry; +use Magento\Registry; use Magento\View\Element\Template\Context; class Layer extends View @@ -52,7 +52,7 @@ class Layer extends View * @var Registry */ protected $_coreRegistry = null; - + /** * Catalog search data * diff --git a/app/code/Magento/CatalogSearch/Model/Advanced.php b/app/code/Magento/CatalogSearch/Model/Advanced.php index 18cdbaafeef59..0f67a59470919 100644 --- a/app/code/Magento/CatalogSearch/Model/Advanced.php +++ b/app/code/Magento/CatalogSearch/Model/Advanced.php @@ -64,8 +64,8 @@ use Magento\CatalogSearch\Model\Resource\EngineProvider; use Magento\Core\Exception; use Magento\Core\Model\AbstractModel; -use Magento\Core\Model\Context; -use Magento\Core\Model\Registry; +use Magento\Model\Context; +use Magento\Registry; use Magento\Core\Model\StoreManagerInterface; use Magento\Directory\Model\Currency; use Magento\Directory\Model\CurrencyFactory; diff --git a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php index 93c1087eb46c6..14a586257096b 100644 --- a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php +++ b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php @@ -37,8 +37,8 @@ use Magento\App\ConfigInterface; use Magento\CatalogSearch\Model\Fulltext; use Magento\Core\Model\Config\Value; -use Magento\Core\Model\Context; -use Magento\Core\Model\Registry; +use Magento\Model\Context; +use Magento\Registry; use Magento\Core\Model\Resource\AbstractResource; use Magento\Core\Model\StoreManagerInterface; use Magento\Data\Collection\Db; diff --git a/app/code/Magento/CatalogSearch/Model/Config/Source/Search/Type.php b/app/code/Magento/CatalogSearch/Model/Config/Source/Search/Type.php index dcabbca5b77b9..fe5d4da9922d3 100644 --- a/app/code/Magento/CatalogSearch/Model/Config/Source/Search/Type.php +++ b/app/code/Magento/CatalogSearch/Model/Config/Source/Search/Type.php @@ -1,5 +1,7 @@ - */ namespace Magento\CatalogSearch\Model\Config\Source\Search; -use Magento\CatalogSearch\Model\Fulltext; -use Magento\Core\Model\Option\ArrayInterface; - -class Type implements ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * @return array @@ -45,9 +33,9 @@ class Type implements ArrayInterface public function toOptionArray() { $types = array( - Fulltext::SEARCH_TYPE_LIKE => 'Like', - Fulltext::SEARCH_TYPE_FULLTEXT => 'Fulltext', - Fulltext::SEARCH_TYPE_COMBINE => 'Combine (Like and Fulltext)', + \Magento\CatalogSearch\Model\Fulltext::SEARCH_TYPE_LIKE => 'Like', + \Magento\CatalogSearch\Model\Fulltext::SEARCH_TYPE_FULLTEXT => 'Fulltext', + \Magento\CatalogSearch\Model\Fulltext::SEARCH_TYPE_COMBINE => 'Combine (Like and Fulltext)', ); $options = array(); foreach ($types as $k => $v) { diff --git a/app/code/Magento/CatalogSearch/Model/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Fulltext.php index 53d64ead39179..93b49af32e7b4 100644 --- a/app/code/Magento/CatalogSearch/Model/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Fulltext.php @@ -45,8 +45,8 @@ use Magento\CatalogSearch\Helper\Data; use Magento\CatalogSearch\Model\Query; use Magento\Core\Model\AbstractModel; -use Magento\Core\Model\Context; -use Magento\Core\Model\Registry; +use Magento\Model\Context; +use Magento\Registry; use Magento\Core\Model\Resource\AbstractResource; use Magento\Core\Model\Store\Config; use Magento\Data\Collection\Db; diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php index fc241dcc3f4fa..3a3184a3590b9 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php @@ -38,8 +38,8 @@ use Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory; use Magento\CatalogSearch\Model\Fulltext as ModelFulltext; use Magento\CatalogSearch\Model\Resource\Indexer\Fulltext as IndexerFulltext; -use Magento\Core\Model\Context; -use Magento\Core\Model\Registry; +use Magento\Model\Context; +use Magento\Registry; use Magento\Core\Model\Resource\AbstractResource; use Magento\Core\Model\Store; use Magento\Core\Model\Store\Group; diff --git a/app/code/Magento/CatalogSearch/Model/Layer.php b/app/code/Magento/CatalogSearch/Model/Layer.php index d4df6833c1ae0..d246fa58ad2c9 100644 --- a/app/code/Magento/CatalogSearch/Model/Layer.php +++ b/app/code/Magento/CatalogSearch/Model/Layer.php @@ -38,7 +38,7 @@ use Magento\CatalogSearch\Helper\Data; use Magento\CatalogSearch\Model\Query; use Magento\CatalogSearch\Model\Resource\Fulltext\CollectionFactory; -use Magento\Core\Model\Registry; +use Magento\Registry; use Magento\Core\Model\StoreManagerInterface; use Magento\Customer\Model\Session; use Magento\Eav\Model\Entity\Attribute; diff --git a/app/code/Magento/CatalogSearch/Model/Query.php b/app/code/Magento/CatalogSearch/Model/Query.php index 6a01bcdae0f2f..737423b68e872 100644 --- a/app/code/Magento/CatalogSearch/Model/Query.php +++ b/app/code/Magento/CatalogSearch/Model/Query.php @@ -59,8 +59,8 @@ use Magento\CatalogSearch\Model\Resource\Search\Collection; use Magento\CatalogSearch\Model\Resource\Search\CollectionFactory; use Magento\Core\Model\AbstractModel; -use Magento\Core\Model\Context; -use Magento\Core\Model\Registry; +use Magento\Model\Context; +use Magento\Registry; use Magento\Core\Model\Resource\AbstractResource; use Magento\Core\Model\Store\Config; use Magento\Core\Model\StoreManagerInterface; diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php index 0d3ed7fd4e3fd..12c903eb1a00d 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -55,7 +55,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -79,7 +79,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -102,7 +102,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php index 42d43f09add31..ec2f3af864d08 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -60,7 +60,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -85,7 +85,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -110,7 +110,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php index 9ec480f17715c..84f430c25d6a7 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php @@ -67,7 +67,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -91,7 +91,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -114,7 +114,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Centinel/Block/Authentication/Complete.php b/app/code/Magento/Centinel/Block/Authentication/Complete.php index 14695b3180142..5e868a9a1af20 100644 --- a/app/code/Magento/Centinel/Block/Authentication/Complete.php +++ b/app/code/Magento/Centinel/Block/Authentication/Complete.php @@ -35,18 +35,18 @@ class Complete extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Centinel/Block/Authentication/Start.php b/app/code/Magento/Centinel/Block/Authentication/Start.php index 042e8aa842cde..752f70739ad30 100644 --- a/app/code/Magento/Centinel/Block/Authentication/Start.php +++ b/app/code/Magento/Centinel/Block/Authentication/Start.php @@ -35,18 +35,18 @@ class Start extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php index 296bd60ceaaa1..6b3227be80362 100644 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php +++ b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php @@ -38,17 +38,17 @@ class Index extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Centinel/Controller/Index.php b/app/code/Magento/Centinel/Controller/Index.php index 60268cdc726b5..7e923d607f46a 100644 --- a/app/code/Magento/Centinel/Controller/Index.php +++ b/app/code/Magento/Centinel/Controller/Index.php @@ -35,17 +35,17 @@ class Index extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Centinel/Model/Api.php b/app/code/Magento/Centinel/Model/Api.php index 1f0a535f6883c..b5e8d23fad228 100644 --- a/app/code/Magento/Centinel/Model/Api.php +++ b/app/code/Magento/Centinel/Model/Api.php @@ -87,15 +87,15 @@ class Api extends \Magento\Object /** * Log adapter factory * - * @var \Magento\Core\Model\Log\AdapterFactory + * @var \Magento\Logger\AdapterFactory */ protected $_logFactory; /** - * @param \Magento\Core\Model\Log\AdapterFactory $logFactory + * @param \Magento\Logger\AdapterFactory $logFactory * @param array $data */ - public function __construct(\Magento\Core\Model\Log\AdapterFactory $logFactory, array $data = array()) + public function __construct(\Magento\Logger\AdapterFactory $logFactory, array $data = array()) { $this->_logFactory = $logFactory; parent::__construct($data); diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement.php index 2ddcb120c801c..64d2d37c45639 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Adminhtml; /** * Admin tax rule content block @@ -31,11 +32,11 @@ * @package Magento_Checkout * @author Magento Core Team */ - -namespace Magento\Checkout\Block\Adminhtml; - class Agreement extends \Magento\Backend\Block\Widget\Grid\Container { + /** + * @return void + */ protected function _construct() { $this->_controller = 'adminhtml_agreement'; diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php index c325bb832f77c..bdd9addcbf611 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block\Adminhtml\Agreement; class Edit extends \Magento\Backend\Block\Widget\Form\Container @@ -31,18 +30,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; @@ -52,6 +51,7 @@ public function __construct( /** * Init class * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php index bdd0e50bed921..985ddf043017e 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block\Adminhtml\Agreement\Edit; class Form extends \Magento\Backend\Block\Widget\Form\Generic @@ -35,14 +34,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $systemStore, array $data = array() @@ -54,6 +53,7 @@ public function __construct( /** * Init class * + * @return void */ protected function _construct() { @@ -64,8 +64,7 @@ protected function _construct() } /** - * - * return \Magento\Backend\Block\Widget\Form + * @return $this */ protected function _prepareForm() { diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php index 3103a36713fa4..8f61916524725 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php @@ -48,6 +48,9 @@ public function __construct( parent::__construct($context, $backendHelper, $data); } + /** + * @return void + */ protected function _construct() { parent::_construct(); @@ -57,12 +60,18 @@ protected function _construct() $this->setSaveParametersInSession(true); } + /** + * @return $this + */ protected function _prepareCollection() { $this->setCollection($this->_collectionFactory->create()); return parent::_prepareCollection(); } + /** + * @return $this + */ protected function _prepareColumns() { $this->addColumn('agreement_id', @@ -113,12 +122,20 @@ protected function _prepareColumns() return parent::_prepareColumns(); } + /** + * @return void + */ protected function _afterLoadCollection() { $this->getCollection()->walk('afterLoad'); parent::_afterLoadCollection(); } + /** + * @param \Magento\Data\Collection $collection + * @param \Magento\Backend\Block\Widget\Grid\Column $column + * @return void + */ protected function _filterStoreCondition($collection, $column) { if (!$value = $column->getFilter()->getValue()) { @@ -128,6 +145,10 @@ protected function _filterStoreCondition($collection, $column) $this->getCollection()->addStoreFilter($value); } + /** + * @param \Magento\Object $row + * @return string + */ public function getRowUrl($row) { return $this->getUrl('checkout/*/edit', array('id' => $row->getId())); diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 658a01cb0ee2c..8592712fbca21 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block; /** * Shopping cart block @@ -31,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block; - class Cart extends \Magento\Checkout\Block\Cart\AbstractCart { /** @@ -72,6 +71,7 @@ public function __construct( /** * Prepare Quote Item Product URLs * + * @return void */ protected function _construct() { @@ -81,6 +81,8 @@ protected function _construct() /** * prepare cart items URLs + * + * @return void */ public function prepareItemUrls() { @@ -157,7 +159,7 @@ public function getCheckoutUrl() } /** - * @return mixed + * @return string */ public function getContinueShoppingUrl() { diff --git a/app/code/Magento/Checkout/Block/Cart/AbstractCart.php b/app/code/Magento/Checkout/Block/Cart/AbstractCart.php index 4ab8b85cf33f3..c7d2896a013d8 100644 --- a/app/code/Magento/Checkout/Block/Cart/AbstractCart.php +++ b/app/code/Magento/Checkout/Block/Cart/AbstractCart.php @@ -23,6 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Cart; + +use Magento\Customer\Model\Customer; +use Magento\Sales\Model\Quote; /** * Shopping cart abstract block @@ -31,8 +35,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Cart; - class AbstractCart extends \Magento\View\Element\Template { /** @@ -40,9 +42,24 @@ class AbstractCart extends \Magento\View\Element\Template */ const DEFAULT_TYPE = 'default'; + /** + * @var Customer|null + */ protected $_customer = null; + + /** + * @var Quote|null + */ protected $_quote = null; + + /** + * @var array + */ protected $_totals; + + /** + * @var array + */ protected $_itemRenders = array(); /** @@ -99,7 +116,6 @@ protected function _getRendererList() * Retrieve item renderer block * * @param string $type - * * @return \Magento\View\Element\Template * @throws \RuntimeException */ @@ -117,7 +133,7 @@ public function getItemRenderer($type) /** * Get logged in customer * - * @return \Magento\Customer\Model\Customer + * @return Customer */ public function getCustomer() { @@ -130,7 +146,7 @@ public function getCustomer() /** * Get active quote * - * @return \Magento\Sales\Model\Quote + * @return Quote */ public function getQuote() { @@ -162,11 +178,17 @@ public function getItemHtml(\Magento\Sales\Model\Quote\Item $item) return $renderer->toHtml(); } + /** + * @return array + */ public function getTotals() { return $this->getTotalsCache(); } + /** + * @return array + */ public function getTotalsCache() { if (empty($this->_totals)) { diff --git a/app/code/Magento/Checkout/Block/Cart/Coupon.php b/app/code/Magento/Checkout/Block/Cart/Coupon.php index 49186d3a5bddb..bbe11d4d9bd77 100644 --- a/app/code/Magento/Checkout/Block/Cart/Coupon.php +++ b/app/code/Magento/Checkout/Block/Cart/Coupon.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block\Cart; class Coupon extends \Magento\Checkout\Block\Cart\AbstractCart @@ -46,6 +45,9 @@ public function __construct( $this->_isScopePrivate = true; } + /** + * @return string + */ public function getCouponCode() { return $this->getQuote()->getCouponCode(); diff --git a/app/code/Magento/Checkout/Block/Cart/Crosssell.php b/app/code/Magento/Checkout/Block/Cart/Crosssell.php index 9690e80677b47..049a818fe1dd2 100644 --- a/app/code/Magento/Checkout/Block/Cart/Crosssell.php +++ b/app/code/Magento/Checkout/Block/Cart/Crosssell.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Cart; /** * Cart crosssell list @@ -31,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Cart; - class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct { /** @@ -70,7 +69,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -92,7 +91,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Configure.php b/app/code/Magento/Checkout/Block/Cart/Item/Configure.php index 818b308731665..c1718f3537ef8 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Configure.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Configure.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Block\Cart\Item; /** * Cart Item Configure block @@ -33,15 +33,13 @@ * @package Magento_Checkout * @module Checkout */ -namespace Magento\Checkout\Block\Cart\Item; - class Configure extends \Magento\View\Element\Template { /** * Configure product view blocks * - * @return \Magento\Checkout\Block\Cart\Item\Configure + * @return $this */ protected function _prepareLayout() { diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php index 4b290598b166d..06d93bdd350ea 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Cart\Item; + +use Magento\Sales\Model\Quote\Item; /** * Shopping cart item render block @@ -34,13 +37,22 @@ * @method \Magento\Checkout\Block\Cart\Item\Renderer setProductName(string) * @method \Magento\Checkout\Block\Cart\Item\Renderer setDeleteUrl(string) */ -namespace Magento\Checkout\Block\Cart\Item; class Renderer extends \Magento\View\Element\Template { - /** @var \Magento\Checkout\Model\Session */ + /** + * @var \Magento\Checkout\Model\Session + */ protected $_checkoutSession; + + /** + * @var Item + */ protected $_item; + + /** + * @var string + */ protected $_productUrl; /** @@ -121,7 +133,7 @@ public function setItem(\Magento\Sales\Model\Quote\Item\AbstractItem $item) /** * Get quote item * - * @return \Magento\Sales\Model\Quote\Item + * @return Item */ public function getItem() { @@ -200,6 +212,10 @@ public function getThumbnailSidebarSize() return $this->getVar('product_thumbnail_image_sidebar_size', 'Magento_Catalog'); } + /** + * @param string $productUrl + * @return $this + */ public function overrideProductUrl($productUrl) { $this->_productUrl = $productUrl; @@ -280,7 +296,7 @@ public function getProductName() /** * Get product customize options * - * @return array || false + * @return array */ public function getProductOptions() { @@ -336,7 +352,7 @@ public function getDeleteUrl() /** * Get quote item qty * - * @return float|int|string + * @return float|int */ public function getQty() { @@ -401,7 +417,7 @@ public function getMessages() /** * Accept option value and return its formatted view * - * @param mixed $optionValue + * @param string|array $optionValue * Method works well with these $optionValue format: * 1. String * 2. Indexed array e.g. array(val1, val2, ...) @@ -452,7 +468,7 @@ public function getProductAdditionalInformationBlock() /** * Get html for MAP product enabled * - * @param \Magento\Sales\Model\Quote\Item $item + * @param Item $item * @return string */ public function getMsrpHtml($item) @@ -467,7 +483,7 @@ public function getMsrpHtml($item) * Set qty mode to be strict or not * * @param bool $strict - * @return \Magento\Checkout\Block\Cart\Item\Renderer + * @return $this */ public function setQtyMode($strict) { @@ -479,7 +495,7 @@ public function setQtyMode($strict) * Set ignore product URL rendering * * @param bool $ignore - * @return \Magento\Checkout\Block\Cart\Item\Renderer + * @return $this */ public function setIgnoreProductUrl($ignore = true) { diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php index a2c4a1fc537d8..09be85ec99940 100644 --- a/app/code/Magento/Checkout/Block/Cart/Link.php +++ b/app/code/Magento/Checkout/Block/Cart/Link.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Cart; /** * "My Cart" link */ -namespace Magento\Checkout\Block\Cart; - class Link extends \Magento\View\Element\Html\Link { /** diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index 7d773b392cc2e..a9a10aa2f6598 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block\Cart; class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart @@ -93,7 +92,7 @@ public function __construct( * Get config * * @param string $path - * @return mixed + * @return string|null */ public function getConfig($path) { @@ -139,7 +138,7 @@ public function getAddress() * Get Carrier Name * * @param string $carrierCode - * @return mixed + * @return string */ public function getCarrierName($carrierCode) { diff --git a/app/code/Magento/Checkout/Block/Cart/Sidebar.php b/app/code/Magento/Checkout/Block/Cart/Sidebar.php index 6fb944ca95dbf..eca95e13f0634 100644 --- a/app/code/Magento/Checkout/Block/Cart/Sidebar.php +++ b/app/code/Magento/Checkout/Block/Cart/Sidebar.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Block\Cart; /** * Wishlist sidebar block @@ -32,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Cart; - class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart { const XML_PATH_CHECKOUT_SIDEBAR_COUNT = 'checkout/sidebar/count'; @@ -126,6 +124,7 @@ public function getItemCount() /** * Get array of last added items * + * @param int|null $count * @return array */ public function getRecentItems($count = null) @@ -169,7 +168,7 @@ public function getRecentItems($count = null) * It will include tax, if required by config settings. * * @param bool $skipTax flag for getting price with tax or not. Ignored in case when we display just subtotal incl.tax - * @return decimal + * @return float */ public function getSubtotal($skipTax = true) { @@ -198,7 +197,7 @@ public function getSubtotal($skipTax = true) * Get subtotal, including tax. * Will return > 0 only if appropriate config settings are enabled. * - * @return decimal + * @return float */ public function getSubtotalInclTax() { @@ -241,7 +240,7 @@ protected function _getShippingTaxAmount() /** * Get shopping cart items qty based on configuration (summary qty or items qty) * - * @return int | float + * @return int|float */ public function getSummaryCount() { @@ -307,7 +306,7 @@ public function getItems() return parent::getItems(); } - /* + /** * Return totals from custom quote if needed * * @return array @@ -354,7 +353,7 @@ protected function _serializeRenders() } /** - * Deserialize renders from string + * De-serialize renders from string * * @param string $renders * @return $this diff --git a/app/code/Magento/Checkout/Block/Cart/Totals.php b/app/code/Magento/Checkout/Block/Cart/Totals.php index b0d1098508a84..3bd99c3e6a703 100644 --- a/app/code/Magento/Checkout/Block/Cart/Totals.php +++ b/app/code/Magento/Checkout/Block/Cart/Totals.php @@ -23,13 +23,25 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block\Cart; +use Magento\View\Element\BlockInterface; + class Totals extends \Magento\Checkout\Block\Cart\AbstractCart { + /** + * @var array + */ protected $_totalRenderers; + + /** + * @var string + */ protected $_defaultRenderer = 'Magento\Checkout\Block\Total\DefaultTotal'; + + /** + * @var array + */ protected $_totals = null; /** @@ -59,6 +71,9 @@ public function __construct( } + /** + * @return array + */ public function getTotals() { if (is_null($this->_totals)) { @@ -67,12 +82,20 @@ public function getTotals() return $this->_totals; } + /** + * @param array $value + * @return $this + */ public function setTotals($value) { $this->_totals = $value; return $this; } + /** + * @param string $code + * @return BlockInterface + */ protected function _getTotalRenderer($code) { $blockName = $code . '_total_renderer'; @@ -94,6 +117,12 @@ protected function _getTotalRenderer($code) return $block; } + /** + * @param mixed $total + * @param int|null $area + * @param int $colspan + * @return string + */ public function renderTotal($total, $area = null, $colspan = 1) { $code = $total->getCode(); diff --git a/app/code/Magento/Checkout/Block/Link.php b/app/code/Magento/Checkout/Block/Link.php index 65df91ad80115..817ed06dd7e95 100644 --- a/app/code/Magento/Checkout/Block/Link.php +++ b/app/code/Magento/Checkout/Block/Link.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block; /** * "Checkout" link */ -namespace Magento\Checkout\Block; - class Link extends \Magento\View\Element\Html\Link { /** diff --git a/app/code/Magento/Checkout/Block/Onepage.php b/app/code/Magento/Checkout/Block/Onepage.php index b986495dff1ac..4cfb8c68d8704 100644 --- a/app/code/Magento/Checkout/Block/Onepage.php +++ b/app/code/Magento/Checkout/Block/Onepage.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block; /** * Onepage checkout block @@ -31,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block; - class Onepage extends \Magento\Checkout\Block\Onepage\AbstractOnepage { /** diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index 9958455c25c3c..3007d30bd1893 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -23,14 +23,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; + +use Magento\Customer\Model\Customer; +use Magento\Directory\Model\Resource\Country\Collection; +use Magento\Directory\Model\Resource\Region\Collection as RegionCollection; +use Magento\Sales\Model\Quote; /** * One page common functionality block * * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - abstract class AbstractOnepage extends \Magento\View\Element\Template { /** @@ -38,10 +42,29 @@ abstract class AbstractOnepage extends \Magento\View\Element\Template */ protected $_configCacheType; + /** + * @var Customer + */ protected $_customer; + + /** + * @var Quote + */ protected $_quote; + + /** + * @var Collection + */ protected $_countryCollection; + + /** + * @var RegionCollection + */ protected $_regionCollection; + + /** + * @var mixed + */ protected $_addressesCollection; /** @@ -98,7 +121,7 @@ public function __construct( * Get config * * @param string $path - * @return mixed + * @return string|null */ public function getConfig($path) { @@ -108,7 +131,7 @@ public function getConfig($path) /** * Get logged in customer * - * @return \Magento\Customer\Model\Customer + * @return Customer */ public function getCustomer() { @@ -131,7 +154,7 @@ public function getCheckout() /** * Retrieve sales quote model * - * @return \Magento\Sales\Model\Quote + * @return Quote */ public function getQuote() { @@ -141,11 +164,17 @@ public function getQuote() return $this->_quote; } + /** + * @return bool + */ public function isCustomerLoggedIn() { return $this->_customerSession->isLoggedIn(); } + /** + * @return Collection + */ public function getCountryCollection() { if (!$this->_countryCollection) { @@ -154,6 +183,9 @@ public function getCountryCollection() return $this->_countryCollection; } + /** + * @return RegionCollection + */ public function getRegionCollection() { if (!$this->_regionCollection) { @@ -164,11 +196,18 @@ public function getRegionCollection() return $this->_regionCollection; } + /** + * @return int + */ public function customerHasAddresses() { return count($this->getCustomer()->getAddresses()); } + /** + * @param string $type + * @return string + */ public function getAddressesHtmlSelect($type) { if ($this->isCustomerLoggedIn()) { @@ -208,6 +247,10 @@ public function getAddressesHtmlSelect($type) return ''; } + /** + * @param string $type + * @return string + */ public function getCountryHtmlSelect($type) { $countryId = $this->getAddress()->getCountryId(); @@ -225,6 +268,10 @@ public function getCountryHtmlSelect($type) } + /** + * @param string $type + * @return string + */ public function getRegionHtmlSelect($type) { $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') @@ -238,6 +285,9 @@ public function getRegionHtmlSelect($type) return $select->getHtml(); } + /** + * @return mixed + */ public function getCountryOptions() { $options = false; @@ -256,7 +306,7 @@ public function getCountryOptions() /** * Get checkout steps codes * - * @return array + * @return string[] */ protected function _getStepCodes() { diff --git a/app/code/Magento/Checkout/Block/Onepage/Billing.php b/app/code/Magento/Checkout/Block/Onepage/Billing.php index b0f0f9914da5e..3ddc970b74b71 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Billing.php +++ b/app/code/Magento/Checkout/Block/Onepage/Billing.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; /** * One page checkout status @@ -32,8 +33,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage { /** @@ -93,6 +92,8 @@ public function __construct( /** * Initialize billing address step + * + * @return void */ protected function _construct() { @@ -107,6 +108,9 @@ protected function _construct() parent::_construct(); } + /** + * @return bool + */ public function isUseBillingAddressForShipping() { if (($this->getQuote()->getIsVirtual()) @@ -193,13 +197,16 @@ public function getLastname() /** * Check is Quote items can ship to * - * @return boolean + * @return bool */ public function canShip() { return !$this->getQuote()->isVirtual(); } + /** + * @return void + */ public function getSaveUrl() { } @@ -228,6 +235,9 @@ public function isTaxvatEnabled() return $this->_getTaxvat()->isEnabled(); } + /** + * @return string + */ public function getTaxvatHtml() { return $this->_getTaxvat() diff --git a/app/code/Magento/Checkout/Block/Onepage/Failure.php b/app/code/Magento/Checkout/Block/Onepage/Failure.php index 7569ebe8e50b5..d7fadb13e5478 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Failure.php +++ b/app/code/Magento/Checkout/Block/Onepage/Failure.php @@ -23,8 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - - namespace Magento\Checkout\Block\Onepage; class Failure extends \Magento\View\Element\Template @@ -49,6 +47,9 @@ public function __construct( $this->_isScopePrivate = true; } + /** + * @return mixed + */ public function getRealOrderId() { return $this->_checkoutSession->getLastRealOrderId(); @@ -57,7 +58,7 @@ public function getRealOrderId() /** * Payment custom error message * - * @return string + * @return string */ public function getErrorMessage () { @@ -68,7 +69,7 @@ public function getErrorMessage () /** * Continue shopping URL * - * @return string + * @return string */ public function getContinueShoppingUrl() { diff --git a/app/code/Magento/Checkout/Block/Onepage/Link.php b/app/code/Magento/Checkout/Block/Onepage/Link.php index 6481984b0ebe8..7912977eb8e24 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Link.php +++ b/app/code/Magento/Checkout/Block/Onepage/Link.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; /** * One page checkout cart link @@ -31,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - class Link extends \Magento\View\Element\Template { /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Login.php b/app/code/Magento/Checkout/Block/Onepage/Login.php index 59006e91e9bcb..ae9139947a900 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Login.php +++ b/app/code/Magento/Checkout/Block/Onepage/Login.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; + +use Magento\Message\Collection; /** * One page checkout status @@ -32,8 +35,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - class Login extends \Magento\Checkout\Block\Onepage\AbstractOnepage { /** @@ -88,6 +89,9 @@ public function __construct( $this->_isScopePrivate = true; } + /** + * @return void + */ protected function _construct() { if (!$this->isCustomerLoggedIn()) { @@ -96,31 +100,49 @@ protected function _construct() parent::_construct(); } + /** + * @return Collection + */ public function getMessages() { return $this->messageManager->getMessages(true); } + /** + * @return string + */ public function getPostAction() { return $this->getUrl('customer/account/loginPost', array('_secure'=>true)); } + /** + * @return string + */ public function getMethod() { return $this->getQuote()->getMethod(); } + /** + * @return mixed + */ public function getMethodData() { return $this->getCheckout()->getMethodData(); } + /** + * @return string + */ public function getSuccessUrl() { return $this->getUrl('*/*'); } + /** + * @return string + */ public function getErrorUrl() { return $this->getUrl('*/*'); diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment.php b/app/code/Magento/Checkout/Block/Onepage/Payment.php index f9f9776a6ad7c..0a3ee6a831b38 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; /** * One page checkout status @@ -32,10 +33,11 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - class Payment extends \Magento\Checkout\Block\Onepage\AbstractOnepage { + /** + * @return void + */ protected function _construct() { $this->getCheckout()->setStepData('payment', array( @@ -56,12 +58,40 @@ public function getQuoteBaseGrandTotal() } /** - * Check whether the quote has recurring items + * Get options * - * @return bool + * @return array */ - public function hasRecurringItems() + public function getOptions() { - return $this->getQuote()->hasRecurringItems(); + $registerParam = $this->getRequest()->getParam('register'); + return [ + 'quoteBaseGrandTotal' => $this->getQuoteBaseGrandTotal(), + 'progressUrl' => $this->getUrl('checkout/onepage/progress'), + 'reviewUrl' => $this->getUrl('checkout/onepage/review'), + 'failureUrl' => $this->getUrl('checkout/cart'), + 'getAddressUrl' => $this->getUrl('checkout/onepage/getAddress') . 'address/', + 'checkout' => [ + 'suggestRegistration' => $registerParam || $registerParam === '', + 'saveUrl' => $this->getUrl('checkout/onepage/saveMethod'), + ], + 'billing' => [ + 'saveUrl' => $this->getUrl('checkout/onepage/saveBilling'), + ], + 'shipping' => [ + 'saveUrl' => $this->getUrl('checkout/onepage/saveShipping'), + ], + 'shippingMethod' => [ + 'saveUrl' => $this->getUrl('checkout/onepage/saveShippingMethod'), + ], + 'payment' => [ + 'defaultPaymentMethod' => $this->getChildBlock('methods')->getSelectedMethodCode(), + 'saveUrl' => $this->getUrl('checkout/onepage/savePayment'), + ], + 'review' => [ + 'saveUrl' => $this->getUrl('checkout/onepage/saveOrder'), + 'successUrl' => $this->getUrl('checkout/onepage/success'), + ], + ]; } } diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php index 5b27f0066d88a..6d7b19a430e1d 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage\Payment; /** * Checkout payment information data @@ -31,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage\Payment; - class Info extends \Magento\Payment\Block\Info\AbstractContainer { /** @@ -60,7 +59,7 @@ public function __construct( /** * Retrieve payment info model * - * @return \Magento\Payment\Model\Info + * @return \Magento\Payment\Model\Info|false */ public function getPaymentInfo() { @@ -71,6 +70,9 @@ public function getPaymentInfo() return false; } + /** + * @return string + */ protected function _toHtml() { $html = ''; diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php index e76b366ef8b94..0137117317de2 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php @@ -59,7 +59,7 @@ public function __construct( } /** - * @return \Magento\Sales\Model\Quote|\Magento\Sales\Model\Quote + * @return \Magento\Sales\Model\Quote */ public function getQuote() { @@ -93,6 +93,7 @@ public function getSelectedMethodCode() /** * Payment method form html getter + * * @param \Magento\Payment\Model\Method\AbstractMethod $method * @return string */ @@ -118,7 +119,9 @@ public function getMethodTitle(\Magento\Payment\Model\Method\AbstractMethod $met /** * Payment method additional label part getter + * * @param \Magento\Payment\Model\Method\AbstractMethod $method + * @return string */ public function getMethodLabelAfterHtml(\Magento\Payment\Model\Method\AbstractMethod $method) { diff --git a/app/code/Magento/Checkout/Block/Onepage/Progress.php b/app/code/Magento/Checkout/Block/Onepage/Progress.php index 3bae66bb9eb3a..8507617bf00bb 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Progress.php +++ b/app/code/Magento/Checkout/Block/Onepage/Progress.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; + +use Magento\Sales\Model\Quote\Address; /** * One page checkout status @@ -31,35 +34,51 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - class Progress extends \Magento\Checkout\Block\Onepage\AbstractOnepage { + /** + * @return Address + */ public function getBilling() { return $this->getQuote()->getBillingAddress(); } + /** + * @return Address + */ public function getShipping() { return $this->getQuote()->getShippingAddress(); } + /** + * @return string + */ public function getShippingMethod() { return $this->getQuote()->getShippingAddress()->getShippingMethod(); } + /** + * @return string + */ public function getShippingDescription() { return $this->getQuote()->getShippingAddress()->getShippingDescription(); } + /** + * @return float + */ public function getShippingAmount() { return $this->getQuote()->getShippingAddress()->getShippingAmount(); } + /** + * @return string + */ public function getPaymentHtml() { return $this->getChildHtml('payment_info'); @@ -69,8 +88,9 @@ public function getPaymentHtml() * Get is step completed. if is set 'toStep' then all steps after him is not completed. * * @param string $currentStep - * @see: \Magento\Checkout\Block\Onepage\AbstractOnepage::_getStepCodes() for allowed values * @return bool + * + * @see: \Magento\Checkout\Block\Onepage\AbstractOnepage::_getStepCodes() for allowed values */ public function isStepComplete($currentStep) { @@ -91,6 +111,7 @@ public function isStepComplete($currentStep) /** * Get quote shipping price including tax + * * @return float */ public function getShippingPriceInclTax() @@ -99,11 +120,18 @@ public function getShippingPriceInclTax() return $this->formatPrice($inclTax); } + /** + * @return string + */ public function getShippingPriceExclTax() { return $this->formatPrice($this->getQuote()->getShippingAddress()->getShippingAmount()); } + /** + * @param float $price + * @return string + */ public function formatPrice($price) { return $this->getQuote()->getStore()->formatPrice($price); diff --git a/app/code/Magento/Checkout/Block/Onepage/Review.php b/app/code/Magento/Checkout/Block/Onepage/Review.php index 10ed4fe26c2e0..6ab72b00eb909 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Review.php +++ b/app/code/Magento/Checkout/Block/Onepage/Review.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; /** * One page checkout status @@ -32,10 +33,11 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage; - class Review extends \Magento\Checkout\Block\Onepage\AbstractOnepage { + /** + * @return void + */ protected function _construct() { $this->getCheckout()->setStepData('review', array( diff --git a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php index ebbddbe7640e4..d5ad2eba02af0 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage\Review; /** * One page checkout order review */ -namespace Magento\Checkout\Block\Onepage\Review; - class Info extends \Magento\Sales\Block\Items\AbstractItems { /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping.php b/app/code/Magento/Checkout/Block/Onepage/Shipping.php index b0d132d7b3250..48e04a2b92186 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage; /** * One page checkout status */ -namespace Magento\Checkout\Block\Onepage; - class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage { /** @@ -81,6 +80,8 @@ public function __construct( /** * Initialize shipping address step + * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php index d25aab88e852b..4c506348ba67b 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage\Shipping; /** * One page checkout status @@ -32,8 +33,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage\Shipping; - class Method extends \Magento\Checkout\Block\Onepage\AbstractOnepage { protected function _construct() diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php index eb1ecb6c4170c..34d2c2f5ecf2d 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Block\Onepage\Shipping\Method; /** * Block for additional information in shipping method @@ -32,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage\Shipping\Method; - class Additional extends \Magento\Checkout\Block\Onepage\AbstractOnepage { diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php index bfbd855468a04..65dd8b61af28c 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Onepage\Shipping\Method; + +use Magento\Sales\Model\Quote\Address; /** * One page checkout status @@ -32,11 +35,16 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Block\Onepage\Shipping\Method; - class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage { + /** + * @var array + */ protected $_rates; + + /** + * @var Address + */ protected $_address; /** @@ -82,6 +90,9 @@ public function __construct( $this->_isScopePrivate = true; } + /** + * @return array + */ public function getShippingRates() { if (empty($this->_rates)) { @@ -91,6 +102,9 @@ public function getShippingRates() return $this->_rates; } + /** + * @return Address + */ public function getAddress() { if (empty($this->_address)) { @@ -99,6 +113,10 @@ public function getAddress() return $this->_address; } + /** + * @param string $carrierCode + * @return string + */ public function getCarrierName($carrierCode) { if ($name = $this->_storeConfig->getConfig('carriers/'.$carrierCode.'/title')) { @@ -107,11 +125,19 @@ public function getCarrierName($carrierCode) return $carrierCode; } + /** + * @return string + */ public function getAddressShippingMethod() { return $this->getAddress()->getShippingMethod(); } + /** + * @param float $price + * @param bool|null $flag + * @return float + */ public function getShippingPrice($price, $flag) { return $this->getQuote()->getStore()->convertPrice( diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php index 1b74a6cc0302e..f847d14eb1ba9 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Success.php +++ b/app/code/Magento/Checkout/Block/Onepage/Success.php @@ -110,7 +110,7 @@ public function getAdditionalInfoHtml() /** * Getter for recurring profile view page * - * @param $profile + * @param \Magento\Object $profile * @return string */ public function getProfileUrl(\Magento\Object $profile) @@ -120,6 +120,8 @@ public function getProfileUrl(\Magento\Object $profile) /** * Initialize data and prepare it for output + * + * @return string */ protected function _beforeToHtml() { @@ -130,6 +132,8 @@ protected function _beforeToHtml() /** * Get last order ID from session, fetch it and check whether it can be viewed, printed etc + * + * @return void */ protected function _prepareLastOrder() { @@ -152,6 +156,8 @@ protected function _prepareLastOrder() /** * Prepare recurring payment profiles from the session + * + * @return void */ protected function _prepareLastRecurringProfiles() { diff --git a/app/code/Magento/Checkout/Block/QuoteShortcutButtons.php b/app/code/Magento/Checkout/Block/QuoteShortcutButtons.php index 44757f0a754ea..5e11a6902c4e6 100644 --- a/app/code/Magento/Checkout/Block/QuoteShortcutButtons.php +++ b/app/code/Magento/Checkout/Block/QuoteShortcutButtons.php @@ -21,7 +21,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block; use Magento\View\Element\Template; diff --git a/app/code/Magento/Checkout/Block/Success.php b/app/code/Magento/Checkout/Block/Success.php index 7456144016680..7b3a246595779 100644 --- a/app/code/Magento/Checkout/Block/Success.php +++ b/app/code/Magento/Checkout/Block/Success.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block; class Success extends \Magento\View\Element\Template diff --git a/app/code/Magento/Checkout/Block/Total/DefaultTotal.php b/app/code/Magento/Checkout/Block/Total/DefaultTotal.php index b25404e12ffc9..47fca28b2b371 100644 --- a/app/code/Magento/Checkout/Block/Total/DefaultTotal.php +++ b/app/code/Magento/Checkout/Block/Total/DefaultTotal.php @@ -23,13 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Block\Total; /** * Default Total Row Renderer */ -namespace Magento\Checkout\Block\Total; - class DefaultTotal extends \Magento\Checkout\Block\Cart\Totals { /** @@ -42,6 +40,9 @@ class DefaultTotal extends \Magento\Checkout\Block\Cart\Totals */ protected $_store; + /** + * @return void + */ protected function _construct() { parent::_construct(); @@ -59,7 +60,7 @@ public function getStyle() } /** - * @param $total + * @param float $total * @return $this */ public function setTotal($total) diff --git a/app/code/Magento/Checkout/Block/Total/Nominal.php b/app/code/Magento/Checkout/Block/Total/Nominal.php index 30ff002fdc824..5d870dbd4d2a3 100644 --- a/app/code/Magento/Checkout/Block/Total/Nominal.php +++ b/app/code/Magento/Checkout/Block/Total/Nominal.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Block\Total; /** * Nominal total rendered * * Each item is rendered as separate total with its details */ -namespace Magento\Checkout\Block\Total; - class Nominal extends \Magento\Checkout\Block\Total\DefaultTotal { /** diff --git a/app/code/Magento/Checkout/Block/Total/Tax.php b/app/code/Magento/Checkout/Block/Total/Tax.php index afe6248d24ed2..7f35041523a6e 100644 --- a/app/code/Magento/Checkout/Block/Total/Tax.php +++ b/app/code/Magento/Checkout/Block/Total/Tax.php @@ -23,16 +23,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Block\Total; /** * Tax Total Row Renderer * * @author Magento Core Team */ -namespace Magento\Checkout\Block\Total; - class Tax extends \Magento\Checkout\Block\Total\DefaultTotal { + /** + * @var string + */ protected $_template = 'total/tax.phtml'; } diff --git a/app/code/Magento/Checkout/Controller/Action.php b/app/code/Magento/Checkout/Controller/Action.php index 5f8f808d31432..317b1247bea0a 100644 --- a/app/code/Magento/Checkout/Controller/Action.php +++ b/app/code/Magento/Checkout/Controller/Action.php @@ -18,18 +18,19 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Checkout * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Controller; +use Magento\Customer\Service\V1\CustomerServiceInterface as CustomerService; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface as CustomerAccountService; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadataService; +use Magento\Exception\NoSuchEntityException; /** * Controller for onepage checkouts */ -namespace Magento\Checkout\Controller; - abstract class Action extends \Magento\App\Action\Action { /** @@ -37,20 +38,45 @@ abstract class Action extends \Magento\App\Action\Action */ protected $_customerSession; + /** + * @var CustomerService + */ + protected $_customerService; + + /** + * @var CustomerAccountService + */ + protected $_customerAccountService; + + /** + * @var CustomerMetadataService + */ + protected $_customerMetadataService; + /** * @param \Magento\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession + * @param CustomerService $customerService + * @param CustomerAccountService $customerAccountService + * @param CustomerMetadataService $customerMetadataService */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Customer\Model\Session $customerSession + \Magento\Customer\Model\Session $customerSession, + CustomerService $customerService, + CustomerAccountService $customerAccountService, + CustomerMetadataService $customerMetadataService ) { $this->_customerSession = $customerSession; + $this->_customerService = $customerService; + $this->_customerAccountService = $customerAccountService; + $this->_customerMetadataService = $customerMetadataService; parent::__construct($context); } /** * Make sure customer is valid, if logged in + * * By default will add error messages and redirect to customer edit form * * @param bool $redirect - stop dispatch and redirect? @@ -59,9 +85,18 @@ public function __construct( */ protected function _preDispatchValidateCustomer($redirect = true, $addErrors = true) { - $customer = $this->_customerSession->getCustomer(); - if ($customer && $customer->getId()) { - $validationResult = $customer->validate(); + try { + $customerId = $this->_customerSession->getCustomerId(); + $customer = $this->_customerService->getCustomer($customerId); + } catch (NoSuchEntityException $e) { + return true; + } + + if (isset($customer)) { + $validationResult = $this->_customerAccountService->validateCustomerData( + $customer, + $this->_customerMetadataService->getAllCustomerAttributeMetadata() + ); if ((true !== $validationResult) && is_array($validationResult)) { if ($addErrors) { foreach ($validationResult as $error) { diff --git a/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php b/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php index b91784634007e..b92872289aea4 100644 --- a/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php +++ b/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Controller\Adminhtml; class Agreement extends \Magento\Backend\App\Action @@ -31,22 +30,25 @@ class Agreement extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); } + /** + * @return void + */ public function indexAction() { $this->_title->add(__('Terms and Conditions')); @@ -58,11 +60,17 @@ public function indexAction() $this->_view->renderLayout(); } + /** + * @return void + */ public function newAction() { $this->_forward('edit'); } + /** + * @return void + */ public function editAction() { $this->_title->add(__('Terms and Conditions')); @@ -101,6 +109,9 @@ public function editAction() $this->_view->renderLayout(); } + /** + * @return void + */ public function saveAction() { $postData = $this->getRequest()->getPost(); @@ -126,6 +137,9 @@ public function saveAction() } } + /** + * @return void + */ public function deleteAction() { $id = (int)$this->getRequest()->getParam('id'); @@ -154,7 +168,7 @@ public function deleteAction() /** * Initialize action * - * @return \Magento\Backend\App\Action + * @return $this */ protected function _initAction() { @@ -165,6 +179,9 @@ protected function _initAction() return $this; } + /** + * @return bool + */ protected function _isAllowed() { return $this->_authorization->isAllowed('Magento_Checkout::checkoutagreement'); diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php index 34c043e7c324d..a8cb2355b5f5a 100644 --- a/app/code/Magento/Checkout/Controller/Cart.php +++ b/app/code/Magento/Checkout/Controller/Cart.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Controller; /** * Shopping cart controller */ -namespace Magento\Checkout\Controller; - class Cart extends \Magento\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface @@ -97,7 +96,7 @@ protected function _getQuote() /** * Set back redirect url to response * - * @return \Magento\Checkout\Controller\Cart + * @return $this */ protected function _goBack() { @@ -141,6 +140,8 @@ protected function _initProduct() /** * Shopping cart display action + * + * @return void */ public function indexAction() { @@ -194,6 +195,8 @@ public function indexAction() /** * Add product to shopping cart action + * + * @return void */ public function addAction() { @@ -235,7 +238,7 @@ public function addAction() ); if (!$this->_checkoutSession->getNoCartRedirect(true)) { - if (!$cart->getQuote()->getHasError()){ + if (!$cart->getQuote()->getHasError()) { $message = __('You added %1 to your shopping cart.', $this->_objectManager->get('Magento\Escaper')->escapeHtml($product->getName())); $this->messageManager->addSuccess($message); } @@ -269,6 +272,9 @@ public function addAction() } } + /** + * @return void + */ public function addgroupAction() { $orderItemIds = $this->getRequest()->getParam('order_items', array()); @@ -302,6 +308,8 @@ public function addgroupAction() /** * Action to reconfigure cart item + * + * @return void */ public function configureAction() { @@ -338,6 +346,8 @@ public function configureAction() /** * Update product configuration for a cart item + * + * @return void */ public function updateItemOptionsAction() { @@ -382,7 +392,7 @@ public function updateItemOptionsAction() array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse()) ); if (!$this->_checkoutSession->getNoCartRedirect(true)) { - if (!$cart->getQuote()->getHasError()){ + if (!$cart->getQuote()->getHasError()) { $message = __( '%1 was updated in your shopping cart.', $this->_objectManager->get('Magento\Escaper')->escapeHtml($item->getProduct()->getName()) @@ -418,6 +428,8 @@ public function updateItemOptionsAction() /** * Update shopping cart data action + * + * @return void */ public function updatePostAction() { @@ -444,6 +456,8 @@ public function updatePostAction() /** * Update customer's shopping cart + * + * @return void */ protected function _updateShoppingCart() { @@ -459,7 +473,7 @@ protected function _updateShoppingCart() } } $cart = $this->_getCart(); - if (! $cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) { + if (!$cart->getCustomerSession()->getCustomerId() && $cart->getQuote()->getCustomerId()) { $cart->getQuote()->setCustomerId(null); } @@ -469,7 +483,9 @@ protected function _updateShoppingCart() } $this->_checkoutSession->setCartWasUpdated(true); } catch (\Magento\Core\Exception $e) { - $this->messageManager->addError($this->_objectManager->get('Magento\Escaper')->escapeHtml($e->getMessage())); + $this->messageManager->addError( + $this->_objectManager->get('Magento\Escaper')->escapeHtml($e->getMessage()) + ); } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot update the shopping cart.')); $this->_objectManager->get('Magento\Logger')->logException($e); @@ -478,6 +494,8 @@ protected function _updateShoppingCart() /** * Empty customer's shopping cart + * + * @return void */ protected function _emptyShoppingCart() { @@ -493,6 +511,8 @@ protected function _emptyShoppingCart() /** * Delete shopping cart item action + * + * @return void */ public function deleteAction() { @@ -512,6 +532,8 @@ public function deleteAction() /** * Initialize shipping information + * + * @return void */ public function estimatePostAction() { @@ -532,6 +554,9 @@ public function estimatePostAction() $this->_goBack(); } + /** + * @return void + */ public function estimateUpdatePostAction() { $code = (string) $this->getRequest()->getParam('estimate_method'); @@ -543,6 +568,8 @@ public function estimateUpdatePostAction() /** * Initialize coupon + * + * @return void */ public function couponPostAction() { @@ -604,7 +631,7 @@ public function couponPostAction() } /** - * check if URL corresponds store + * Check if URL corresponds store * * @param string $url * @return bool diff --git a/app/code/Magento/Checkout/Controller/Index.php b/app/code/Magento/Checkout/Controller/Index.php index fce539baa6f81..43911e83a925a 100644 --- a/app/code/Magento/Checkout/Controller/Index.php +++ b/app/code/Magento/Checkout/Controller/Index.php @@ -23,12 +23,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Controller; class Index extends \Magento\App\Action\Action { - function indexAction() + /** + * @return void + */ + public function indexAction() { $this->_redirect('checkout/onepage', array('_secure'=>true)); } diff --git a/app/code/Magento/Checkout/Controller/Onepage.php b/app/code/Magento/Checkout/Controller/Onepage.php index 6c9145018c56b..bdcf5c7e25fba 100644 --- a/app/code/Magento/Checkout/Controller/Onepage.php +++ b/app/code/Magento/Checkout/Controller/Onepage.php @@ -23,13 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Controller; use Magento\App\Action\NotFoundException; use Magento\App\RequestInterface; +use Magento\Customer\Service\V1\CustomerServiceInterface as CustomerService; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface as CustomerAccountService; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadataService; -class Onepage extends \Magento\Checkout\Controller\Action +class Onepage extends Action { /** * @var array @@ -48,7 +50,7 @@ class Onepage extends \Magento\Checkout\Controller\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -65,21 +67,33 @@ class Onepage extends \Magento\Checkout\Controller\Action /** * @param \Magento\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Core\Model\Registry $coreRegistry + * @param CustomerService $customerService + * @param CustomerAccountService $customerAccountService + * @param CustomerMetadataService $customerMetadataService + * @param \Magento\Registry $coreRegistry * @param \Magento\Translate\InlineInterface $translateInline, * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( \Magento\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Registry $coreRegistry, + CustomerService $customerService, + CustomerAccountService $customerAccountService, + CustomerMetadataService $customerMetadataService, + \Magento\Registry $coreRegistry, \Magento\Translate\InlineInterface $translateInline, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator ) { $this->_coreRegistry = $coreRegistry; $this->_translateInline = $translateInline; $this->_formKeyValidator = $formKeyValidator; - parent::__construct($context, $customerSession); + parent::__construct( + $context, + $customerSession, + $customerService, + $customerAccountService, + $customerMetadataService + ); } /** @@ -107,7 +121,7 @@ public function dispatch(RequestInterface $request) } /** - * @return \Magento\Checkout\Controller\Onepage + * @return $this */ protected function _ajaxRedirectResponse() { @@ -209,6 +223,8 @@ public function getOnepage() /** * Checkout page + * + * @return void */ public function indexAction() { @@ -245,6 +261,8 @@ public function indexAction() /** * Checkout status block + * + * @return void */ public function progressAction() { @@ -256,6 +274,9 @@ public function progressAction() $this->_view->renderLayout(); } + /** + * @return void + */ public function shippingMethodAction() { if ($this->_expireAjax()) { @@ -266,6 +287,9 @@ public function shippingMethodAction() $this->_view->renderLayout(); } + /** + * @return void + */ public function reviewAction() { if ($this->_expireAjax()) { @@ -278,6 +302,8 @@ public function reviewAction() /** * Order success action + * + * @return void */ public function successAction() { @@ -305,6 +331,9 @@ public function successAction() $this->_view->renderLayout(); } + /** + * @return void + */ public function failureAction() { $lastQuoteId = $this->getOnepage()->getCheckout()->getLastQuoteId(); @@ -320,35 +349,18 @@ public function failureAction() } - public function getAdditionalAction() - { - $this->getResponse()->setBody($this->_getAdditionalHtml()); - } - /** - * Address JSON + * @return void */ - public function getAddressAction() + public function getAdditionalAction() { - if ($this->_expireAjax()) { - return; - } - $addressId = $this->getRequest()->getParam('address', false); - if ($addressId) { - $address = $this->getOnepage()->getAddress($addressId); - - $customerSession = $this->_objectManager->get('Magento\Customer\Model\Session'); - if ($customerSession->getCustomer()->getId() == $address->getCustomerId()) { - $this->getResponse()->setHeader('Content-type', 'application/x-json'); - $this->getResponse()->setBody($address->toJson()); - } else { - $this->getResponse()->setHeader('HTTP/1.1', '403 Forbidden'); - } - } + $this->getResponse()->setBody($this->_getAdditionalHtml()); } /** * Save checkout method + * + * @return void */ public function saveMethodAction() { @@ -363,7 +375,9 @@ public function saveMethodAction() } /** - * save checkout billing address + * Save checkout billing address + * + * @return void */ public function saveBillingAction() { @@ -406,6 +420,8 @@ public function saveBillingAction() /** * Shipping address save action + * + * @return void */ public function saveShippingAction() { @@ -430,6 +446,8 @@ public function saveShippingAction() /** * Shipping method save action + * + * @return void */ public function saveShippingMethodAction() { @@ -440,7 +458,7 @@ public function saveShippingMethodAction() $data = $this->getRequest()->getPost('shipping_method', ''); $result = $this->getOnepage()->saveShippingMethod($data); // $result will contain error data if shipping method is empty - if(!$result) { + if (!$result) { $this->_eventManager->dispatch('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$this->getOnepage()->getQuote())); @@ -462,6 +480,8 @@ public function saveShippingMethodAction() * Save payment ajax action * * Sets either redirect or a JSON response + * + * @return void */ public function savePaymentAction() { @@ -546,6 +566,8 @@ protected function _initInvoice() /** * Create order action + * + * @return void */ public function saveOrderAction() { diff --git a/app/code/Magento/Checkout/Helper/Cart.php b/app/code/Magento/Checkout/Helper/Cart.php index a6c511ec72395..77c15159d45ca 100644 --- a/app/code/Magento/Checkout/Helper/Cart.php +++ b/app/code/Magento/Checkout/Helper/Cart.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Helper; /** * Shopping cart helper * * @author Magento Core Team */ -namespace Magento\Checkout\Helper; - class Cart extends \Magento\Core\Helper\Url { const XML_PATH_REDIRECT_TO_CART = 'checkout/cart/redirect_to_cart'; @@ -149,7 +148,7 @@ public function getRemoveUrl($item) /** * Retrieve shopping cart url * - * @return unknown + * @return string */ public function getCartUrl() { @@ -179,7 +178,7 @@ public function getItemsCount() /** * Get shopping cart summary qty * - * @return decimal + * @return int|float */ public function getItemsQty() { @@ -187,9 +186,9 @@ public function getItemsQty() } /** - * Get shopping cart items summary (inchlude config settings) + * Get shopping cart items summary (include config settings) * - * @return decimal + * @return int|float */ public function getSummaryCount() { @@ -197,7 +196,7 @@ public function getSummaryCount() } /** - * Check qoute for virtual products only + * Check quote for virtual products only * * @return bool */ diff --git a/app/code/Magento/Checkout/Helper/Data.php b/app/code/Magento/Checkout/Helper/Data.php index 7b50097ace430..0e95aa6ed7836 100644 --- a/app/code/Magento/Checkout/Helper/Data.php +++ b/app/code/Magento/Checkout/Helper/Data.php @@ -23,19 +23,24 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Helper; + +use Magento\Core\Model\Store; +use Magento\Sales\Model\Quote\Item\AbstractItem; /** * Checkout default helper * * @author Magento Core Team */ -namespace Magento\Checkout\Helper; - class Data extends \Magento\App\Helper\AbstractHelper { const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout'; const XML_PATH_CUSTOMER_MUST_BE_LOGGED = 'checkout/options/customer_must_be_logged'; + /** + * @var array|null + */ protected $_agreements = null; /** @@ -66,9 +71,9 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_agreementCollectionFactory; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_emailTemplFactory; + protected $_transportBuilder; /** * Translator model @@ -84,7 +89,7 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollectionFactory - * @param \Magento\Email\Model\TemplateFactory $emailTemplFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\TranslateInterface $translator */ public function __construct( @@ -94,7 +99,7 @@ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, \Magento\Core\Model\LocaleInterface $locale, \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollectionFactory, - \Magento\Email\Model\TemplateFactory $emailTemplFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\TranslateInterface $translator ) { $this->_coreStoreConfig = $coreStoreConfig; @@ -102,7 +107,7 @@ public function __construct( $this->_checkoutSession = $checkoutSession; $this->_locale = $locale; $this->_agreementCollectionFactory = $agreementCollectionFactory; - $this->_emailTemplFactory = $emailTemplFactory; + $this->_transportBuilder = $transportBuilder; $this->_translator = $translator; parent::__construct($context); } @@ -127,16 +132,28 @@ public function getQuote() return $this->getCheckout()->getQuote(); } + /** + * @param float $price + * @return string + */ public function formatPrice($price) { return $this->getQuote()->getStore()->formatPrice($price); } + /** + * @param float $price + * @param bool $format + * @return float + */ public function convertPrice($price, $format=true) { return $this->getQuote()->getStore()->convertPrice($price, $format); } + /** + * @return array + */ public function getRequiredAgreementIds() { if (is_null($this->_agreements)) { @@ -194,6 +211,10 @@ public function getSubtotalInclTax($item) return $item->getRowTotal() + $tax; } + /** + * @param AbstractItem $item + * @return float + */ public function getBasePriceInclTax($item) { $qty = ($item->getQty() ? $item->getQty() : ($item->getQtyOrdered() ? $item->getQtyOrdered() : 1)); @@ -202,6 +223,10 @@ public function getBasePriceInclTax($item) return $this->_storeManager->getStore()->roundPrice($price); } + /** + * @param AbstractItem $item + * @return float + */ public function getBaseSubtotalInclTax($item) { $tax = $item->getBaseTaxAmount() + $item->getBaseDiscountTaxCompensation(); @@ -214,23 +239,21 @@ public function getBaseSubtotalInclTax($item) * @param \Magento\Sales\Model\Quote $checkout * @param string $message * @param string $checkoutType - * @return \Magento\Checkout\Helper\Data + * @return $this */ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'onepage') { $this->_translator->setTranslateInline(false); - /** @var \Magento\Email\Model\Template $mailTemplate */ - $mailTemplate = $this->_emailTemplFactory->create(); - $template = $this->_coreStoreConfig->getConfig('checkout/payment_failed/template', $checkout->getStoreId()); $copyTo = $this->_getEmails('checkout/payment_failed/copy_to', $checkout->getStoreId()); $copyMethod = $this->_coreStoreConfig->getConfig( 'checkout/payment_failed/copy_method', $checkout->getStoreId() ); + $bcc = array(); if ($copyTo && $copyMethod == 'bcc') { - $mailTemplate->addBcc($copyTo); + $bcc = $copyTo; } $_receiver = $this->_coreStoreConfig->getConfig('checkout/payment_failed/receiver', $checkout->getStoreId()); @@ -268,35 +291,37 @@ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'one foreach ($checkout->getAllVisibleItems() as $_item) { /* @var $_item \Magento\Sales\Model\Quote\Item */ $items .= $_item->getProduct()->getName() . ' x '. $_item->getQty() . ' ' - . $checkout->getStoreCurrencyCode() . ' ' - . $_item->getProduct()->getFinalPrice($_item->getQty()) . "\n"; + . $checkout->getStoreCurrencyCode() . ' ' + . $_item->getProduct()->getFinalPrice($_item->getQty()) . "\n"; } $total = $checkout->getStoreCurrencyCode() . ' ' . $checkout->getGrandTotal(); foreach ($sendTo as $recipient) { - $mailTemplate->setDesignConfig(array( - 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'store' => $checkout->getStoreId() - )) - ->sendTransactional( - $template, - $this->_coreStoreConfig->getConfig('checkout/payment_failed/identity', $checkout->getStoreId()), - $recipient['email'], - $recipient['name'], - array( - 'reason' => $message, - 'checkoutType' => $checkoutType, - 'dateAndTime' => $this->_locale->date(), - 'customer' => $checkout->getCustomerFirstname() . ' ' . $checkout->getCustomerLastname(), - 'customerEmail' => $checkout->getCustomerEmail(), - 'billingAddress' => $checkout->getBillingAddress(), - 'shippingAddress' => $checkout->getShippingAddress(), - 'shippingMethod' => $this->_coreStoreConfig->getConfig('carriers/'.$shippingMethod.'/title'), - 'paymentMethod' => $this->_coreStoreConfig->getConfig('payment/'.$paymentMethod.'/title'), - 'items' => nl2br($items), - 'total' => $total - ) - ); + $transport = $this->_transportBuilder + ->setTemplateIdentifier($template) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $checkout->getStoreId() + )) + ->setTemplateVars(array( + 'reason' => $message, + 'checkoutType' => $checkoutType, + 'dateAndTime' => $this->_locale->date(), + 'customer' => $checkout->getCustomerFirstname() . ' ' . $checkout->getCustomerLastname(), + 'customerEmail' => $checkout->getCustomerEmail(), + 'billingAddress' => $checkout->getBillingAddress(), + 'shippingAddress' => $checkout->getShippingAddress(), + 'shippingMethod' => $this->_coreStoreConfig->getConfig('carriers/'.$shippingMethod.'/title'), + 'paymentMethod' => $this->_coreStoreConfig->getConfig('payment/'.$paymentMethod.'/title'), + 'items' => nl2br($items), + 'total' => $total + )) + ->setFrom($this->_coreStoreConfig->getConfig('checkout/payment_failed/identity', $checkout->getStoreId())) + ->addTo($recipient['email'], $recipient['name']) + ->addBcc($bcc) + ->getTransport(); + + $transport->sendMessage(); } $this->_translator->setTranslateInline(true); @@ -304,6 +329,11 @@ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'one return $this; } + /** + * @param string $configPath + * @param null|string|bool|int|Store $storeId + * @return array|false + */ protected function _getEmails($configPath, $storeId) { $data = $this->_coreStoreConfig->getConfig($configPath, $storeId); @@ -318,7 +348,7 @@ protected function _getEmails($configPath, $storeId) * Use config settings and observer * * @param \Magento\Sales\Model\Quote $quote - * @param int|\Magento\Core\Model\Store $store + * @param int|Store $store * @return bool */ public function isAllowedGuestCheckout(\Magento\Sales\Model\Quote $quote, $store = null) diff --git a/app/code/Magento/Checkout/Helper/Url.php b/app/code/Magento/Checkout/Helper/Url.php index 3d53ca4a9b470..18b050db4ba45 100644 --- a/app/code/Magento/Checkout/Helper/Url.php +++ b/app/code/Magento/Checkout/Helper/Url.php @@ -55,6 +55,8 @@ public function getCheckoutUrl() /** * One Page (OP) checkout urls + * + * @return string */ public function getOPCheckoutUrl() { diff --git a/app/code/Magento/Checkout/Model/Agreement.php b/app/code/Magento/Checkout/Model/Agreement.php index d053f4b50fed3..06c7cb3272971 100644 --- a/app/code/Magento/Checkout/Model/Agreement.php +++ b/app/code/Magento/Checkout/Model/Agreement.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Model; /** * @method \Magento\Checkout\Model\Resource\Agreement _getResource() @@ -44,10 +45,11 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Model; - class Agreement extends \Magento\Core\Model\AbstractModel { + /** + * @return void + */ protected function _construct() { $this->_init('Magento\Checkout\Model\Resource\Agreement'); diff --git a/app/code/Magento/Checkout/Model/Cart.php b/app/code/Magento/Checkout/Model/Cart.php index ca76d4068db0c..09b3eb999d0bc 100644 --- a/app/code/Magento/Checkout/Model/Cart.php +++ b/app/code/Magento/Checkout/Model/Cart.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Model; + +use Magento\Catalog\Model\Product; /** * Shopping cart model @@ -31,8 +34,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Model; - class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartInterface { /** @@ -45,7 +46,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI /** * List of product ids in shopping cart * - * @var array|null + * @var int[]|null */ protected $_productIds; @@ -79,7 +80,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI protected $_resourceCart; /** - * @var \Magento\Checkout\Model\Session + * @var Session */ protected $_checkoutSession; @@ -99,7 +100,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Checkout\Model\Resource\Cart $resourceCart - * @param \Magento\Checkout\Model\Session $checkoutSession + * @param Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Message\ManagerInterface $messageManager * @param array $data @@ -110,7 +111,7 @@ public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Resource\Cart $resourceCart, - \Magento\Checkout\Model\Session $checkoutSession, + Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Message\ManagerInterface $messageManager, array $data = array() @@ -139,7 +140,7 @@ protected function _getResource() /** * Retrieve checkout session model * - * @return \Magento\Checkout\Model\Session + * @return Session */ public function getCheckoutSession() { @@ -149,7 +150,7 @@ public function getCheckoutSession() /** * Retrieve customer session model * - * @return \Magento\Customer\Model\Customer + * @return \Magento\Customer\Model\Session */ public function getCustomerSession() { @@ -204,7 +205,7 @@ public function getQuote() * Set quote object associated with the cart * * @param \Magento\Sales\Model\Quote $quote - * @return \Magento\Checkout\Model\Cart + * @return $this */ public function setQuote(\Magento\Sales\Model\Quote $quote) { @@ -215,13 +216,13 @@ public function setQuote(\Magento\Sales\Model\Quote $quote) /** * Initialize cart quote state to be able use it on cart page * - * @return \Magento\Checkout\Model\Cart + * @return $this */ public function init() { $quote = $this->getQuote()->setCheckoutMethod(''); - if ($this->_checkoutSession->getCheckoutState() !== \Magento\Checkout\Model\Session::CHECKOUT_STATE_BEGIN) { + if ($this->_checkoutSession->getCheckoutState() !== Session::CHECKOUT_STATE_BEGIN) { $quote->removeAllAddresses()->removePayment(); $this->_checkoutSession->resetCheckout(); } @@ -238,8 +239,8 @@ public function init() * Convert order item to quote item * * @param \Magento\Sales\Model\Order\Item $orderItem - * @param mixed $qtyFlag if is null set product qty like in order - * @return \Magento\Checkout\Model\Cart + * @param true|null $qtyFlag if is null set product qty like in order + * @return $this */ public function addOrderItem($orderItem, $qtyFlag = null) { @@ -268,14 +269,14 @@ public function addOrderItem($orderItem, $qtyFlag = null) /** * Get product object based on requested product information * - * @param mixed $productInfo - * @return \Magento\Catalog\Model\Product + * @param Product|int|string $productInfo + * @return Product * @throws \Magento\Core\Exception */ protected function _getProduct($productInfo) { $product = null; - if ($productInfo instanceof \Magento\Catalog\Model\Product) { + if ($productInfo instanceof Product) { $product = $productInfo; } elseif (is_int($productInfo) || is_string($productInfo)) { $product = $this->_productFactory->create() @@ -296,7 +297,7 @@ protected function _getProduct($productInfo) /** * Get request for product add to cart procedure * - * @param mixed $requestInfo + * @param \Magento\Object|int|array $requestInfo * @return \Magento\Object */ protected function _getProductRequest($requestInfo) @@ -319,9 +320,9 @@ protected function _getProductRequest($requestInfo) /** * Add product to shopping cart (quote) * - * @param int|\Magento\Catalog\Model\Product $productInfo - * @param mixed $requestInfo - * @return \Magento\Checkout\Model\Cart + * @param int|Product $productInfo + * @param \Magento\Object|int|array $requestInfo + * @return $this * @throws \Magento\Core\Exception */ public function addProduct($productInfo, $requestInfo = null) @@ -381,8 +382,8 @@ public function addProduct($productInfo, $requestInfo = null) /** * Adding products to cart by ids * - * @param array $productIds - * @return \Magento\Checkout\Model\Cart + * @param int[] $productIds + * @return $this */ public function addProductsByIds($productIds) { @@ -422,7 +423,7 @@ public function addProductsByIds($productIds) * Can be used to automatically fix user entered quantities before updating cart * so that cart contains valid qty values * - * $data is an array of ($quoteItemId => (item info array with 'qty' key), ...) + * The $data is an array of ($quoteItemId => (item info array with 'qty' key), ...) * * @param array $data * @return array @@ -464,8 +465,8 @@ public function suggestItemsQty($data) /** * Update cart items information * - * @param array $data - * @return \Magento\Checkout\Model\Cart + * @param array $data + * @return $this * @throws \Magento\Core\Exception */ public function updateItems($data) @@ -517,8 +518,8 @@ public function updateItems($data) /** * Remove item from cart * - * @param int $itemId - * @return \Magento\Checkout\Model\Cart + * @param int $itemId + * @return $this */ public function removeItem($itemId) { @@ -529,7 +530,7 @@ public function removeItem($itemId) /** * Save cart * - * @return \Magento\Checkout\Model\Cart + * @return $this */ public function save() { @@ -549,6 +550,8 @@ public function save() /** * Save cart (implement interface method) + * + * @return void */ public function saveQuote() { @@ -558,7 +561,7 @@ public function saveQuote() /** * Mark all quote items as deleted (empty shopping cart) * - * @return \Magento\Checkout\Model\Cart + * @return $this */ public function truncate() { @@ -567,16 +570,16 @@ public function truncate() } /** - * @return array|null + * @return int[] */ public function getProductIds() { if (null === $this->_productIds) { $this->_productIds = array(); if ($this->getSummaryQty()>0) { - foreach ($this->getQuote()->getAllItems() as $item) { - $this->_productIds[] = $item->getProductId(); - } + foreach ($this->getQuote()->getAllItems() as $item) { + $this->_productIds[] = $item->getProductId(); + } } $this->_productIds = array_unique($this->_productIds); } @@ -635,13 +638,13 @@ public function getItemsQty() * $requestInfo - either qty (int) or buyRequest in form of array or \Magento\Object * $updatingParams - information on how to perform update, passed to Quote->updateItem() method * - * @see \Magento\Sales\Model\Quote::updateItem() - * * @param int $itemId * @param int|array|\Magento\Object $requestInfo * @param null|array|\Magento\Object $updatingParams * @return \Magento\Sales\Model\Quote\Item|string * @throws \Magento\Core\Exception + * + * @see \Magento\Sales\Model\Quote::updateItem() */ public function updateItem($itemId, $requestInfo = null, $updatingParams = null) { diff --git a/app/code/Magento/Checkout/Model/Cart/CartInterface.php b/app/code/Magento/Checkout/Model/Cart/CartInterface.php index 64e4d3be73c54..082bb78a9dd63 100644 --- a/app/code/Magento/Checkout/Model/Cart/CartInterface.php +++ b/app/code/Magento/Checkout/Model/Cart/CartInterface.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Model\Cart; + +use Magento\Sales\Model\Quote; /** * Shopping cart interface @@ -31,41 +34,39 @@ * @package Magento_Checkout * @author Magento Core Team */ - -namespace Magento\Checkout\Model\Cart; - interface CartInterface { /** * Add product to shopping cart (quote) * - * @param int|\Magento\Catalog\Model\Product $productInfo - * @param mixed $requestInfo - * @return \Magento\Checkout\Model\Cart\CartInterface + * @param int|\Magento\Catalog\Model\Product $productInfo + * @param array|float|int|\Magento\Object|null $requestInfo + * @return $this */ public function addProduct($productInfo, $requestInfo = null); /** * Save cart * + * @return $this * @abstract - * @return \Magento\Checkout\Model\Cart\CartInterface */ public function saveQuote(); /** * Associate quote with the cart * + * @param Quote $quote + * @return $this * @abstract - * @param $quote \Magento\Sales\Model\Quote - * @return \Magento\Checkout\Model\Cart\CartInterface */ - public function setQuote(\Magento\Sales\Model\Quote $quote); + public function setQuote(Quote $quote); /** * Get quote object associated with cart + * + * @return Quote * @abstract - * @return \Magento\Sales\Model\Quote */ public function getQuote(); } diff --git a/app/code/Magento/Checkout/Model/Config/Source/Cart/Summary.php b/app/code/Magento/Checkout/Model/Config/Source/Cart/Summary.php index 085c02519008e..7e62210bbfbc7 100644 --- a/app/code/Magento/Checkout/Model/Config/Source/Cart/Summary.php +++ b/app/code/Magento/Checkout/Model/Config/Source/Cart/Summary.php @@ -25,8 +25,11 @@ */ namespace Magento\Checkout\Model\Config\Source\Cart; -class Summary implements \Magento\Core\Model\Option\ArrayInterface +class Summary implements \Magento\Option\ArrayInterface { + /** + * @return array + */ public function toOptionArray() { return array( diff --git a/app/code/Magento/Checkout/Model/Observer.php b/app/code/Magento/Checkout/Model/Observer.php index ec120274fab21..fd92853fde287 100644 --- a/app/code/Magento/Checkout/Model/Observer.php +++ b/app/code/Magento/Checkout/Model/Observer.php @@ -36,7 +36,7 @@ class Observer { /** - * @var \Magento\Checkout\Model\Session + * @var Session */ protected $_checkoutSession; @@ -46,22 +46,28 @@ class Observer protected $messageManager; /** - * @param \Magento\Checkout\Model\Session $checkoutSession + * @param Session $checkoutSession * @param \Magento\Message\ManagerInterface $messageManager */ public function __construct( - \Magento\Checkout\Model\Session $checkoutSession, + Session $checkoutSession, \Magento\Message\ManagerInterface $messageManager ) { $this->_checkoutSession = $checkoutSession; $this->messageManager = $messageManager; } + /** + * @return void + */ public function unsetAll() { $this->_checkoutSession->clearQuote()->clearStorage(); } + /** + * @return void + */ public function loadCustomerQuote() { try { @@ -73,6 +79,10 @@ public function loadCustomerQuote() } } + /** + * @param Observer $observer + * @return void + */ public function salesQuoteSaveAfter($observer) { $quote = $observer->getEvent()->getQuote(); diff --git a/app/code/Magento/Checkout/Model/Resource/Agreement.php b/app/code/Magento/Checkout/Model/Resource/Agreement.php index bd0132c899a31..11b98da56656a 100644 --- a/app/code/Magento/Checkout/Model/Resource/Agreement.php +++ b/app/code/Magento/Checkout/Model/Resource/Agreement.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Model\Resource; /** * Resource Model for Checkout Agreement @@ -32,8 +32,6 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Model\Resource; - class Agreement extends \Magento\Core\Model\Resource\Db\AbstractDb { /** @@ -54,6 +52,7 @@ public function __construct(\Magento\App\Resource $resource, \Magento\Filter\Fil /** * Model initialization * + * @return void */ protected function _construct() { @@ -64,7 +63,7 @@ protected function _construct() * Method to run before save * * @param \Magento\Core\Model\AbstractModel $object - * @return \Magento\Core\Model\Resource\Db\AbstractDb + * @return $this */ protected function _beforeSave(\Magento\Core\Model\AbstractModel $object) { @@ -85,7 +84,7 @@ protected function _beforeSave(\Magento\Core\Model\AbstractModel $object) * Method to run after save * * @param \Magento\Core\Model\AbstractModel $object - * @return \Magento\Core\Model\Resource\Db\AbstractDb + * @return $this */ protected function _afterSave(\Magento\Core\Model\AbstractModel $object) { @@ -106,7 +105,7 @@ protected function _afterSave(\Magento\Core\Model\AbstractModel $object) * Method to run after load * * @param \Magento\Core\Model\AbstractModel $object - * @return \Magento\Core\Model\Resource\Db\AbstractDb + * @return $this */ protected function _afterLoad(\Magento\Core\Model\AbstractModel $object) { @@ -125,8 +124,8 @@ protected function _afterLoad(\Magento\Core\Model\AbstractModel $object) * Get load select * * @param string $field - * @param value $value - * @param \Magento\Object $object + * @param mixed $value + * @param \Magento\Core\Model\AbstractModel $object * @return \Magento\DB\Select */ protected function _getLoadSelect($field, $value, $object) diff --git a/app/code/Magento/Checkout/Model/Resource/Agreement/Collection.php b/app/code/Magento/Checkout/Model/Resource/Agreement/Collection.php index 7cde4a1934601..7bd1eb5b938b3 100644 --- a/app/code/Magento/Checkout/Model/Resource/Agreement/Collection.php +++ b/app/code/Magento/Checkout/Model/Resource/Agreement/Collection.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Model\Resource\Agreement; /** * Resource Model for Agreement Collection @@ -32,10 +32,11 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Model\Resource\Agreement; - class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { + /** + * @var array + */ protected $_map = array('fields' => array( 'agreement_id' => 'main_table.agreement_id', )); @@ -50,6 +51,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl /** * Initialize resource * + * @return void */ protected function _construct() { @@ -60,7 +62,7 @@ protected function _construct() * Filter collection by specified store ids * * @param int|\Magento\Core\Model\Store $store - * @return \Magento\Checkout\Model\Resource\Agreement\Collection + * @return $this */ public function addStoreFilter($store) { @@ -98,7 +100,7 @@ public function addStoreFilter($store) * Make store filter using admin website or not * * @param bool $value - * @return \Magento\Checkout\Model\Resource\Agreement\Collection + * @return $this */ public function setIsStoreFilterWithAdmin($value) { diff --git a/app/code/Magento/Checkout/Model/Resource/Cart.php b/app/code/Magento/Checkout/Model/Resource/Cart.php index 5e7931a55d0a6..f8e5bae8fc67e 100644 --- a/app/code/Magento/Checkout/Model/Resource/Cart.php +++ b/app/code/Magento/Checkout/Model/Resource/Cart.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Checkout\Model\Resource; /** * Resource model for Checkout Cart @@ -32,13 +32,12 @@ * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Model\Resource; - class Cart extends \Magento\Core\Model\Resource\Db\AbstractDb { /** * Model initialization * + * @return void */ protected function _construct() { @@ -84,7 +83,7 @@ public function fetchItems($quoteId) * * @param \Magento\Catalog\Model\Resource\Product\Collection $collection * @param int $quoteId - * @return \Magento\Checkout\Model\Resource\Cart + * @return $this */ public function addExcludeProductFilter($collection, $quoteId) { diff --git a/app/code/Magento/Checkout/Model/Resource/Setup.php b/app/code/Magento/Checkout/Model/Resource/Setup.php index 0e42f6edc978a..2e355cddc306a 100644 --- a/app/code/Magento/Checkout/Model/Resource/Setup.php +++ b/app/code/Magento/Checkout/Model/Resource/Setup.php @@ -34,7 +34,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context - * @param $resourceName + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory * @param \Magento\Customer\Helper\Address $customerAddress diff --git a/app/code/Magento/Checkout/Model/Session.php b/app/code/Magento/Checkout/Model/Session.php index 49a15cc19da1e..198157fb3b3e4 100644 --- a/app/code/Magento/Checkout/Model/Session.php +++ b/app/code/Magento/Checkout/Model/Session.php @@ -26,6 +26,10 @@ namespace Magento\Checkout\Model; +use Magento\Sales\Model\Quote; +use Magento\Customer\Service\V1\Dto\Customer as CustomerDto; +use \Magento\Customer\Service\V1\Dto\CustomerBuilder; + class Session extends \Magento\Session\SessionManager { /** @@ -36,17 +40,24 @@ class Session extends \Magento\Session\SessionManager /** * Quote instance * - * @var \Magento\Sales\Model\Quote + * @var Quote */ protected $_quote; /** - * Customer instance + * Customer DTO * - * @var null|\Magento\Customer\Model\Customer + * @var null|CustomerDto */ protected $_customer; + /** + * Customer DTO builder + * + * @var CustomerBuilder + */ + protected $_customerBuilder; + /** * Whether load only active quote * @@ -104,6 +115,7 @@ class Session extends \Magento\Session\SessionManager * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param CustomerBuilder $customerBuilder * @param null $sessionName */ public function __construct( @@ -119,6 +131,7 @@ public function __construct( \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, + CustomerBuilder $customerBuilder, $sessionName = null ) { $this->_orderFactory = $orderFactory; @@ -127,6 +140,7 @@ public function __construct( $this->_remoteAddress = $remoteAddress; $this->_eventManager = $eventManager; $this->_storeManager = $storeManager; + $this->_customerBuilder = $customerBuilder; parent::__construct($request, $sidResolver, $sessionConfig, $saveHandler, $validator, $storage); $this->start($sessionName); } @@ -134,10 +148,31 @@ public function __construct( /** * Set customer instance * + * TODO: Remove after elimination of dependencies from \Magento\Persistent\Model\Observer + * * @param \Magento\Customer\Model\Customer|null $customer - * @return \Magento\Checkout\Model\Session + * @return $this + * @deprecated Use \Magento\Checkout\Model\Session::setCustomerData() instead */ public function setCustomer($customer) + { + if ($customer instanceof \Magento\Customer\Model\Customer) { + $this->_customerBuilder->populateWithArray($customer->getData()); + $this->_customerBuilder->setCustomerId($customer->getId()); + $this->_customer = $this->_customerBuilder->create(); + } else { + $this->_customer = $customer; + } + return $this; + } + + /** + * Set customer data. + * + * @param CustomerDto|null $customer + * @return \Magento\Checkout\Model\Session + */ + public function setCustomerData($customer) { $this->_customer = $customer; return $this; @@ -157,7 +192,7 @@ public function hasQuote() * Set quote to be loaded even if inactive * * @param bool $load - * @return \Magento\Checkout\Model\Session + * @return $this */ public function setLoadInactive($load = true) { @@ -168,14 +203,14 @@ public function setLoadInactive($load = true) /** * Get checkout quote instance by current session * - * @return \Magento\Sales\Model\Quote + * @return Quote */ public function getQuote() { $this->_eventManager->dispatch('custom_quote_process', array('checkout_session' => $this)); if ($this->_quote === null) { - /** @var $quote \Magento\Sales\Model\Quote */ + /** @var $quote Quote */ $quote = $this->_quoteFactory->create()->setStoreId($this->_storeManager->getStore()->getId()); if ($this->getQuoteId()) { if ($this->_loadInactive) { @@ -206,8 +241,10 @@ public function getQuote() if (!$this->getQuoteId()) { if ($this->_customerSession->isLoggedIn() || $this->_customer) { - $customer = ($this->_customer) ? $this->_customer : $this->_customerSession->getCustomer(); - $quote->loadByCustomer($customer); + $customerId = $this->_customer + ? $this->_customer->getCustomerId() + : $this->_customerSession->getCustomerId(); + $quote->loadByCustomer($customerId); $this->setQuoteId($quote->getId()); } else { $quote->setIsCheckoutCart(true); @@ -216,9 +253,10 @@ public function getQuote() } if ($this->getQuoteId()) { - if ($this->_customerSession->isLoggedIn() || $this->_customer) { - $customer = ($this->_customer) ? $this->_customer : $this->_customerSession->getCustomer(); - $quote->setCustomer($customer); + if ($this->_customer) { + $quote->setCustomerData($this->_customer); + } else if ($this->_customerSession->isLoggedIn()) { + $quote->setCustomerData($this->_customerSession->getCustomerData()); } } @@ -234,16 +272,26 @@ public function getQuote() return $this->_quote; } + /** + * @return string + */ protected function _getQuoteIdKey() { return 'quote_id_' . $this->_storeManager->getStore()->getWebsiteId(); } + /** + * @param int $quoteId + * @return void + */ public function setQuoteId($quoteId) { $this->setData($this->_getQuoteIdKey(), $quoteId); } + /** + * @return int + */ public function getQuoteId() { return $this->getData($this->_getQuoteIdKey()); @@ -252,7 +300,7 @@ public function getQuoteId() /** * Load data for customer quote and merge with current quote * - * @return \Magento\Checkout\Model\Session + * @return $this */ public function loadCustomerQuote() { @@ -282,7 +330,7 @@ public function loadCustomerQuote() } else { $this->getQuote()->getBillingAddress(); $this->getQuote()->getShippingAddress(); - $this->getQuote()->setCustomer($this->_customerSession->getCustomer()) + $this->getQuote()->setCustomerData($this->_customerSession->getCustomerData()) ->setTotalsCollectedFlag(false) ->collectTotals() ->save(); @@ -290,6 +338,12 @@ public function loadCustomerQuote() return $this; } + /** + * @param string $step + * @param array|string $data + * @param bool|string|null $value + * @return $this + */ public function setStepData($step, $data, $value=null) { $steps = $this->getSteps(); @@ -310,6 +364,11 @@ public function setStepData($step, $data, $value=null) return $this; } + /** + * @param string|null $step + * @param string|null $data + * @return array|string|bool + */ public function getStepData($step=null, $data=null) { $steps = $this->getSteps(); @@ -357,6 +416,8 @@ public function clearStorage() /** * Clear misc checkout parameters + * + * @return void */ public function clearHelperData() { @@ -368,12 +429,19 @@ public function clearHelperData() ; } + /** + * @return $this + */ public function resetCheckout() { $this->setCheckoutState(self::CHECKOUT_STATE_BEGIN); return $this; } + /** + * @param Quote $quote + * @return $this + */ public function replaceQuote($quote) { $this->_quote = $quote; diff --git a/app/code/Magento/Checkout/Model/Type/AbstractType.php b/app/code/Magento/Checkout/Model/Type/AbstractType.php index 7f73e08c8655d..e0fe6a3504965 100644 --- a/app/code/Magento/Checkout/Model/Type/AbstractType.php +++ b/app/code/Magento/Checkout/Model/Type/AbstractType.php @@ -23,16 +23,19 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Checkout\Model\Type; + +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Quote\Item; /** - * Cehckout type abstract class + * Checkout type abstract class * * @category Magento * @package Magento_Checkout * @author Magento Core Team */ -namespace Magento\Checkout\Model\Type; - abstract class AbstractType extends \Magento\Object { /** @@ -50,22 +53,30 @@ abstract class AbstractType extends \Magento\Object */ protected $_orderFactory; + /** + * @var CustomerAddressServiceInterface + */ + protected $_customerAddressService; + /** * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory + * @param CustomerAddressServiceInterface $customerAddressService * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, + CustomerAddressServiceInterface $customerAddressService, array $data = array() ) { - parent::__construct(); + parent::__construct($data); $this->_checkoutSession = $checkoutSession; $this->_customerSession = $customerSession; $this->_orderFactory = $orderFactory; + $this->_customerAddressService = $customerAddressService; } /** @@ -96,7 +107,7 @@ public function getQuote() /** * Retrieve quote items * - * @return array + * @return Item[] */ public function getQuoteItems() { @@ -104,7 +115,7 @@ public function getQuoteItems() } /** - * Retrieve customer session vodel + * Retrieve customer session model * * @return \Magento\Customer\Model\Session */ @@ -116,29 +127,28 @@ public function getCustomerSession() /** * Retrieve customer object * - * @return \Magento\Customer\Model\Customer + * @return \Magento\Customer\Service\V1\Dto\Customer */ public function getCustomer() { - return $this->_customerSession->getCustomer(); + return $this->_customerSession->getCustomerData(); } /** * Retrieve customer default shipping address * - * @return \Magento\Customer\Model\Address || false + * @return \Magento\Customer\Service\V1\Dto\Address|null */ public function getCustomerDefaultShippingAddress() { $address = $this->getData('customer_default_shipping_address'); if (is_null($address)) { - $address = $this->getCustomer()->getDefaultShippingAddress(); + $customerId = $this->getCustomer()->getCustomerId(); + $address = $this->_customerAddressService->getDefaultShippingAddress($customerId); if (!$address) { - foreach ($this->getCustomer()->getAddresses() as $address) { - if($address){ - break; - } - } + /** Default shipping address is not available, try to find any customer address */ + $allAddresses = $this->_customerAddressService->getAddresses($customerId); + $address = count($allAddresses) ? reset($allAddresses) : null; } $this->setData('customer_default_shipping_address', $address); } @@ -148,36 +158,21 @@ public function getCustomerDefaultShippingAddress() /** * Retrieve customer default billing address * - * @return \Magento\Customer\Model\Address || false + * @return \Magento\Customer\Service\V1\Dto\Address|null */ public function getCustomerDefaultBillingAddress() { $address = $this->getData('customer_default_billing_address'); if (is_null($address)) { - $address = $this->getCustomer()->getDefaultBillingAddress(); + $customerId = $this->getCustomer()->getCustomerId(); + $address = $this->_customerAddressService->getDefaultBillingAddress($customerId); if (!$address) { - foreach ($this->getCustomer()->getAddresses() as $address) { - if($address){ - break; - } - } + /** Default billing address is not available, try to find any customer address */ + $allAddresses = $this->_customerAddressService->getAddresses($customerId); + $address = count($allAddresses) ? reset($allAddresses) : null; } $this->setData('customer_default_billing_address', $address); } return $address; } - - protected function _createOrderFromAddress($address) - { - $order = $this->_orderFactory->create() - ->createFromQuoteAddress($address) - ->setCustomerId($this->getCustomer()->getId()) - ->setGlobalCurrencyCode('USD') - ->setBaseCurrencyCode('USD') - ->setStoreCurrencyCode('USD') - ->setOrderCurrencyCode('USD') - ->setStoreToBaseRate(1) - ->setStoreToOrderRate(1); - return $order; - } } diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 492ba824d31e3..95e9a77dd32f5 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -29,6 +29,18 @@ */ namespace Magento\Checkout\Model\Type; +use Magento\Customer\Service\V1\Dto\CustomerBuilder; +use Magento\Customer\Service\V1\Dto\AddressBuilder; +use Magento\Customer\Service\V1\Dto\Address as AddressDto; +use Magento\Customer\Service\V1\CustomerGroupServiceInterface; +use Magento\Customer\Model\Metadata\Form; +use Magento\Customer\Service\V1\Dto\Response\CreateCustomerAccountResponse; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface; +use Magento\Exception\NoSuchEntityException; +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; +use Magento\Customer\Service\V1\CustomerServiceInterface; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadata; + class Onepage { /** @@ -38,13 +50,6 @@ class Onepage const METHOD_REGISTER = 'register'; const METHOD_CUSTOMER = 'customer'; - /** - * Error message of "customer already exists" - * - * @var string - */ - protected $_customerEmailExistsMessage = ''; - /** * @var \Magento\Customer\Model\Session */ @@ -129,6 +134,29 @@ class Onepage */ protected $messageManager; + /** + * @var CustomerAccountServiceInterface + */ + protected $_accountService; + + /** @var \Magento\Customer\Model\Metadata\FormFactory */ + protected $_formFactory; + + /** @var CustomerBuilder */ + protected $_customerBuilder; + + /** @var AddressBuilder */ + protected $_addressBuilder; + + /** @var \Magento\Math\Random */ + protected $mathRandom; + + /** @var CustomerServiceInterface */ + protected $_customerService; + + /** @var CustomerAddressServiceInterface */ + protected $_customerAddressService; + /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Checkout\Helper\Data $helper @@ -145,6 +173,14 @@ class Onepage * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Message\ManagerInterface $messageManager + * @param CustomerAccountServiceInterface $accountService + * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory + * @param CustomerBuilder $customerBuilder + * @param AddressBuilder $addressBuilder + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Encryption\EncryptorInterface $encryptor + * @param CustomerServiceInterface $customerService + * @param CustomerAddressServiceInterface $customerAddressService */ public function __construct( \Magento\Event\ManagerInterface $eventManager, @@ -161,12 +197,19 @@ public function __construct( \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Object\Copy $objectCopyService, - \Magento\Message\ManagerInterface $messageManager + \Magento\Message\ManagerInterface $messageManager, + CustomerAccountServiceInterface $accountService, + \Magento\Customer\Model\Metadata\FormFactory $formFactory, + CustomerBuilder $customerBuilder, + AddressBuilder $addressBuilder, + \Magento\Math\Random $mathRandom, + \Magento\Encryption\EncryptorInterface $encryptor, + CustomerServiceInterface $customerService, + CustomerAddressServiceInterface $customerAddressService ) { $this->_eventManager = $eventManager; $this->_customerData = $customerData; $this->_helper = $helper; - $this->_customerEmailExistsMessage = __('There is already a registered customer using this email address. Please log in using this email address or enter a different email address to register your account.'); $this->_checkoutSession = $checkoutSession; $this->_customerSession = $customerSession; $this->_logger = $logger; @@ -179,6 +222,14 @@ public function __construct( $this->_orderFactory = $orderFactory; $this->_objectCopyService = $objectCopyService; $this->messageManager = $messageManager; + $this->_accountService = $accountService; + $this->_formFactory = $formFactory; + $this->_customerBuilder = $customerBuilder; + $this->_addressBuilder = $addressBuilder; + $this->mathRandom = $mathRandom; + $this->_encryptor = $encryptor; + $this->_customerService = $customerService; + $this->_customerAddressService = $customerAddressService; } /** @@ -208,7 +259,7 @@ public function getQuote() * Declare checkout quote instance * * @param \Magento\Sales\Model\Quote $quote - * @return \Magento\Checkout\Model\Type\Onepage + * @return $this */ public function setQuote(\Magento\Sales\Model\Quote $quote) { @@ -229,7 +280,7 @@ public function getCustomerSession() /** * Initialize quote state to be valid for one page checkout * - * @return \Magento\Checkout\Model\Type\Onepage + * @return $this */ public function initCheckout() { @@ -253,7 +304,7 @@ public function initCheckout() * want to load the correct customer information by assigning to address * instead of just loading from sales/quote_address */ - $customer = $customerSession->getCustomer(); + $customer = $customerSession->getCustomerData(); if ($customer) { $quote->assignCustomer($customer); } @@ -297,29 +348,13 @@ public function saveCheckoutMethod($method) return array(); } - /** - * Get customer address by identifier - * - * @param int $addressId - * @return \Magento\Customer\Model\Address - */ - public function getAddress($addressId) - { - $address = $this->_customrAddrFactory->create()->load((int)$addressId); - $address->explodeStreetAddress(); - if ($address->getRegionId()) { - $address->setRegion($address->getRegionId()); - } - return $address; - } - /** * Save billing address information to quote * This method is called by One Page Checkout JS (AJAX) while saving the billing information. * * @param array $data * @param int $customerAddressId - * @return \Magento\Checkout\Model\Type\Onepage + * @return array */ public function saveBilling($data, $customerAddressId) { @@ -328,37 +363,43 @@ public function saveBilling($data, $customerAddressId) } $address = $this->getQuote()->getBillingAddress(); - /* @var $addressForm \Magento\Customer\Model\Form */ - $addressForm = $this->_customerFormFactory->create(); - $addressForm->setFormCode('customer_address_edit') - ->setEntityType('customer_address') - ->setIsAjaxRequest($this->_request->isAjax()); + $addressForm = $this->_formFactory->create( + \Magento\Customer\Service\V1\CustomerMetadataServiceInterface::ENTITY_TYPE_ADDRESS, + 'customer_address_edit', + [], + Form::IGNORE_INVISIBLE, + [], + $this->_request->isAjax() + ); if (!empty($customerAddressId)) { - $customerAddress = $this->_customrAddrFactory->create()->load($customerAddressId); - if ($customerAddress->getId()) { + try { + $customerAddress = $this->_customerAddressService->getAddressById($customerAddressId); + } catch (Exception $e) { + /** Address does not exist */ + } + if (isset($customerAddress)) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, 'message' => __('The customer address is not valid.') ); } - $address->importCustomerAddress($customerAddress)->setSaveInAddressBook(0); - $addressForm->setEntity($address); - $addressErrors = $addressForm->validateData($address->getData()); + $address->importCustomerAddressData($customerAddress)->setSaveInAddressBook(0); + $addressErrors = $addressForm->validateData($address->getData()); if ($addressErrors !== true) { return array('error' => 1, 'message' => $addressErrors); } } } else { - $addressForm->setEntity($address); // emulate request object - $addressData = $addressForm->extractData($addressForm->prepareRequest($data)); - $addressErrors = $addressForm->validateData($addressData); + $addressData = $addressForm->extractData($addressForm->prepareRequest($data)); + $addressErrors = $addressForm->validateData($addressData); if ($addressErrors !== true) { return array('error' => 1, 'message' => array_values($addressErrors)); } - $addressForm->compactData($addressData); + $addressData = $addressForm->compactData($addressData); + $address->addData($addressData); //unset billing address attributes which were not shown in form foreach ($addressForm->getAttributes() as $attribute) { if (!isset($data[$attribute->getAttributeCode()])) { @@ -368,6 +409,7 @@ public function saveBilling($data, $customerAddressId) $address->setCustomerAddressId(null); // Additional form data, not fetched by extractData (as it fetches only attributes) $address->setSaveInAddressBook(empty($data['save_in_address_book']) ? 0 : 1); + $this->getQuote()->setBillingAddress($address); } // validate billing address @@ -377,17 +419,23 @@ public function saveBilling($data, $customerAddressId) if (true !== ($result = $this->_validateCustomerData($data))) { return $result; + } else { + /** Even though _validateCustomerData should not modify data, it does */ + $address = $this->getQuote()->getBillingAddress(); } if (!$this->getQuote()->getCustomerId() && self::METHOD_REGISTER == $this->getQuote()->getCheckoutMethod()) { if ($this->_customerEmailExists($address->getEmail(), $this->_storeManager->getWebsite()->getId())) { - return array('error' => 1, 'message' => $this->_customerEmailExistsMessage); + return array( + 'error' => 1, + 'message' => __('There is already a registered customer using this email address. Please log in using this email address or enter a different email address to register your account.') + ); } } if (!$this->getQuote()->isVirtual()) { /** - * Billing address using otions + * Billing address using options */ $usingCase = isset($data['use_for_shipping']) ? (int)$data['use_for_shipping'] : 0; @@ -441,27 +489,30 @@ public function saveBilling($data, $customerAddressId) /** * Validate customer data and set some its data for further usage in quote + * * Will return either true or array with error messages * * @param array $data - * @return true|array + * @return bool|array */ protected function _validateCustomerData(array $data) { - /** @var $customerForm \Magento\Customer\Model\Form */ - $customerForm = $this->_customerFormFactory->create(); - $customerForm->setFormCode('checkout_register') - ->setIsAjaxRequest($this->_request->isAjax()); - $quote = $this->getQuote(); - if ($quote->getCustomerId()) { - $customer = $quote->getCustomer(); - $customerForm->setEntity($customer); - $customerData = $quote->getCustomer()->getData(); - } else { - /* @var $customer \Magento\Customer\Model\Customer */ - $customer = $this->_customerFactory->create(); - $customerForm->setEntity($customer); + $isCustomerNew = !$quote->getCustomerId(); + $customer = $quote->getCustomerData(); + $customerData = $customer->__toArray(); + + /** @var Form $customerForm */ + $customerForm = $this->_formFactory->create( + CustomerMetadata::ENTITY_TYPE_CUSTOMER, + 'checkout_register', + $customerData, + Form::IGNORE_INVISIBLE, + [], + $this->_request->isAjax() + ); + + if ($isCustomerNew) { $customerRequest = $customerForm->prepareRequest($data); $customerData = $customerForm->extractData($customerRequest); } @@ -474,27 +525,33 @@ protected function _validateCustomerData(array $data) ); } - if ($quote->getCustomerId()) { + if (!$isCustomerNew) { return true; } - $customerForm->compactData($customerData); + $this->_customerBuilder->populateWithArray($customerData); + $customer = $this->_customerBuilder->create(); if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) { - // set customer password - $customer->setPassword($customerRequest->getParam('customer_password')); - $customer->setConfirmation($customerRequest->getParam('confirm_password')); + // We always have $customerRequest here, otherwise we would have been kicked off the function several + // lines above + if ($customerRequest->getParam('customer_password') != $customerRequest->getParam('confirm_password')) { + return array( + 'error' => -1, + 'message' => __('Password and password confirmation are not equal.') + ); + } } else { - // spoof customer password for guest - $password = $customer->generatePassword(); - $customer->setPassword($password); - $customer->setConfirmation($password); // set NOT LOGGED IN group id explicitly, // otherwise copyFieldsetToTarget('customer_account', 'to_quote') will fill it with default group id value - $customer->setGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); + $this->_customerBuilder->populate($customer); + $this->_customerBuilder->setGroupId(CustomerGroupServiceInterface::NOT_LOGGED_IN_ID); + $customer = $this->_customerBuilder->create(); } - $result = $customer->validate(); + //validate customer + $attributes = $customerForm->getAllowedAttributes(); + $result = $this->_accountService->validateCustomerData($customer, $attributes); if (true !== $result && is_array($result)) { return array( 'error' => -1, @@ -502,16 +559,11 @@ protected function _validateCustomerData(array $data) ); } - if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) { - // save customer encrypted password in quote - $quote->setPasswordHash($customer->encryptPassword($customer->getPassword())); - } - // copy customer/guest email to address $quote->getBillingAddress()->setEmail($customer->getEmail()); // copy customer data to quote - $this->_objectCopyService->copyFieldsetToTarget('customer_account', 'to_quote', $customer, $quote); + $this->_objectCopyService->copyFieldsetToTarget('customer_account', 'to_quote', $customer->__toArray(), $quote); return true; } @@ -521,7 +573,7 @@ protected function _validateCustomerData(array $data) * * @param array $data * @param int $customerAddressId - * @return \Magento\Checkout\Model\Type\Onepage + * @return array */ public function saveShipping($data, $customerAddressId) { @@ -530,41 +582,50 @@ public function saveShipping($data, $customerAddressId) } $address = $this->getQuote()->getShippingAddress(); - /* @var $addressForm \Magento\Customer\Model\Form */ - $addressForm = $this->_customerFormFactory->create(); - $addressForm->setFormCode('customer_address_edit') - ->setEntityType('customer_address') - ->setIsAjaxRequest($this->_request->isAjax()); + $addressForm = $this->_formFactory->create( + 'customer_address', + 'customer_address_edit', + [], + Form::IGNORE_INVISIBLE, + [], + $this->_request->isAjax() + ); if (!empty($customerAddressId)) { - $customerAddress = $this->_customrAddrFactory->create()->load($customerAddressId); - if ($customerAddress->getId()) { - if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { - return array('error' => 1, - 'message' => __('The customer address is not valid.') - ); - } + $addressData = null; + try { + $addressData = $this->_customerAddressService->getAddressById($customerAddressId); + } catch (NoSuchEntityException $e) { + // do nothing if customer is not found by id + } - $address->importCustomerAddress($customerAddress)->setSaveInAddressBook(0); - $addressForm->setEntity($address); - $addressErrors = $addressForm->validateData($address->getData()); - if ($addressErrors !== true) { - return array('error' => 1, 'message' => $addressErrors); - } + if ($addressData->getCustomerId() != $this->getQuote()->getCustomerId()) { + return array('error' => 1, + 'message' => __('The customer address is not valid.') + ); } + + $address->importCustomerAddressData($addressData)->setSaveInAddressBook(0); + $addressErrors = $addressForm->validateData($address->getData()); + if ($addressErrors !== true) { + return array('error' => 1, 'message' => $addressErrors); + } + } else { - $addressForm->setEntity($address); // emulate request object $addressData = $addressForm->extractData($addressForm->prepareRequest($data)); $addressErrors = $addressForm->validateData($addressData); if ($addressErrors !== true) { return array('error' => 1, 'message' => $addressErrors); } - $addressForm->compactData($addressData); + $compactedData = $addressForm->compactData($addressData); // unset shipping address attributes which were not shown in form foreach ($addressForm->getAttributes() as $attribute) { - if (!isset($data[$attribute->getAttributeCode()])) { - $address->setData($attribute->getAttributeCode(), NULL); + $attributeCode = $attribute->getAttributeCode(); + if (!isset($data[$attributeCode])) { + $address->setData($attributeCode, NULL); + } else { + $address->setDataUsingMethod($attributeCode, $compactedData[$attributeCode]); } } @@ -658,6 +719,7 @@ public function savePayment($data) /** * Validate quote state to be integrated with one page checkout process * + * @return void * @throws \Magento\Core\Exception */ protected function validate() @@ -678,7 +740,7 @@ protected function validate() /** * Prepare quote for guest checkout order submit * - * @return \Magento\Checkout\Model\Type\Onepage + * @return $this */ protected function _prepareGuestQuote() { @@ -686,14 +748,14 @@ protected function _prepareGuestQuote() $quote->setCustomerId(null) ->setCustomerEmail($quote->getBillingAddress()->getEmail()) ->setCustomerIsGuest(true) - ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); + ->setCustomerGroupId(\Magento\Customer\Service\V1\CustomerGroupServiceInterface::NOT_LOGGED_IN_ID); return $this; } /** * Prepare quote for customer registration and customer order submit * - * @return \Magento\Checkout\Model\Type\Onepage + * @return void */ protected function _prepareNewCustomerQuote() { @@ -701,38 +763,57 @@ protected function _prepareNewCustomerQuote() $billing = $quote->getBillingAddress(); $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress(); - /** @var $customer \Magento\Customer\Model\Customer */ - $customer = $quote->getCustomer(); + $customerData = $quote->getCustomerData(); // Need to set proper attribute id or future updates will cause data loss. - $customer->setData('attribute_set_id', 1); - /** @var $customerBilling \Magento\Customer\Model\Address */ - $customerBilling = $billing->exportCustomerAddress(); - $customer->addAddress($customerBilling); - $billing->setCustomerAddress($customerBilling); - $customerBilling->setIsDefaultBilling(true); - if ($shipping && !$shipping->getSameAsBilling()) { - $customerShipping = $shipping->exportCustomerAddress(); - $customer->addAddress($customerShipping); - $shipping->setCustomerAddress($customerShipping); - $customerShipping->setIsDefaultShipping(true); - } elseif ($shipping && $shipping->getSameAsBilling()) { - $shipping->setCustomerAddress($billing->getCustomerAddress()); - $customerBilling->setIsDefaultShipping(true); + $customerData = $this->_customerBuilder->mergeDtoWithArray( + $customerData, + [CustomerMetadata::ATTRIBUTE_SET_ID_CUSTOMER => 1] + ); + + $customerBillingData = $billing->exportCustomerAddressData(); + $customerBillingData = $this->_addressBuilder->mergeDtoWithArray( + $customerBillingData, + [AddressDto::KEY_DEFAULT_BILLING => true] + ); + + if ($shipping) { + if( !$shipping->getSameAsBilling()) { + $customerShippingData = $shipping->exportCustomerAddressData(); + $customerShippingData = $this->_addressBuilder->populate($customerShippingData) + ->setDefaultShipping(true)->create(); + $shipping->setCustomerAddress($customerShippingData); + // Add shipping address to quote since customer DTO does not hold address information + $quote->addCustomerAddressData($customerShippingData); + } else { + $shipping->setCustomerAddressData($customerBillingData); + $customerBillingData = $this->_addressBuilder->populate($customerBillingData)->setDefaultShipping(true) + ->create(); + } } else { - $customerBilling->setIsDefaultShipping(true); + $customerBillingData = $this->_addressBuilder->populate($customerBillingData)->setDefaultShipping(true) + ->create(); } + $billing->setCustomerAddressData($customerBillingData); - $this->_objectCopyService->copyFieldsetToTarget('checkout_onepage_quote', 'to_customer', $quote, $customer); - $customer->setPassword($customer->decryptPassword($quote->getPasswordHash())); - $customer->setPasswordHash($customer->hashPassword($customer->getPassword())); - $quote->setCustomer($customer) - ->setCustomerId(true); + $dataArray = $this->_objectCopyService->getDataFromFieldset( + 'checkout_onepage_quote', + 'to_customer', + $quote + ); + $customerData = $this->_customerBuilder->mergeDtoWithArray( + $customerData, + $dataArray + ); + $quote->setCustomerData($customerData) + ->setCustomerId(true); // TODO : Eventually need to remove this legacy hack + // Add billing address to quote since customer DTO does not hold address information + $quote->addCustomerAddressData($customerBillingData); } /** * Prepare quote for customer order submit * - * @return \Magento\Checkout\Model\Type\Onepage + * @return void */ protected function _prepareCustomerQuote() { @@ -740,47 +821,52 @@ protected function _prepareCustomerQuote() $billing = $quote->getBillingAddress(); $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress(); - $customer = $this->getCustomerSession()->getCustomer(); + $customer = $this->_customerService->getCustomer($this->getCustomerSession()->getCustomerId()); if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) { - $customerBilling = $billing->exportCustomerAddress(); - $customer->addAddress($customerBilling); - $billing->setCustomerAddress($customerBilling); + $billingAddress = $billing->exportCustomerAddressData(); + $billing->setCustomerAddressData($billingAddress); } if ($shipping && !$shipping->getSameAsBilling() && (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())) { - $customerShipping = $shipping->exportCustomerAddress(); - $customer->addAddress($customerShipping); - $shipping->setCustomerAddress($customerShipping); + $shippingAddress = $shipping->exportCustomerAddressData(); + $shipping->setCustomerAddressData($shippingAddress); } - if (isset($customerBilling) && !$customer->getDefaultBilling()) { - $customerBilling->setIsDefaultBilling(true); + if (isset($billingAddress)) { + if (!$customer->getDefaultBilling() || !$customer->getDefaultShipping()) { + $billingAddress = $this->_addressBuilder + ->populate($billingAddress) + ->setDefaultBilling(!$customer->getDefaultBilling()) + ->setDefaultShipping(!$customer->getDefaultShipping()) + ->create(); + } + + $quote->addCustomerAddressData($billingAddress); } - if ($shipping && isset($customerShipping) && !$customer->getDefaultShipping()) { - $customerShipping->setIsDefaultShipping(true); - } else if (isset($customerBilling) && !$customer->getDefaultShipping()) { - $customerBilling->setIsDefaultShipping(true); + + if ($shipping && isset($shippingAddress) && !$customer->getDefaultShipping()) { + $shippingAddress = $this->_addressBuilder + ->mergeDtoWithArray($shippingAddress, [AddressDto::KEY_DEFAULT_SHIPPING => true]); + $quote->addCustomerAddressData($shippingAddress); } - $quote->setCustomer($customer); } /** * Involve new customer to system * - * @return \Magento\Checkout\Model\Type\Onepage + * @param CreateCustomerAccountResponse $createCustomerResponse + * @return $this */ - protected function _involveNewCustomer() + protected function _involveNewCustomer(CreateCustomerAccountResponse $createCustomerResponse) { - $customer = $this->getQuote()->getCustomer(); - if ($customer->isConfirmationRequired()) { - $customer->sendNewAccountEmail('confirmation', '', $this->getQuote()->getStoreId()); + $customer = $this->getQuote()->getCustomerData(); + if ($createCustomerResponse->getStatus() == CustomerAccountServiceInterface::ACCOUNT_CONFIRMATION) { $url = $this->_customerData->getEmailConfirmationUrl($customer->getEmail()); $this->messageManager->addSuccess( __('Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.', $url) ); } else { - $customer->sendNewAccountEmail('registered', '', $this->getQuote()->getStoreId()); - $this->getCustomerSession()->loginById($customer->getId()); + $this->getCustomerSession()->loginById($customer->getCustomerId()); } return $this; } @@ -788,7 +874,7 @@ protected function _involveNewCustomer() /** * Create order based on checkout type. Create customer if necessary. * - * @return \Magento\Checkout\Model\Type\Onepage + * @return $this */ public function saveOrder() { @@ -807,12 +893,13 @@ public function saveOrder() break; } - $service = $this->_serviceQuoteFactory->create(array('quote' => $this->getQuote())); - $service->submitAll(); + /** @var \Magento\Sales\Model\Service\Quote $quoteService */ + $quoteService = $this->_serviceQuoteFactory->create(['quote' => $this->getQuote()]); + $quoteService->submitAllWithDto(); if ($isNewCustomer) { try { - $this->_involveNewCustomer(); + $this->_involveNewCustomer($quoteService->getCreateCustomerResponse()); } catch (\Exception $e) { $this->_logger->logException($e); } @@ -822,10 +909,12 @@ public function saveOrder() ->setLastSuccessQuoteId($this->getQuote()->getId()) ->clearHelperData(); - $order = $service->getOrder(); + $order = $quoteService->getOrder(); if ($order) { - $this->_eventManager->dispatch('checkout_type_onepage_save_order_after', - array('order'=>$order, 'quote'=>$this->getQuote())); + $this->_eventManager->dispatch( + 'checkout_type_onepage_save_order_after', + ['order' => $order, 'quote' => $this->getQuote()] + ); /** * a flag to set that there will be redirect to third party after confirmation @@ -849,21 +938,7 @@ public function saveOrder() ->setLastRealOrderId($order->getIncrementId()); } - // add recurring profiles information to the session - $profiles = $service->getRecurringPaymentProfiles(); - if ($profiles) { - $ids = array(); - foreach ($profiles as $profile) { - $ids[] = $profile->getId(); - } - $this->_checkoutSession->setLastRecurringProfileIds($ids); - // TODO: send recurring profile emails - } - - $this->_eventManager->dispatch( - 'checkout_submit_all_after', - array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles) - ); + $this->_eventManager->dispatch('checkout_submit_all_after', ['order' => $order, 'quote' => $this->getQuote()]); return $this; } @@ -877,15 +952,13 @@ public function saveOrder() */ protected function _customerEmailExists($email, $websiteId = null) { - $customer = $this->_customerFactory->create(); - if ($websiteId) { - $customer->setWebsiteId($websiteId); - } - $customer->loadByEmail($email); - if ($customer->getId()) { - return $customer; + try { + $this->_customerService->getCustomerByEmail($email, $websiteId); + return true; + } catch (\Exception $e) { + /** Customer email does not exist */ + return false; } - return false; } /** diff --git a/app/code/Magento/Checkout/etc/module.xml b/app/code/Magento/Checkout/etc/module.xml index 939013e0dff46..094a507187529 100755 --- a/app/code/Magento/Checkout/etc/module.xml +++ b/app/code/Magento/Checkout/etc/module.xml @@ -45,7 +45,6 @@ - diff --git a/app/code/Magento/Checkout/i18n/de_DE.csv b/app/code/Magento/Checkout/i18n/de_DE.csv index c373fb13ceadc..d0463af922697 100644 --- a/app/code/Magento/Checkout/i18n/de_DE.csv +++ b/app/code/Magento/Checkout/i18n/de_DE.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","Checkout mit mutiplen Adressen" "City","Stadt" "Clear Shopping Cart","Einkaufswagen leeren" -"Click here to print a copy of your order confirmation.","Klicken sie hier um ihre Bestellbestätigung auszudrucken ." +"Click here to print a copy of your order confirmation.","Klicken sie hier um ihre Bestellbestätigung auszudrucken ." "Click here to continue shopping.","Hier klicken, um das Einkaufen fortzusetzen." "Close","Schließen" "Company","Firma" diff --git a/app/code/Magento/Checkout/i18n/en_US.csv b/app/code/Magento/Checkout/i18n/en_US.csv index 4eb60d26e01fe..1ffe458757a86 100644 --- a/app/code/Magento/Checkout/i18n/en_US.csv +++ b/app/code/Magento/Checkout/i18n/en_US.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","Checkout with Multiple Addresses" "City","City" "Clear Shopping Cart","Clear Shopping Cart" -"Click here to print a copy of your order confirmation.","Click here to print a copy of your order confirmation." +"Click here to print a copy of your order confirmation.","Click here to print a copy of your order confirmation." "Click here to continue shopping.","Click here to continue shopping." "Close","Close" "Company","Company" diff --git a/app/code/Magento/Checkout/i18n/es_ES.csv b/app/code/Magento/Checkout/i18n/es_ES.csv index 1f9805d506fd3..03cc4758343cf 100644 --- a/app/code/Magento/Checkout/i18n/es_ES.csv +++ b/app/code/Magento/Checkout/i18n/es_ES.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","Pedido con varias direcciones" "City","Ciudad" "Clear Shopping Cart","Vaciar carro de la compra" -"Click here to print a copy of your order confirmation.","Pulse aquí para imprimir una copia de la confirmación del pedido." +"Click here to print a copy of your order confirmation.","Pulse aquí para imprimir una copia de la confirmación del pedido." "Click here to continue shopping.","Click aquí para continuar comprando." "Close","Cerrar" "Company","Compañía" diff --git a/app/code/Magento/Checkout/i18n/fr_FR.csv b/app/code/Magento/Checkout/i18n/fr_FR.csv index 706a26d1eae1a..8556b3131432b 100644 --- a/app/code/Magento/Checkout/i18n/fr_FR.csv +++ b/app/code/Magento/Checkout/i18n/fr_FR.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","Paiement avec des adresses multiples" "City","Ville" "Clear Shopping Cart","Vider le panier" -"Click here to print a copy of your order confirmation.","Cliquez ici pour imprimer une copie de votre confirmation de commande." +"Click here to print a copy of your order confirmation.","Cliquez ici pour imprimer une copie de votre confirmation de commande." "Click here to continue shopping.","Cliquez ici pour continuer vos achats" "Close","Fermer" "Company","Société" diff --git a/app/code/Magento/Checkout/i18n/nl_NL.csv b/app/code/Magento/Checkout/i18n/nl_NL.csv index 92867e48034f4..5000657cbb498 100644 --- a/app/code/Magento/Checkout/i18n/nl_NL.csv +++ b/app/code/Magento/Checkout/i18n/nl_NL.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","Met meerdere adressen uitchecken" "City","Stad" "Clear Shopping Cart","Maak winkelwagen leeg" -"Click here to print a copy of your order confirmation.","Klik hier om een kopie van uw bestellingsbevestiging te printen." +"Click here to print a copy of your order confirmation.","Klik hier om een kopie van uw bestellingsbevestiging te printen." "Click here to continue shopping.","Klik here om door te gaan met winkelen." "Close","Sluiten" "Company","Bedrijf" diff --git a/app/code/Magento/Checkout/i18n/pt_BR.csv b/app/code/Magento/Checkout/i18n/pt_BR.csv index 08fda0620dbdd..b772581da66ae 100644 --- a/app/code/Magento/Checkout/i18n/pt_BR.csv +++ b/app/code/Magento/Checkout/i18n/pt_BR.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","Encerrar Compra com Vários Endereços" "City","Cidade" "Clear Shopping Cart","Limpar Carrinho de Compras" -"Click here to print a copy of your order confirmation.","Clique aqui para imprimir uma cópia da confirmação de seu pedido." +"Click here to print a copy of your order confirmation.","Clique aqui para imprimir uma cópia da confirmação de seu pedido." "Click here to continue shopping.","Clique aqui para continuar as compras." "Close","Fechar" "Company","Companhia" diff --git a/app/code/Magento/Checkout/i18n/zh_CN.csv b/app/code/Magento/Checkout/i18n/zh_CN.csv index 66cecb1b948c4..8a7e461efe855 100644 --- a/app/code/Magento/Checkout/i18n/zh_CN.csv +++ b/app/code/Magento/Checkout/i18n/zh_CN.csv @@ -59,7 +59,7 @@ "Checkout with Multiple Addresses","按多个地址支付" "City","城市" "Clear Shopping Cart","清空购物车" -"Click here to print a copy of your order confirmation.","单击这里来打印您订单确认信息的拷贝。" +"Click here to print a copy of your order confirmation.","单击这里来打印您订单确认信息的拷贝。" "Click here to continue shopping.","单击这里来继续购物。" "Close","关闭" "Company","公司" diff --git a/app/code/Magento/Checkout/view/frontend/onepage.phtml b/app/code/Magento/Checkout/view/frontend/onepage.phtml index 07933cab4a01d..de7cbe0c5d8c7 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage.phtml @@ -22,11 +22,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -?> -getLayout()->getBlock('checkout.onepage.payment'); -$_registerParam = $this->getRequest()->getParam('register'); ?>
    @@ -57,40 +55,13 @@ $_registerParam = $this->getRequest()->getParam('register'); .accordion({ activeSelector: '#opc-getActiveStep() ?>' }) - .opcheckout({ - quoteBaseGrandTotal: getQuoteBaseGrandTotal() ?>, - hasRecurringItems: hasRecurringItems() ? 'true' : 'false' ?>, - progressUrl: 'getUrl('checkout/onepage/progress') ?>', - reviewUrl: 'getUrl('checkout/onepage/review') ?>', - failureUrl: 'getUrl('checkout/cart') ?>', - getAddressUrl: 'getUrl('checkout/onepage/getAddress') ?>address/', + .opcheckout($.extend({ checkoutAgreements: '#checkout-agreements', checkoutProgressContainer: '#checkout-progress-wrapper', - checkout: { - suggestRegistration: , - saveUrl: 'getUrl('checkout/onepage/saveMethod') ?>' - }, - billing: { - saveUrl: 'getUrl('checkout/onepage/saveBilling') ?>' - }, - shipping: { - saveUrl: 'getUrl('checkout/onepage/saveShipping') ?>' - }, - shippingMethod: { - saveUrl: "getUrl('checkout/onepage/saveShippingMethod') ?>" - }, - payment: { - getChildBlock('methods')->getSelectedMethodCode()): ?> - defaultPaymentMethod: "getChildBlock('methods')->getSelectedMethodCode() ?>", - - saveUrl: 'getUrl('checkout/onepage/savePayment') ?>' - }, - review: { - saveUrl: 'getUrl('checkout/onepage/saveOrder') ?>', - successUrl: 'getUrl('checkout/onepage/success') ?>' + methodDescription: '.items' }, - methodDescription : '.items' - }); + helper('Magento\Core\Helper\Data')->jsonEncode($_paymentBlock->getOptions()); ?> + )); }); })(jQuery); diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block.php b/app/code/Magento/Cms/Block/Adminhtml/Block.php index f94e46e9b59b6..fb6ff699ace1f 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block.php @@ -27,14 +27,9 @@ /** * Adminhtml cms blocks content block - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Block extends \Magento\Backend\Block\Widget\Grid\Container { - /** * @return void */ @@ -46,5 +41,4 @@ protected function _construct() $this->_addButtonLabel = __('Add New Block'); parent::_construct(); } - } diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php index 7bdf790be55c6..64462b19af791 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php @@ -27,28 +27,24 @@ /** * CMS block edit form container - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Edit extends \Magento\Backend\Block\Widget\Form\Container { /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php index a4d9645cbdd7d..f44ca95530215 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php @@ -27,10 +27,6 @@ /** * Adminhtml cms block edit form - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Form extends \Magento\Backend\Block\Widget\Form\Generic { @@ -46,7 +42,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param \Magento\Core\Model\System\Store $systemStore @@ -54,7 +50,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, \Magento\Core\Model\System\Store $systemStore, diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php index 1dafdf94b5b2f..9686c95b1a6ae 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php @@ -27,10 +27,6 @@ /** * CMS block chooser for Wysiwyg CMS widget - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Chooser extends \Magento\Backend\Block\Widget\Grid\Extended { diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page.php b/app/code/Magento/Cms/Block/Adminhtml/Page.php index 2728db9861330..7a30d901b066b 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page.php @@ -27,10 +27,6 @@ /** * Adminhtml cms pages content block - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Page extends \Magento\Backend\Block\Widget\Grid\Container { @@ -65,5 +61,4 @@ protected function _isAllowedAction($resourceId) { return $this->_authorization->isAllowed($resourceId); } - } diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php index a82c876df2715..76754cb5ae55d 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php @@ -37,18 +37,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php index c356cf8024ce1..e2a05ee664779 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php @@ -39,14 +39,14 @@ class Content /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, array $data = array() diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php index 7ee655dd3a6fe..31b6b2926b580 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php @@ -44,7 +44,7 @@ class Design /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout * @param \Magento\View\Design\Theme\LabelFactory $labelFactory @@ -52,7 +52,7 @@ class Design */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Theme\Model\Layout\Source\Layout $pageLayout, \Magento\View\Design\Theme\LabelFactory $labelFactory, diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php index 9bc98eb3276d0..beba824fd260b 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php @@ -39,14 +39,14 @@ class Main /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $systemStore, array $data = array() diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tabs.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tabs.php index 71ec8c9c3a9ac..dd3faa814e7e4 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tabs.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tabs.php @@ -27,12 +27,7 @@ /** * Admin page left menu - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ - class Tabs extends \Magento\Backend\Block\Widget\Tabs { /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action.php index 2a31ab9240e80..aef61f4ca064c 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action.php @@ -23,27 +23,27 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Block\Adminhtml\Page\Grid\Renderer; -class Action - extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer +class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { /** - * @var \Magento\UrlFactory + * @var Action\UrlBuilder */ - protected $_urlFactory; + protected $actionUrlBuilder; /** * @param \Magento\Backend\Block\Context $context - * @param \Magento\UrlFactory $urlFactory + * @param Action\UrlBuilder $actionUrlBuilder * @param array $data */ public function __construct( \Magento\Backend\Block\Context $context, - \Magento\UrlFactory $urlFactory, + Action\UrlBuilder $actionUrlBuilder, array $data = array() ) { - $this->_urlFactory = $urlFactory; + $this->actionUrlBuilder = $actionUrlBuilder; parent::__construct($context, $data); } @@ -55,14 +55,11 @@ public function __construct( */ public function render(\Magento\Object $row) { - /** @var \Magento\UrlInterface $urlModel */ - $urlModel = $this->_urlFactory->create()->setScope($row->getData('_first_store_id')); - $href = $urlModel->getUrl( - $row->getIdentifier(), array( - '_current' => false, - '_query' => '___store='.$row->getStoreCode() - ) + $href = $this->actionUrlBuilder->getUrl( + $row->getIdentifier(), + $row->getData('_first_store_id'), + $row->getStoreCode() ); - return ''.__('Preview').''; + return '' . __('Preview') . ''; } } diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action/UrlBuilder.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action/UrlBuilder.php new file mode 100644 index 0000000000000..b6655304f7be1 --- /dev/null +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid/Renderer/Action/UrlBuilder.php @@ -0,0 +1,59 @@ +frontendUrlBuilder = $frontendUrlBuilder; + } + + /** + * Get action url + * + * @param string $routePath + * @param string $scope + * @param string $store + * @return string + */ + public function getUrl($routePath, $scope, $store) + { + $this->frontendUrlBuilder->setScope($scope); + $href = $this->frontendUrlBuilder->getUrl( + $routePath, + array('_current' => false, '_query' => '___store=' . $store) + ); + return $href; + } +} diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php index f802709948e7f..4bf140120e7fc 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php @@ -24,17 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * Wysiwyg Images content block - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team - */ namespace Magento\Cms\Block\Adminhtml\Wysiwyg\Images; use Magento\View\Element\Template; +/** + * Wysiwyg Images content block + */ class Content extends \Magento\Backend\Block\Widget\Container { /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php index c56e1ce519ddd..a49e34cbc2111 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php @@ -37,7 +37,7 @@ class Tree extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,13 +51,13 @@ class Tree extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Cms/Block/Block.php b/app/code/Magento/Cms/Block/Block.php index 93fe847707b83..83bf4353e129e 100644 --- a/app/code/Magento/Cms/Block/Block.php +++ b/app/code/Magento/Cms/Block/Block.php @@ -24,18 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Cms\Block; /** * Cms block content block - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ -namespace Magento\Cms\Block; - -use Magento\View\Element\AbstractBlock; - class Block extends \Magento\View\Element\AbstractBlock { /** diff --git a/app/code/Magento/Cms/Block/Page.php b/app/code/Magento/Cms/Block/Page.php index 848b9ffb0763d..6bbfca883c274 100644 --- a/app/code/Magento/Cms/Block/Page.php +++ b/app/code/Magento/Cms/Block/Page.php @@ -25,14 +25,8 @@ */ namespace Magento\Cms\Block; -use Magento\View\Element\AbstractBlock; - /** * Cms page content block - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Page extends \Magento\View\Element\AbstractBlock { diff --git a/app/code/Magento/Cms/Block/Widget/Page/Link.php b/app/code/Magento/Cms/Block/Widget/Page/Link.php index e6917b991f422..fa1ea4663a095 100644 --- a/app/code/Magento/Cms/Block/Widget/Page/Link.php +++ b/app/code/Magento/Cms/Block/Widget/Page/Link.php @@ -27,10 +27,6 @@ /** * Widget to display link to CMS page - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Link extends \Magento\View\Element\Html\Link @@ -141,12 +137,12 @@ public function getLabel() { if ($this->getData('anchor_text')) { $this->_anchorText = $this->getData('anchor_text'); - } else if ($this->getTitle()) { + } elseif ($this->getTitle()) { $this->_anchorText = $this->getTitle(); - } else if ($this->getData('href')) { + } elseif ($this->getData('href')) { $this->_anchorText = $this->_resourcePage->setStore($this->_storeManager->getStore()) ->getCmsPageTitleByIdentifier($this->getData('href')); - } else if ($this->getData('page_id')) { + } elseif ($this->getData('page_id')) { $this->_anchorText = $this->_resourcePage->getCmsPageTitleById($this->getData('page_id')); } else { $this->_anchorText = $this->getData('href'); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Block.php b/app/code/Magento/Cms/Controller/Adminhtml/Block.php index 0ea283b3f06d8..8824835382c74 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Block.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Block.php @@ -37,17 +37,17 @@ class Block extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Page.php b/app/code/Magento/Cms/Controller/Adminhtml/Page.php index c9717c427914e..d0713cd0fbf04 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Page.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Page.php @@ -37,7 +37,7 @@ class Page extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -48,12 +48,12 @@ class Page extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Core\Filter\Date $dateFilter */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Core\Filter\Date $dateFilter ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php index 11e9dd26e95e0..fa3f126629811 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php @@ -37,17 +37,17 @@ class Images extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); @@ -181,7 +181,7 @@ public function deleteFilesAction() $filePath = $path . '/' . $file; if ($dir->isFile($dir->getRelativePath($filePath))) { $this->getStorage()->deleteFile($filePath); - } + } } } catch (\Exception $e) { $result = array('error' => true, 'message' => $e->getMessage()); diff --git a/app/code/Magento/Cms/Model/Block.php b/app/code/Magento/Cms/Model/Block.php index 1f913973215d5..96b119da21a4c 100644 --- a/app/code/Magento/Cms/Model/Block.php +++ b/app/code/Magento/Cms/Model/Block.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model; /** @@ -42,19 +43,18 @@ * @method \Magento\Cms\Model\Block setUpdateTime(string $value) * @method int getIsActive() * @method \Magento\Cms\Model\Block setIsActive(int $value) - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Block extends \Magento\Core\Model\AbstractModel { - const CACHE_TAG = 'cms_block'; + /** + * CMS block cache tag + */ + const CACHE_TAG = 'cms_block'; /** * @var string */ - protected $_cacheTag= 'cms_block'; + protected $_cacheTag = 'cms_block'; /** * Prefix of model events names diff --git a/app/code/Magento/Cms/Model/Config/Source/Page.php b/app/code/Magento/Cms/Model/Config/Source/Page.php index 069486f81baec..c50ad55fc5566 100644 --- a/app/code/Magento/Cms/Model/Config/Source/Page.php +++ b/app/code/Magento/Cms/Model/Config/Source/Page.php @@ -25,10 +25,7 @@ */ namespace Magento\Cms\Model\Config\Source; -/** - * @SuppressWarnings(PHPMD.LongVariable) - */ -class Page implements \Magento\Core\Model\Option\ArrayInterface +class Page implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Cms/Model/Config/Source/Wysiwyg/Enabled.php b/app/code/Magento/Cms/Model/Config/Source/Wysiwyg/Enabled.php index 68941c19d7821..2e5d67a2f6d9c 100644 --- a/app/code/Magento/Cms/Model/Config/Source/Wysiwyg/Enabled.php +++ b/app/code/Magento/Cms/Model/Config/Source/Wysiwyg/Enabled.php @@ -23,16 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Config\Source\Wysiwyg; /** * Configuration source model for Wysiwyg toggling - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ -class Enabled implements \Magento\Core\Model\Option\ArrayInterface +class Enabled implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Cms/Model/Observer.php b/app/code/Magento/Cms/Model/Observer.php index 74cf0cc77efc0..b93e97618534e 100644 --- a/app/code/Magento/Cms/Model/Observer.php +++ b/app/code/Magento/Cms/Model/Observer.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model; /** * CMS Observer model - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Observer { @@ -39,7 +36,7 @@ class Observer * * @var \Magento\Cms\Helper\Page */ - protected $_cmsPage = null; + protected $_cmsPage; /** * Core store config @@ -91,8 +88,7 @@ public function noCookies(\Magento\Event\Observer $observer) if ($pageUrl) { $redirect->setRedirectUrl($pageUrl); - } - else { + } else { $redirect->setRedirect(true) ->setPath('cms/index/noCookies') ->setArguments(array()); diff --git a/app/code/Magento/Cms/Model/Page.php b/app/code/Magento/Cms/Model/Page.php index 94bb51b62829b..4ac0adb57c7c5 100644 --- a/app/code/Magento/Cms/Model/Page.php +++ b/app/code/Magento/Cms/Model/Page.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model; /** @@ -64,13 +65,12 @@ * @method \Magento\Cms\Model\Page setCustomThemeFrom(string $value) * @method string getCustomThemeTo() * @method \Magento\Cms\Model\Page setCustomThemeTo(string $value) - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Page extends \Magento\Core\Model\AbstractModel { + /** + * No route page id + */ const NOROUTE_PAGE_ID = 'no-route'; /** @@ -110,7 +110,7 @@ protected function _construct() * @param string $field * @return $this */ - public function load($id, $field=null) + public function load($id, $field = null) { if (is_null($id)) { return $this->noRoutePage(); diff --git a/app/code/Magento/Cms/Model/Page/Urlrewrite.php b/app/code/Magento/Cms/Model/Page/Urlrewrite.php index 3b3715b99f2bd..ade82bb7f4cf0 100644 --- a/app/code/Magento/Cms/Model/Page/Urlrewrite.php +++ b/app/code/Magento/Cms/Model/Page/Urlrewrite.php @@ -23,9 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Page; /** + * Page Url rewrite model + * * @method \Magento\Cms\Model\Resource\Page\Urlrewrite getResource() getResource() * @method int getCmsPageId() getCmsPageId() * @method int getUrlRewriteId() getUrlRewriteId() diff --git a/app/code/Magento/Cms/Model/Resource/Block.php b/app/code/Magento/Cms/Model/Resource/Block.php index 2cd2e59122626..fc22d5abd102e 100644 --- a/app/code/Magento/Cms/Model/Resource/Block.php +++ b/app/code/Magento/Cms/Model/Resource/Block.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource; /** * CMS block model - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Block extends \Magento\Core\Model\Resource\Db\AbstractDb { @@ -81,9 +78,7 @@ protected function _construct() */ protected function _beforeDelete(\Magento\Core\Model\AbstractModel $object) { - $condition = array( - 'block_id = ?' => (int) $object->getId(), - ); + $condition = array('block_id = ?' => (int) $object->getId()); $this->_getWriteAdapter()->delete($this->getTable('cms_block_store'), $condition); @@ -101,7 +96,8 @@ protected function _beforeSave(\Magento\Core\Model\AbstractModel $object) { if (!$this->getIsUniqueBlockToStores($object)) { throw new \Magento\Core\Exception( - __('A block identifier with the same properties already exists in the selected store.')); + __('A block identifier with the same properties already exists in the selected store.') + ); } if (! $object->getId()) { @@ -206,10 +202,10 @@ protected function _getLoadSelect($field, $value, $object) $select->join( array('cbs' => $this->getTable('cms_block_store')), - $this->getMainTable().'.block_id = cbs.block_id', + $this->getMainTable() . '.block_id = cbs.block_id', array('store_id') )->where('is_active = ?', 1) - ->where('cbs.store_id in (?) ', $stores) + ->where('cbs.store_id in (?)', $stores) ->order('store_id DESC') ->limit(1); } @@ -265,9 +261,7 @@ public function lookupStoreIds($id) ->from($this->getTable('cms_block_store'), 'store_id') ->where('block_id = :block_id'); - $binds = array( - ':block_id' => (int) $id - ); + $binds = array(':block_id' => (int) $id); return $adapter->fetchCol($select, $binds); } diff --git a/app/code/Magento/Cms/Model/Resource/Block/Collection.php b/app/code/Magento/Cms/Model/Resource/Block/Collection.php index 42b2143558f86..871b97c55f7df 100644 --- a/app/code/Magento/Cms/Model/Resource/Block/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Block/Collection.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource\Block; /** * CMS block model - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { diff --git a/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php b/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php index 92d02f087fe12..f22e1ec4bcdbe 100644 --- a/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php @@ -27,7 +27,6 @@ class Collection extends \Magento\Cms\Model\Resource\Block\Collection { - /** * @return \Magento\Cms\Model\Resource\Block\Grid\Collection */ @@ -44,7 +43,7 @@ protected function _afterLoad() */ public function addFieldToFilter($field, $condition = null) { - if ($field == 'store_id'){ + if ($field == 'store_id') { return $this->addStoreFilter($field); } } diff --git a/app/code/Magento/Cms/Model/Resource/Page.php b/app/code/Magento/Cms/Model/Resource/Page.php index 5935401142fe5..c9c863dac0d6a 100644 --- a/app/code/Magento/Cms/Model/Resource/Page.php +++ b/app/code/Magento/Cms/Model/Resource/Page.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource; /** * Cms page mysql resource - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Page extends \Magento\Core\Model\Resource\Db\AbstractDb { @@ -96,9 +93,7 @@ protected function _construct() */ protected function _beforeDelete(\Magento\Core\Model\AbstractModel $object) { - $condition = array( - 'page_id = ?' => (int) $object->getId(), - ); + $condition = array('page_id = ?' => (int) $object->getId()); $this->_getWriteAdapter()->delete($this->getTable('cms_page_store'), $condition); @@ -309,7 +304,6 @@ public function getIsUniquePageToStores(\Magento\Core\Model\AbstractModel $objec * * @param \Magento\Core\Model\AbstractModel $object * @return bool - * @date Wed Mar 26 18:12:28 EET 2008 */ protected function isNumericPageIdentifier(\Magento\Core\Model\AbstractModel $object) { diff --git a/app/code/Magento/Cms/Model/Resource/Page/Collection.php b/app/code/Magento/Cms/Model/Resource/Page/Collection.php index 8b8d01851d4d0..6699541063362 100644 --- a/app/code/Magento/Cms/Model/Resource/Page/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Page/Collection.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource\Page; /** * CMS page collection - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { @@ -215,7 +212,6 @@ protected function _renderFiltersBefore() public function getSelectCountSql() { $countSelect = parent::getSelectCountSql(); - $countSelect->reset(\Zend_Db_Select::GROUP); return $countSelect; diff --git a/app/code/Magento/Cms/Model/Resource/Page/Service.php b/app/code/Magento/Cms/Model/Resource/Page/Service.php index 4210142823d20..866189525ab3c 100644 --- a/app/code/Magento/Cms/Model/Resource/Page/Service.php +++ b/app/code/Magento/Cms/Model/Resource/Page/Service.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource\Page; /** * Cms page service resource model - * - * @author Magento Core Team */ class Service extends \Magento\Core\Model\Resource\Db\AbstractDb { diff --git a/app/code/Magento/Cms/Model/Resource/Page/Urlrewrite.php b/app/code/Magento/Cms/Model/Resource/Page/Urlrewrite.php index 7aa9e496db6b8..5cbc82bceea79 100644 --- a/app/code/Magento/Cms/Model/Resource/Page/Urlrewrite.php +++ b/app/code/Magento/Cms/Model/Resource/Page/Urlrewrite.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource\Page; /** * Cms page url rewrite resource model - * - * @author Magento Core Team */ class Urlrewrite extends \Magento\Core\Model\Resource\Db\AbstractDb { diff --git a/app/code/Magento/Cms/Model/Resource/Setup.php b/app/code/Magento/Cms/Model/Resource/Setup.php index 865e3b9298010..d76fb4d960fd3 100644 --- a/app/code/Magento/Cms/Model/Resource/Setup.php +++ b/app/code/Magento/Cms/Model/Resource/Setup.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Resource; /** diff --git a/app/code/Magento/Cms/Model/Template/Filter.php b/app/code/Magento/Cms/Model/Template/Filter.php index 77022f308def7..172e576e86f00 100644 --- a/app/code/Magento/Cms/Model/Template/Filter.php +++ b/app/code/Magento/Cms/Model/Template/Filter.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Template; /** * Cms Template Filter Model - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Filter extends \Magento\Email\Model\Template\Filter { @@ -39,7 +36,7 @@ class Filter extends \Magento\Email\Model\Template\Filter * * @var bool */ - protected $_useSessionInUrl = null; + protected $_useSessionInUrl; /** * Setter whether SID is allowed in store directive diff --git a/app/code/Magento/Cms/Model/Template/FilterProvider.php b/app/code/Magento/Cms/Model/Template/FilterProvider.php index 0478c226a4e09..e002ebe9e51dd 100644 --- a/app/code/Magento/Cms/Model/Template/FilterProvider.php +++ b/app/code/Magento/Cms/Model/Template/FilterProvider.php @@ -25,6 +25,9 @@ */ namespace Magento\Cms\Model\Template; +/** + * Filter provider model + */ class FilterProvider { /** diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Config.php b/app/code/Magento/Cms/Model/Wysiwyg/Config.php index f0c66bc14920a..298dd98f2f9a7 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Config.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Config.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Wysiwyg; /** * Wysiwyg Config for Editor HTML Element - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Config extends \Magento\Object { @@ -40,6 +37,10 @@ class Config extends \Magento\Object const WYSIWYG_ENABLED = 'enabled'; const WYSIWYG_HIDDEN = 'hidden'; const WYSIWYG_DISABLED = 'disabled'; + + /** + * Wysiwyg image directory + */ const IMAGE_DIRECTORY = 'wysiwyg'; /** @@ -67,14 +68,14 @@ class Config extends \Magento\Object * * @var \Magento\Cms\Helper\Data */ - protected $_cmsData = null; + protected $_cmsData; /** * Core event manager proxy * * @var \Magento\Event\ManagerInterface */ - protected $_eventManager = null; + protected $_eventManager; /** * Core store config @@ -148,7 +149,6 @@ public function __construct( public function getConfig($data = array()) { $config = new \Magento\Object(); - $viewUrl = $this->_viewUrl; $config->setData(array( 'enabled' => $this->isEnabled(), @@ -160,10 +160,12 @@ public function getConfig($data = array()) 'translator' => $this->_cmsData, 'encode_directives' => true, 'directives_url' => $this->_backendUrl->getUrl('cms/wysiwyg/directive'), - 'popup_css' => - $viewUrl->getViewFileUrl('mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css'), - 'content_css' => - $viewUrl->getViewFileUrl('mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css'), + 'popup_css' => $this->_viewUrl->getViewFileUrl( + 'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css' + ), + 'content_css' => $this->_viewUrl->getViewFileUrl( + 'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css' + ), 'width' => '100%', 'plugins' => array() )); diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index d9cb5fc9172df..a90a3907e8375 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -340,7 +340,8 @@ public function createDirectory($name, $path) { if (!preg_match(self::DIRECTORY_NAME_REGEXP, $name)) { throw new \Magento\Core\Exception( - __('Please correct the folder name. Use only letters, numbers, underscores and dashes.')); + __('Please correct the folder name. Use only letters, numbers, underscores and dashes.') + ); } $relativePath = $this->_directory->getRelativePath($path); @@ -352,7 +353,8 @@ public function createDirectory($name, $path) $relativeNewPath = $this->_directory->getRelativePath($newPath); if ($this->_directory->isDirectory($relativeNewPath)) { throw new \Magento\Core\Exception( - __('We found a directory with the same name. Please try another folder name.')); + __('We found a directory with the same name. Please try another folder name.') + ); } $this->_directory->create($relativeNewPath); @@ -369,7 +371,7 @@ public function createDirectory($name, $path) 'id' => $this->_cmsWysiwygImages->convertPathToId($newPath) ); return $result; - } Catch (\Magento\Filesystem\FilesystemException $e) { + } catch (\Magento\Filesystem\FilesystemException $e) { throw new \Magento\Core\Exception(__('We cannot create a new directory.')); } } @@ -457,7 +459,7 @@ public function uploadFile($targetPath, $type = null) $result = $uploader->save($targetPath); if (!$result) { - throw new \Magento\Core\Exception(__('We cannot upload the file.') ); + throw new \Magento\Core\Exception(__('We cannot upload the file.')); } // create thumbnail @@ -509,8 +511,9 @@ public function getThumbnailUrl($filePath, $checkFile = false) if (strpos($filePath, $mediaRootDir) === 0) { $thumbSuffix = self::THUMBS_DIRECTORY_NAME . substr($filePath, strlen($mediaRootDir)); - if (!$checkFile || $this->_directory->isExist( - $this->_directory->getRelativePath($mediaRootDir . '/' . $thumbSuffix))) { + if (!$checkFile + || $this->_directory->isExist($this->_directory->getRelativePath($mediaRootDir . '/' . $thumbSuffix)) + ) { $thumbSuffix = substr($mediaRootDir, strlen($this->_directory->getAbsolutePath())) . '/' . $thumbSuffix; $randomIndex = '?rand=' . time(); return str_replace('\\', '/', $this->_cmsWysiwygImages->getBaseUrl() . $thumbSuffix) . $randomIndex; @@ -529,7 +532,7 @@ public function getThumbnailUrl($filePath, $checkFile = false) */ public function resizeFile($source, $keepRation = true) { - $realPath = $this->_directory->getRelativePath($source); + $realPath = $this->_directory->getRelativePath($source); if (!$this->_directory->isFile($realPath) || !$this->_directory->isExist($realPath)) { return false; } @@ -673,7 +676,6 @@ public function getCmsWysiwygImages() * Is path under storage root directory * * @param string $path - * * @return void * @throws \Magento\Core\Exception */ @@ -692,7 +694,6 @@ protected function _validatePath($path) * Sanitize path * * @param string $path - * * @return string */ protected function _sanitizePath($path) @@ -704,7 +705,6 @@ protected function _sanitizePath($path) * Get path in root storage dir * * @param string $path - * * @return string|bool */ protected function _getRelativePathToRoot($path) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php index 9c2c4940487f4..b5f2ececef17b 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Cms\Model\Wysiwyg\Images\Storage; /** * Wysiwyg Images storage collection - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team */ class Collection extends \Magento\Data\Collection\Filesystem { diff --git a/app/code/Magento/Cms/etc/adminhtml/di.xml b/app/code/Magento/Cms/etc/adminhtml/di.xml new file mode 100644 index 0000000000000..d06f53dc2597f --- /dev/null +++ b/app/code/Magento/Cms/etc/adminhtml/di.xml @@ -0,0 +1,32 @@ + + + + + + Magento\Url + + + diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php index 2e34422e13f3e..e556b5e6c82eb 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php @@ -43,7 +43,7 @@ class Created extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -67,7 +67,7 @@ class Created extends \Magento\Backend\Block\Widget * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -75,7 +75,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index 0c337a444fd94..b97431e86615c 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -51,7 +51,7 @@ class Config /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -70,7 +70,7 @@ class Config * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable $configurableType * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -78,7 +78,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\ConfigurableProduct\Model\Product\Type\Configurable $configurableType, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_configurableType = $configurableType; diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index ae74ec7ed7f99..cae997622f27c 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -37,7 +37,7 @@ class Matrix /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -61,7 +61,7 @@ class Matrix * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable $configurableType * @param \Magento\Catalog\Model\Config $config * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -69,7 +69,7 @@ public function __construct( \Magento\ConfigurableProduct\Model\Product\Type\Configurable $configurableType, \Magento\Catalog\Model\Config $config, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_configurableType = $configurableType; diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php index 41352766ce712..48434a449c92b 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php @@ -48,7 +48,7 @@ class Simple extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attribute /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param \Magento\Catalog\Helper\Data $catalogData @@ -57,7 +57,7 @@ class Simple extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attribute */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, \Magento\Catalog\Helper\Data $catalogData, diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php index 03561b09eaed8..52639be1734e5 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php @@ -46,7 +46,7 @@ class Settings extends Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable $configurableType * @param \Magento\Core\Helper\Data $coreHelper @@ -54,7 +54,7 @@ class Settings extends Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\ConfigurableProduct\Model\Product\Type\Configurable $configurableType, \Magento\Core\Helper\Data $coreHelper, diff --git a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php index 9b386555257a0..38055b25ec3a5 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php @@ -21,7 +21,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\ConfigurableProduct\Block\Cart\Item\Renderer; use Magento\Catalog\Model\Config\Source\Product\Thumbnail as ThumbnailSource; diff --git a/app/code/Magento/ConfigurableProduct/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php b/app/code/Magento/ConfigurableProduct/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php index 37a1e7b8c4048..15c762d84d05f 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php +++ b/app/code/Magento/ConfigurableProduct/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php @@ -34,7 +34,7 @@ class ColumnSet /** * Registry instance * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registryManager; @@ -51,7 +51,7 @@ class ColumnSet * @param \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals * @param \Magento\Backend\Model\Widget\Grid\Totals $totals * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType - * @param \Magento\Core\Model\Registry $registryManager + * @param \Magento\Registry $registryManager * @param array $data */ public function __construct( @@ -60,7 +60,7 @@ public function __construct( \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals, \Magento\Backend\Model\Widget\Grid\Totals $totals, \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType, - \Magento\Core\Model\Registry $registryManager, + \Magento\Registry $registryManager, array $data = array() ) { parent::__construct($context, $generatorFactory, $subtotals, $totals, $data); diff --git a/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php index 31ce1c9ed5525..ebaf66a7cd7cc 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php @@ -76,7 +76,7 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -98,7 +98,7 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/ConfigurableProduct/Model/Entity/Product/Attribute/Group/AttributeMapper/Plugin.php b/app/code/Magento/ConfigurableProduct/Model/Entity/Product/Attribute/Group/AttributeMapper/Plugin.php index f4d632357aa31..4974db606b0d0 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Entity/Product/Attribute/Group/AttributeMapper/Plugin.php +++ b/app/code/Magento/ConfigurableProduct/Model/Entity/Product/Attribute/Group/AttributeMapper/Plugin.php @@ -26,7 +26,7 @@ namespace Magento\ConfigurableProduct\Model\Entity\Product\Attribute\Group\AttributeMapper; use Magento\Code\Plugin\InvocationChain; -use Magento\Core\Model\Registry; +use Magento\Registry; use Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\AttributeFactory; class Plugin @@ -37,7 +37,7 @@ class Plugin protected $attributeFactory; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $registry; @@ -76,4 +76,4 @@ public function aroundMap($arguments, InvocationChain $invocationChain) $result['is_configurable'] = (int)in_array($attribute->getAttributeId(), $this->configurableAttributes[$setId]); return $result; } -} +} diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php index 4d7dd5c6967d3..b6c82447bbe68 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php @@ -168,7 +168,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory * @param \Magento\Eav\Model\EntityFactory $entityFactory @@ -192,7 +192,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory, \Magento\Eav\Model\EntityFactory $entityFactory, diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php index d1e8591e286f8..5da0573a48bcf 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php @@ -38,7 +38,7 @@ class AssociatedProduct /** * Registry instance * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registryManager; @@ -68,20 +68,21 @@ class AssociatedProduct * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Core\Model\Registry $registryManager + * @param \Magento\Registry $registryManager * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig * @param \Zend_Db_Adapter_Abstract $connection * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ + public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, @@ -94,14 +95,14 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, \Magento\Stdlib\DateTime $dateTime, - \Magento\Core\Model\Registry $registryManager, + \Magento\Registry $registryManager, \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType, \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig, $connection = null @@ -121,7 +122,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php index 7f8d9424e142f..142a8ec74e705 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php @@ -56,14 +56,14 @@ abstract class AbstractTab /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Connect\Model\Session $session * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Connect\Model\Session $session, array $data = array() diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php index ea6b0821800f6..9715c65d9d65d 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php @@ -46,14 +46,14 @@ class Authors /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Connect\Model\Session $session * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Connect\Model\Session $session, \Magento\Json\EncoderInterface $jsonEncoder, diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php index b8090b5dce46a..71f73404667ea 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php @@ -45,7 +45,7 @@ class Contents /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Connect\Model\Session $session * @param \Magento\Connect\Model\ExtensionFactory $extensionFactory @@ -53,7 +53,7 @@ class Contents */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Connect\Model\Session $session, \Magento\Connect\Model\ExtensionFactory $extensionFactory, diff --git a/app/code/Magento/Contacts/Controller/Index.php b/app/code/Magento/Contacts/Controller/Index.php index 591d5e791e859..270fa5a5198ae 100644 --- a/app/code/Magento/Contacts/Controller/Index.php +++ b/app/code/Magento/Contacts/Controller/Index.php @@ -43,6 +43,24 @@ class Index extends \Magento\App\Action\Action const XML_PATH_EMAIL_TEMPLATE = 'contacts/email/email_template'; const XML_PATH_ENABLED = 'contacts/contacts/enabled'; + /** + * @var \Magento\Mail\Template\TransportBuilder + */ + protected $_transportBuilder; + + /** + * @param \Magento\App\Action\Context $context + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder + */ + public function __construct( + \Magento\App\Action\Context $context, + \Magento\Mail\Template\TransportBuilder $transportBuilder + ) { + parent::__construct($context); + $this->_transportBuilder = $transportBuilder; + } + + /** * Dispatch request * @@ -115,25 +133,22 @@ public function postAction() if ($error) { throw new \Exception(); } - $mailTemplate = $this->_objectManager->create('Magento\Email\Model\Template'); - /* @var $mailTemplate \Magento\Email\Model\Template */ - $mailTemplate->setDesignConfig(array( - 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'store' => $this->_objectManager->get('Magento\Core\Model\StoreManagerInterface') - ->getStore()->getId() - )) + + $storeConfig = $this->_objectManager->get('Magento\Core\Model\Store\Config'); + $storeManager = $this->_objectManager->get('Magento\Core\Model\StoreManagerInterface'); + $transport = $this->_transportBuilder + ->setTemplateIdentifier($storeConfig->getConfig(self::XML_PATH_EMAIL_TEMPLATE)) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeManager->getStore()->getId() + )) + ->setTemplateVars(array('data' => $postObject)) + ->setFrom($storeConfig->getConfig(self::XML_PATH_EMAIL_SENDER)) + ->addTo($storeConfig->getConfig(self::XML_PATH_EMAIL_RECIPIENT)) ->setReplyTo($post['email']) - ->sendTransactional( - $this->_objectManager->get('Magento\Core\Model\Store\Config')->getConfig(self::XML_PATH_EMAIL_TEMPLATE), - $this->_objectManager->get('Magento\Core\Model\Store\Config')->getConfig(self::XML_PATH_EMAIL_SENDER), - $this->_objectManager->get('Magento\Core\Model\Store\Config')->getConfig(self::XML_PATH_EMAIL_RECIPIENT), - null, - array('data' => $postObject) - ); - - if (!$mailTemplate->getSentSuccess()) { - throw new \Exception(); - } + ->getTransport(); + + $transport->sendMessage(); $translate->setTranslateInline(true); diff --git a/app/code/Magento/Contacts/etc/module.xml b/app/code/Magento/Contacts/etc/module.xml index e4fa2ea264d7e..06955bdf4c78e 100755 --- a/app/code/Magento/Contacts/etc/module.xml +++ b/app/code/Magento/Contacts/etc/module.xml @@ -33,7 +33,6 @@ - diff --git a/app/code/Magento/Core/App/Router/Base.php b/app/code/Magento/Core/App/Router/Base.php index 3e4ff880af53f..f6915fab698b9 100644 --- a/app/code/Magento/Core/App/Router/Base.php +++ b/app/code/Magento/Core/App/Router/Base.php @@ -92,6 +92,11 @@ class Base extends \Magento\App\Router\AbstractRouter */ protected $_defaultPath; + /** + * @var \Magento\Code\NameBuilder + */ + protected $nameBuilder; + /** * @param \Magento\App\ActionFactory $actionFactory * @param \Magento\App\DefaultPathInterface $defaultPath @@ -103,6 +108,7 @@ class Base extends \Magento\App\Router\AbstractRouter * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param string $routerId + * @param \Magento\Code\NameBuilder $nameBuilder * @throws \InvalidArgumentException */ public function __construct( @@ -115,7 +121,8 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Store\Config $storeConfig, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, - $routerId + $routerId, + \Magento\Code\NameBuilder $nameBuilder ) { parent::__construct($actionFactory); @@ -127,6 +134,7 @@ public function __construct( $this->_url = $url; $this->_storeManager = $storeManager; $this->_appState = $appState; + $this->nameBuilder = $nameBuilder; } /** @@ -311,6 +319,7 @@ protected function _matchController(\Magento\App\RequestInterface $request, arra if (is_null($controllerInstance)) { return null; } + $action = 'noroute'; } // set values only after all the checks are done @@ -353,7 +362,7 @@ protected function _noRouteShouldBeApplied() */ public function getControllerClassName($module, $controller) { - return \Magento\Core\Helper\String::buildClassName(array( + return $this->nameBuilder->buildClassName(array( $module, 'Controller', $controller diff --git a/app/code/Magento/Core/Model/AbstractModel.php b/app/code/Magento/Core/Model/AbstractModel.php index e167128940f61..67098c79a76d1 100644 --- a/app/code/Magento/Core/Model/AbstractModel.php +++ b/app/code/Magento/Core/Model/AbstractModel.php @@ -123,7 +123,7 @@ abstract class AbstractModel extends \Magento\Object protected $_cacheManager; /** - * @var Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -138,15 +138,15 @@ abstract class AbstractModel extends \Magento\Object protected $_appState; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -208,9 +208,9 @@ public function __wakeup() $objectManager = \Magento\App\ObjectManager::getInstance(); $this->_eventManager = $objectManager->get('Magento\Event\ManagerInterface'); $this->_cacheManager = $objectManager->get('Magento\App\CacheInterface'); - $this->_coreRegistry = $objectManager->get('Magento\Core\Model\Registry'); - $context = $objectManager->get('Magento\Core\Model\Context'); - if ($context instanceof \Magento\Core\Model\Context) { + $this->_coreRegistry = $objectManager->get('Magento\Registry'); + $context = $objectManager->get('Magento\Model\Context'); + if ($context instanceof \Magento\Model\Context) { $this->_appState = $context->getAppState(); } } diff --git a/app/code/Magento/Core/Model/App.php b/app/code/Magento/Core/Model/App.php index 4a9ab1d280033..1e055605f1399 100644 --- a/app/code/Magento/Core/Model/App.php +++ b/app/code/Magento/Core/Model/App.php @@ -50,7 +50,7 @@ class App implements \Magento\AppInterface /** * Magento version */ - const VERSION = '2.0.0.0-dev66'; + const VERSION = '2.0.0.0-dev67'; /** * Application run code @@ -516,7 +516,7 @@ public function getVersionInfo() 'revision' => '0', 'patch' => '0', 'stability' => 'dev', - 'number' => '66', + 'number' => '67', ); } } diff --git a/app/code/Magento/Core/Model/Config/Value.php b/app/code/Magento/Core/Model/Config/Value.php index 306f0683e6a50..9c333d5a0652d 100644 --- a/app/code/Magento/Core/Model/Config/Value.php +++ b/app/code/Magento/Core/Model/Config/Value.php @@ -71,8 +71,8 @@ class Value extends \Magento\Core\Model\AbstractModel implements \Magento\App\Co protected $_config; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -80,8 +80,8 @@ class Value extends \Magento\Core\Model\AbstractModel implements \Magento\App\Co * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Core/Model/Design.php b/app/code/Magento/Core/Model/Design.php index bef938c6dace9..31481e24c3b72 100644 --- a/app/code/Magento/Core/Model/Design.php +++ b/app/code/Magento/Core/Model/Design.php @@ -75,8 +75,8 @@ class Design extends AbstractModel protected $_dateTime; /** - * @param Context $context - * @param Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param LocaleInterface $locale * @param \Magento\Stdlib\DateTime $dateTime * @param AbstractResource $resource @@ -84,9 +84,9 @@ class Design extends AbstractModel * @param array $data */ public function __construct( - Context $context, - Registry $registry, - LocaleInterface $locale, + \Magento\Model\Context $context, + \Magento\Registry $registry, + \Magento\Core\Model\LocaleInterface $locale, \Magento\Stdlib\DateTime $dateTime, AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Core/Model/Design/Backend/Exceptions.php b/app/code/Magento/Core/Model/Design/Backend/Exceptions.php index ae880801ba1a4..dca3063d681f7 100644 --- a/app/code/Magento/Core/Model/Design/Backend/Exceptions.php +++ b/app/code/Magento/Core/Model/Design/Backend/Exceptions.php @@ -36,8 +36,8 @@ class Exceptions extends \Magento\Backend\Model\Config\Backend\Serialized\ArrayS protected $_design = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\View\DesignInterface $design @@ -46,8 +46,8 @@ class Exceptions extends \Magento\Backend\Model\Config\Backend\Serialized\ArrayS * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\View\DesignInterface $design, diff --git a/app/code/Magento/Core/Model/Design/Backend/Theme.php b/app/code/Magento/Core/Model/Design/Backend/Theme.php index 6ea657a59a63d..714b82159c7d3 100644 --- a/app/code/Magento/Core/Model/Design/Backend/Theme.php +++ b/app/code/Magento/Core/Model/Design/Backend/Theme.php @@ -36,8 +36,8 @@ class Theme extends \Magento\Core\Model\Config\Value protected $_design = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\View\DesignInterface $design @@ -46,8 +46,8 @@ class Theme extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\View\DesignInterface $design, diff --git a/app/code/Magento/Core/Model/File/Storage.php b/app/code/Magento/Core/Model/File/Storage.php index e33e561b8a68c..2589a354bc5f7 100644 --- a/app/code/Magento/Core/Model/File/Storage.php +++ b/app/code/Magento/Core/Model/File/Storage.php @@ -102,8 +102,8 @@ class Storage extends AbstractModel protected $filesystem; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\ConfigInterface $coreConfig @@ -116,8 +116,8 @@ class Storage extends AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\ConfigInterface $coreConfig, diff --git a/app/code/Magento/Core/Model/File/Storage/Database.php b/app/code/Magento/Core/Model/File/Storage/Database.php index 0d143fb025e89..ea79cca57611e 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Database.php @@ -63,8 +63,8 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas protected $_mediaHelper; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Date $dateModel * @param \Magento\Core\Model\App $app @@ -76,8 +76,8 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Date $dateModel, \Magento\Core\Model\App $app, diff --git a/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php b/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php index 34bb514b1c18e..05a7be9709c83 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php +++ b/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php @@ -58,8 +58,8 @@ abstract class AbstractDatabase extends \Magento\Core\Model\AbstractModel protected $_app; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Date $dateModel * @param \Magento\Core\Model\App $app @@ -69,8 +69,8 @@ abstract class AbstractDatabase extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Date $dateModel, \Magento\Core\Model\App $app, diff --git a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php index a039265521e00..2ba22adeea45f 100644 --- a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php @@ -51,8 +51,8 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas protected $_directoryFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Date $dateModel * @param \Magento\Core\Model\App $app @@ -63,8 +63,8 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Date $dateModel, \Magento\Core\Model\App $app, diff --git a/app/code/Magento/Core/Model/Layout/Update.php b/app/code/Magento/Core/Model/Layout/Update.php index f13caa8917435..4afd72ac7da73 100644 --- a/app/code/Magento/Core/Model/Layout/Update.php +++ b/app/code/Magento/Core/Model/Layout/Update.php @@ -48,16 +48,16 @@ class Update extends \Magento\Core\Model\AbstractModel protected $_dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Core/Model/Mview/View/State.php b/app/code/Magento/Core/Model/Mview/View/State.php index 9960ca5052920..a861563aee979 100644 --- a/app/code/Magento/Core/Model/Mview/View/State.php +++ b/app/code/Magento/Core/Model/Mview/View/State.php @@ -44,15 +44,15 @@ class State extends \Magento\Core\Model\AbstractModel implements \Magento\Mview\ protected $_eventObject = 'mview_state'; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\Mview\View\State $resource * @param \Magento\Core\Model\Resource\Mview\View\State\Collection $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\Mview\View\State $resource, \Magento\Core\Model\Resource\Mview\View\State\Collection $resourceCollection, array $data = array() diff --git a/app/code/Magento/Core/Model/Source/Urlrewrite/Options.php b/app/code/Magento/Core/Model/Source/Urlrewrite/Options.php index f6e1760729015..b8c8e903be245 100644 --- a/app/code/Magento/Core/Model/Source/Urlrewrite/Options.php +++ b/app/code/Magento/Core/Model/Source/Urlrewrite/Options.php @@ -33,9 +33,7 @@ */ namespace Magento\Core\Model\Source\Urlrewrite; -use Magento\Core\Model\Option\ArrayInterface; - -class Options implements ArrayInterface +class Options implements \Magento\Option\ArrayInterface { const TEMPORARY = 'R'; const PERMANENT = 'RP'; diff --git a/app/code/Magento/Core/Model/Source/Urlrewrite/Types.php b/app/code/Magento/Core/Model/Source/Urlrewrite/Types.php index 2374d857ee7f4..8b66687ac3dcf 100644 --- a/app/code/Magento/Core/Model/Source/Urlrewrite/Types.php +++ b/app/code/Magento/Core/Model/Source/Urlrewrite/Types.php @@ -33,7 +33,7 @@ */ namespace Magento\Core\Model\Source\Urlrewrite; -class Types implements \Magento\Core\Model\Option\ArrayInterface +class Types implements \Magento\Option\ArrayInterface { const SYSTEM = 1; const CUSTOM = 0; diff --git a/app/code/Magento/Core/Model/Store.php b/app/code/Magento/Core/Model/Store.php index edaf96666af18..f1cc2001222e1 100644 --- a/app/code/Magento/Core/Model/Store.php +++ b/app/code/Magento/Core/Model/Store.php @@ -323,8 +323,8 @@ class Store extends AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\App\Cache\Type\Config $configCacheType, \Magento\UrlInterface $url, diff --git a/app/code/Magento/Core/Model/Store/Group.php b/app/code/Magento/Core/Model/Store/Group.php index a72706db90325..c71648df131c1 100644 --- a/app/code/Magento/Core/Model/Store/Group.php +++ b/app/code/Magento/Core/Model/Store/Group.php @@ -116,8 +116,8 @@ class Group extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\Config\Data $configDataResource * @param \Magento\Core\Model\Store $store * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -126,8 +126,8 @@ class Group extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\Config\Data $configDataResource, \Magento\Core\Model\Store $store, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Core/Model/Template.php b/app/code/Magento/Core/Model/Template.php index 289dc8d982d78..0e90b61c61c4f 100644 --- a/app/code/Magento/Core/Model/Template.php +++ b/app/code/Magento/Core/Model/Template.php @@ -32,14 +32,8 @@ * @package Magento_Core * @author Magento Core Team */ -abstract class Template extends AbstractModel +abstract class Template extends \Magento\Core\Model\AbstractModel implements \Magento\App\TemplateTypesInterface { - /** - * Types of template - */ - const TYPE_TEXT = 1; - const TYPE_HTML = 2; - /** * Default design area for emulation */ @@ -95,22 +89,22 @@ abstract class Template extends AbstractModel protected $_appEmulation; /** - * @var StoreManagerInterface + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context + * @param \Magento\Model\Context $context * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, + \Magento\Model\Context $context, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() diff --git a/app/code/Magento/Core/Model/Theme.php b/app/code/Magento/Core/Model/Theme.php index 92b2df84e0971..941abd7a59b68 100644 --- a/app/code/Magento/Core/Model/Theme.php +++ b/app/code/Magento/Core/Model/Theme.php @@ -112,8 +112,8 @@ class Theme extends AbstractModel implements ThemeInterface /** * Initialize dependencies * - * @param Context $context - * @param Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory * @param \Magento\View\Design\Theme\Domain\Factory $domainFactory * @param \Magento\View\Design\Theme\ImageFactory $imageFactory @@ -126,8 +126,8 @@ class Theme extends AbstractModel implements ThemeInterface * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - Context $context, - Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\View\Design\Theme\FlyweightFactory $themeFactory, \Magento\View\Design\Theme\Domain\Factory $domainFactory, \Magento\View\Design\Theme\ImageFactory $imageFactory, diff --git a/app/code/Magento/Core/Model/Theme/File.php b/app/code/Magento/Core/Model/Theme/File.php index 3e44984d9c65a..0ca48d33592c8 100644 --- a/app/code/Magento/Core/Model/Theme/File.php +++ b/app/code/Magento/Core/Model/Theme/File.php @@ -69,8 +69,8 @@ class File extends AbstractModel implements FileInterface protected $_themeFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory * @param \Magento\View\Design\Theme\Customization\FileServiceFactory $fileServiceFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -78,8 +78,8 @@ class File extends AbstractModel implements FileInterface * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\View\Design\Theme\FlyweightFactory $themeFactory, \Magento\View\Design\Theme\Customization\FileServiceFactory $fileServiceFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Core/Model/Url/Rewrite.php b/app/code/Magento/Core/Model/Url/Rewrite.php index 13d3c638a4d86..47ec70ca3fcac 100644 --- a/app/code/Magento/Core/Model/Url/Rewrite.php +++ b/app/code/Magento/Core/Model/Url/Rewrite.php @@ -90,8 +90,8 @@ class Rewrite extends \Magento\Core\Model\AbstractModel protected $response; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -101,8 +101,8 @@ class Rewrite extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\App $app, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Core/Model/Variable.php b/app/code/Magento/Core/Model/Variable.php index cf4852c26667d..3fba78b63a0c8 100644 --- a/app/code/Magento/Core/Model/Variable.php +++ b/app/code/Magento/Core/Model/Variable.php @@ -55,16 +55,16 @@ class Variable extends \Magento\Core\Model\AbstractModel protected $_escaper = null; /** - * @param Context $context - * @param Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Resource\Variable $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - Context $context, - Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Escaper $escaper, \Magento\Core\Model\Resource\Variable $resource, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Core/Model/Website.php b/app/code/Magento/Core/Model/Website.php index 0147877fbbe32..f204b346673cc 100644 --- a/app/code/Magento/Core/Model/Website.php +++ b/app/code/Magento/Core/Model/Website.php @@ -183,8 +183,8 @@ class Website extends \Magento\Core\Model\AbstractModel protected $_currencyFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\Config\Data $configDataResource * @param \Magento\App\ConfigInterface $coreConfig * @param \Magento\Core\Model\StoreFactory $storeFactory @@ -198,8 +198,8 @@ class Website extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\Config\Data $configDataResource, \Magento\App\ConfigInterface $coreConfig, \Magento\Core\Model\StoreFactory $storeFactory, diff --git a/app/code/Magento/Core/etc/di.xml b/app/code/Magento/Core/etc/di.xml index aa5c0d89c8fbf..fdff1688e9fb4 100644 --- a/app/code/Magento/Core/etc/di.xml +++ b/app/code/Magento/Core/etc/di.xml @@ -24,7 +24,7 @@ */ --> - + @@ -117,7 +117,7 @@ Magento\UrlInterface - + global_acl_resources @@ -247,7 +247,7 @@ - Magento\Core\Model\Input\Filter\MaliciousCode + Magento\Filter\Input\MaliciousCode @@ -317,6 +317,15 @@ Magento\View\Asset\PreProcessor\Composite + + + + + true + + + + true @@ -334,6 +343,7 @@ Magento\Css\PreProcessor\Less + Magento\Css\PreProcessor\UrlResolver @@ -500,6 +510,7 @@ + @@ -519,18 +530,18 @@ - + - + - - Magento\Less\PreProcessor\Instruction\Import - Magento\Less\PreProcessor\Instruction\MagentoImport + + Magento\Less\PreProcessor\Instruction\Import + diff --git a/app/code/Magento/Core/i18n/de_DE.csv b/app/code/Magento/Core/i18n/de_DE.csv index ac6e17a6ec9e4..a11e3f1b42a14 100644 --- a/app/code/Magento/Core/i18n/de_DE.csv +++ b/app/code/Magento/Core/i18n/de_DE.csv @@ -46,7 +46,7 @@ "Cache storage may contain additional data. Are you sure that you want flush it?","Der Cachespeicher könnte weitere Daten enthalten. Sind Sie sicher, dass Sie diese löschen möchten?" "Can not create invoice. Order was not found.","Rechnung konnte nicht erstellt werden. Es wurde keine Bestellung gefunden." "Can't retrieve request object","Objekt kann nicht abgefragt werden" -"Can\'t retrieve entity config: %s","Kann Entität config: %s nicht auffinden" +"Can't retrieve entity config: %s","Kann Entität config: %s nicht auffinden" "Cancel","Abbrechen" "Cannot complete this operation from non-admin area.","Diese Aktion kann nicht außerhalb des Admin-Bereichs fertiggestellt werden." "Card type does not match credit card number.","Kartentyp entspricht nicht der Kreditkartennummer." @@ -155,7 +155,7 @@ "Invalid messages storage ""%s"" for layout messages initialization","Ungültiger Nachrichtenspeicher ""%s"" für die Initialisierung der Layout-Nachrichten" "Invalid query","Ungültige Anfrage" "Invalid transactional email code: ","Ungültiger Transaktionsmailcode:" -"Invalid website\'s configuration path: %s","Ungültiger Webseitenkonfigurationspfad: %s" +"Invalid website's configuration path: %s","Ungültiger Webseitenkonfigurationspfad: %s" "JavaScript Settings","JavaScript Einstellungen" "Layout","Layout" "Leave empty for access from any location.","Leer lassen für den Zugriff von jedem Standort aus." @@ -197,7 +197,7 @@ "Parent directory does not exist: %s","Übergeordnetes Verzeichnis existiert nicht: %s" "Path ""%value%"" is not available and cannot be used.","Der Pfad ""%value%"" ist nicht verfügbar und kann nicht verwendet werden." "Path ""%value%"" is protected and cannot be used.","Der Pfad ""%value%"" ist geschützt und kann nicht verwendet werden." -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","Der Pfad ""%value%"" darf keinen Verweis auf das übergeordnete Verzeichnis enthalten (""../"", ""..\)." +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","Der Pfad ""%value%"" darf keinen Verweis auf das übergeordnete Verzeichnis enthalten (""../"", ""..\")." "Please define flag code.","Bitte definieren Sie Flag-Code." "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Bitte geben Sie 6 oder mehr Zeichen ein. Leerzeichen am Anfang oder Ende werden ignoriert." "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Bitte geben Sie 7 oder mehr Zeichen ein. Ihr Passwort sollte sowohl Zahlen als auch Buchstaben enthalten." @@ -250,7 +250,7 @@ "Profiler","Profiler" "Recovery Link Expiration Interval (days)","Verbleibende Gültigkeitsdauer des Wiederherstellungslinks (Tage)" "Request Path for Specified Store","Aufrufpfad für angegebenen Shop" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Die angefragte Datei darf keinen Verweis auf ein übergeordnetes Verzeichnis enthalten (""../"", ""..\notation"")" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","Die angefragte Datei darf keinen Verweis auf ein übergeordnetes Verzeichnis enthalten (""../"", ""..\" notation)" "Requested invalid store ""%s""","Ungültiger Speicher ""%s"" angefragt" "Resource is not set.","Ressource ist nicht gesetzt." "Retrieve store data","Gespeicherte Daten zurückholen" diff --git a/app/code/Magento/Core/i18n/en_US.csv b/app/code/Magento/Core/i18n/en_US.csv index 0c74a9ea88ba4..7178a29477e20 100644 --- a/app/code/Magento/Core/i18n/en_US.csv +++ b/app/code/Magento/Core/i18n/en_US.csv @@ -48,7 +48,7 @@ "Cache storage may contain additional data. Are you sure that you want flush it?","Cache storage may contain additional data. Are you sure that you want flush it?" "Can not create invoice. Order was not found.","Can not create invoice. Order was not found." "Can't retrieve request object","Can't retrieve request object" -"Can\'t retrieve entity config: %s","Can\'t retrieve entity config: %s" +"Can't retrieve entity config: %s","Can't retrieve entity config: %s" "Cancel","Cancel" "Cannot complete this operation from non-admin area.","Cannot complete this operation from non-admin area." "Card type does not match credit card number.","Card type does not match credit card number." @@ -157,7 +157,7 @@ "Invalid messages storage ""%s"" for layout messages initialization","Invalid messages storage ""%s"" for layout messages initialization" "Invalid query","Invalid query" "Invalid transactional email code: ","Invalid transactional email code: " -"Invalid website\'s configuration path: %s","Invalid website\'s configuration path: %s" +"Invalid website's configuration path: %s","Invalid website's configuration path: %s" "JavaScript Settings","JavaScript Settings" "Layout","Layout" "Leave empty for access from any location.","Leave empty for access from any location." @@ -198,7 +198,7 @@ "Parent directory does not exist: %s","Parent directory does not exist: %s" "Path ""%value%"" is not available and cannot be used.","Path ""%value%"" is not available and cannot be used." "Path ""%value%"" is protected and cannot be used.","Path ""%value%"" is protected and cannot be used." -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""" +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","Path ""%value%"" may not include parent directory traversal (""../"", ""..\")." "Please define flag code.","Please define flag code." "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Please enter 6 or more characters. Leading or trailing spaces will be ignored." "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Please enter 7 or more characters. Password should contain both numeric and alphabetic characters." @@ -251,7 +251,7 @@ "Profiler","Profiler" "Recovery Link Expiration Interval (days)","Recovery Link Expiration Interval (days)" "Request Path for Specified Store","Request Path for Specified Store" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Requested file may not include parent directory traversal (""../"", ""..\\ notation)""" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","Requested file may not include parent directory traversal (""../"", ""..\" notation)" "Requested invalid store ""%s""","Requested invalid store ""%s""" "Resource is not set.","Resource is not set." "Retrieve store data","Retrieve store data" diff --git a/app/code/Magento/Core/i18n/es_ES.csv b/app/code/Magento/Core/i18n/es_ES.csv index 2afaec1031b41..7a4da9e30d09a 100644 --- a/app/code/Magento/Core/i18n/es_ES.csv +++ b/app/code/Magento/Core/i18n/es_ES.csv @@ -46,7 +46,7 @@ "Cache storage may contain additional data. Are you sure that you want flush it?","El almacenamiento de caché puede contener datos adicionales. ¿Estás seguro de que deseas eliminarlo?" "Can not create invoice. Order was not found.","No se puede crear la factura. No se encontró el pedido." "Can't retrieve request object","No se puede recuperar el objeto solicitado" -"Can\'t retrieve entity config: %s","No se puede recuperar configuración de entidad: %s" +"Can't retrieve entity config: %s","No se puede recuperar configuración de entidad: %s" "Cancel","Cancelar" "Cannot complete this operation from non-admin area.","No se puede completar esta operación desde una área que no sea de administración." "Card type does not match credit card number.","El tipo de tarjeta no se ajusta al número de tarjeta de crédito." @@ -155,7 +155,7 @@ "Invalid messages storage ""%s"" for layout messages initialization","Almacenamiento de mensajes no válido ""%s"" para el diseño de inicialización de mensajes" "Invalid query","Consulta no válida" "Invalid transactional email code: ","Código del mensaje transaccional no válido:" -"Invalid website\'s configuration path: %s","Ruta de configuración de la página web no válida: %s" +"Invalid website's configuration path: %s","Ruta de configuración de la página web no válida: %s" "JavaScript Settings","Configuración JavaScript" "Layout","Diseño" "Leave empty for access from any location.","Déjese en blanco para acceder desde cualquier sitio." @@ -197,7 +197,7 @@ "Parent directory does not exist: %s","El directorio padre no existe: %s" "Path ""%value%"" is not available and cannot be used.","La ruta ""%value%"" no está disponible y no puede usarse." "Path ""%value%"" is protected and cannot be used.","La ruta ""%value%"" está protegida y no se puede utilizar." -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","La ruta ""%value%"" no puede incluir accesos de ejecución transversal (""../"", ""..\).""" +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","La ruta ""%value%"" no puede incluir accesos de ejecución transversal (""../"", ""..\")." "Please define flag code.","Defina el código de marcado." "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Introduzca 6 o más caracteres. Se ignorarán los espacios antes o después." "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Por favor, introduzca 7 o más caracteres. La contraseña tiene que contener tanto caracteres numéricos como alfabéticos." @@ -250,7 +250,7 @@ "Profiler","Motor de perfiles" "Recovery Link Expiration Interval (days)","Periodo de caducidad del enlace de recuperación (días)" "Request Path for Specified Store","Solicitar ruta para la tienda especificada" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","El fichero solicitado no puede incluir accesos de ejecución tranversal (""../"", ""..\ notación)""" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","El fichero solicitado no puede incluir accesos de ejecución tranversal (""../"", ""..\" notación)" "Requested invalid store ""%s""","Solicitada tienda ""%s"" no válida" "Resource is not set.","No se estableció el recurso." "Retrieve store data","Obtener datos de la tienda" diff --git a/app/code/Magento/Core/i18n/fr_FR.csv b/app/code/Magento/Core/i18n/fr_FR.csv index c838b5da378be..a3f06ffb32255 100644 --- a/app/code/Magento/Core/i18n/fr_FR.csv +++ b/app/code/Magento/Core/i18n/fr_FR.csv @@ -46,7 +46,7 @@ "Cache storage may contain additional data. Are you sure that you want flush it?","La mémoire cache peut contenir d'autres données. Êtes-vous sûr de vouloir la supprimer ?" "Can not create invoice. Order was not found.","Impossible de créer la facture. La commande est introuvable." "Can't retrieve request object","Ne peut extraire objet de requête" -"Can\'t retrieve entity config: %s","Ne peut pas récupérer la configuration de l'entité : %s" +"Can't retrieve entity config: %s","Ne peut pas récupérer la configuration de l'entité : %s" "Cancel","Annuler" "Cannot complete this operation from non-admin area.","Ne peut compléter cette opération depuis une zone non-admin." "Card type does not match credit card number.","Le type de la carte ne correspond pas au numéro de la carte de crédit." @@ -155,7 +155,7 @@ "Invalid messages storage ""%s"" for layout messages initialization","Messages invalides mémoire ""%s"" pour l'initialisation des messages de mise en page" "Invalid query","Requête invalide" "Invalid transactional email code: ","Code email de transaction invalide:" -"Invalid website\'s configuration path: %s","Chemin de configuration du site invalide: %s" +"Invalid website's configuration path: %s","Chemin de configuration du site invalide: %s" "JavaScript Settings","Réglages javascript" "Layout","Disposition" "Leave empty for access from any location.","Laisser vide pour accéder depuis n'importe où" @@ -197,7 +197,7 @@ "Parent directory does not exist: %s","Le répertoire parental n'existe pas : %s" "Path ""%value%"" is not available and cannot be used.","Le chemin ""%value%"" est indisponible et ne peut être utilisé." "Path ""%value%"" is protected and cannot be used.","Le chemin ""%value%"" est protégé et ne peut pas être utilisé." -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","Il se peut que le chemin ""%value%"" ne contienne pas de traversée de répertoire parent (""../"", ""..\"")." +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","Il se peut que le chemin ""%value%"" ne contienne pas de traversée de répertoire parent (""../"", ""..\")." "Please define flag code.","Veuillez définir le code drapeau." "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Veuillez entrer 6 caractères ou plus. Des espaces en début ou en fin seront ignorés." "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Veuillez entrer 7 caractères ou plus. Le mot de passe doit contenir des lettres et des chiffres." @@ -250,7 +250,7 @@ "Profiler","Profiler" "Recovery Link Expiration Interval (days)","Délai d'expiration du lien de récupération (jours)" "Request Path for Specified Store","Demander le chemin pour un magasin spécifique" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Il se peut que le fichier demandé ne contienne pas de traversée de répertoire parent (notation ""../"", ""..\"")" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","Il se peut que le fichier demandé ne contienne pas de traversée de répertoire parent (notation ""../"", ""..\")" "Requested invalid store ""%s""","Magasin demandé non valide ""%s""" "Resource is not set.","La ressource n'est pas réglée." "Retrieve store data","Récupérer les données du magasin" diff --git a/app/code/Magento/Core/i18n/nl_NL.csv b/app/code/Magento/Core/i18n/nl_NL.csv index 4c33382551668..22cb4d194c91b 100644 --- a/app/code/Magento/Core/i18n/nl_NL.csv +++ b/app/code/Magento/Core/i18n/nl_NL.csv @@ -46,7 +46,7 @@ "Cache storage may contain additional data. Are you sure that you want flush it?","Cache opslag kan toevoegende data bevatten. Weet u zeker dat u het wilt verwijderen?" "Can not create invoice. Order was not found.","Kan geen rekening maken. Bestelling is niet gevonden." "Can't retrieve request object","Kan gevraagde object niet vinden." -"Can\'t retrieve entity config: %s","Kan geen entiteit configuratie %s verkrijgen." +"Can't retrieve entity config: %s","Kan geen entiteit configuratie %s verkrijgen." "Cancel","annuleer" "Cannot complete this operation from non-admin area.","Kan deze operatie vanuit geen-admin gedeelte niet voltooien." "Card type does not match credit card number.","Kaarttype komt niet overeen met het nummer van de credit card." @@ -155,7 +155,7 @@ "Invalid messages storage ""%s"" for layout messages initialization","Ongeldige berichten opgeslagen ""%s"" voor layout bericht initialisatie" "Invalid query","Ongeldige zoekopdracht" "Invalid transactional email code: ","Ongeldige transactie email code:" -"Invalid website\'s configuration path: %s","Ongeldig website configuratie pad: %s" +"Invalid website's configuration path: %s","Ongeldig website configuratie pad: %s" "JavaScript Settings","JavaScript Instellingen" "Layout","layout" "Leave empty for access from any location.","Laat leeg voor toegang vanaf iedere locatie." @@ -197,7 +197,7 @@ "Parent directory does not exist: %s","Hoofd pad bestaat niet: %s" "Path ""%value%"" is not available and cannot be used.","Pad ""%value%"" is niet beschikbaar en kan niet gebruikt worden." "Path ""%value%"" is protected and cannot be used.","Pad ""%value%"" is beschermd en kan niet worden gebruikt." -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","Pad ""%value%"" mag geen parent directory traversal bevatten (""../"", ""..\\).""" +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","Pad ""%value%"" mag geen parent directory traversal bevatten (""../"", ""..\")." "Please define flag code.","Definieer a.u.b. de vlagcode" "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Voer 6 of meer karakters in a.u.b. Spaties worden genegeerd." "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Geef 7 of meer karakters in. Wachtwoord moet zowel cijfers als letters bevatten." @@ -250,7 +250,7 @@ "Profiler","Profiler" "Recovery Link Expiration Interval (days)","Herstel Link Verloop Periode (dagen)" "Request Path for Specified Store","Gevraagd Pad voor Gespecificeerde Winkel" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Opgevraagd bestand mag geen ouder-directory traverse (""../"", ""..\\ notatie)"" bevatten" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","Opgevraagd bestand mag geen ouder-directory traverse (""../"", ""..\" notatie) bevatten" "Requested invalid store ""%s""","Gevraagde ongeldige winkel ""%s""" "Resource is not set.","Bron is niet ingesteld" "Retrieve store data","Winkeldata ophalen" diff --git a/app/code/Magento/Core/i18n/pt_BR.csv b/app/code/Magento/Core/i18n/pt_BR.csv index 76060da0892ff..0d3821d22f278 100644 --- a/app/code/Magento/Core/i18n/pt_BR.csv +++ b/app/code/Magento/Core/i18n/pt_BR.csv @@ -48,7 +48,7 @@ local até que o processo de sincronização esteja completo." "Cache storage may contain additional data. Are you sure that you want flush it?","Armazenamento na cache pode conter dados adicionais. Tem certeza de que deseja eliminá-lo?" "Can not create invoice. Order was not found.","Não é possível criar fatura. Ordem não foi encontrada." "Can't retrieve request object","Não é possível recuperar objeto do pedido" -"Can\'t retrieve entity config: %s","Não é possível recuperar configuração da entidade: %s" +"Can't retrieve entity config: %s","Não é possível recuperar configuração da entidade: %s" "Cancel","Cancelar" "Cannot complete this operation from non-admin area.","Não é possível concluir esta operação de área não administrativa." "Card type does not match credit card number.","Tipo de cartão não corresponde ao número de cartão de crédito." @@ -157,7 +157,7 @@ local até que o processo de sincronização esteja completo." "Invalid messages storage ""%s"" for layout messages initialization","Mensagens de armazenamento ""%s"" inválidas para inicialização de mensagens do plano" "Invalid query","Consulta inválida" "Invalid transactional email code: ","Código de email transacional inválido:" -"Invalid website\'s configuration path: %s","Caminho de configuração do site inválido: %s" +"Invalid website's configuration path: %s","Caminho de configuração do site inválido: %s" "JavaScript Settings","Configurações JavaScript" "Layout","Layout" "Leave empty for access from any location.","Deixe em branco para o acesso de qualquer local." @@ -199,7 +199,7 @@ local até que o processo de sincronização esteja completo." "Parent directory does not exist: %s","Diretório principal não existe: %s" "Path ""%value%"" is not available and cannot be used.","Caminho ""%valor%"" não está disponível e não pode ser usado." "Path ""%value%"" is protected and cannot be used.","Caminho ""%valor%"" é protegido e não pode ser usado." -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","Caminho ""%valor%"" não pode incluir passagem pelo diretório principal (""../"", ""..\\).""" +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","Caminho ""%valor%"" não pode incluir passagem pelo diretório principal (""../"", ""..\")." "Please define flag code.","Por favor defina o código bandeira." "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Por favor insira 6 ou mais caracteres. Espaços à esquerda ou à direita serão ignorados." "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Por favor insira 7 ou mais caracteres. Senha deve conter caracteres numéricos e alfabéticos." @@ -252,7 +252,7 @@ local até que o processo de sincronização esteja completo." "Profiler","Gerador de Perfil" "Recovery Link Expiration Interval (days)","Perído de validade do link de recuperação (dias)" "Request Path for Specified Store","Solicitar Caminho para o Armazenamento Especificado" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Arquivo solicitado pode não incluir diretório parental de passagem (""../"", ""..\\ notação)""" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","Arquivo solicitado pode não incluir diretório parental de passagem (""../"", ""..\" notação)" "Requested invalid store ""%s""","Armazenamento solicitado Inválido ""%s""" "Resource is not set.","Recurso não definido." "Retrieve store data","Recuperar dados da loja" diff --git a/app/code/Magento/Core/i18n/zh_CN.csv b/app/code/Magento/Core/i18n/zh_CN.csv index 64a3e96fbac4f..b6a4ba9e18b4a 100644 --- a/app/code/Magento/Core/i18n/zh_CN.csv +++ b/app/code/Magento/Core/i18n/zh_CN.csv @@ -46,7 +46,7 @@ "Cache storage may contain additional data. Are you sure that you want flush it?","缓存存储可能包含额外数据。您确认要清空它吗?" "Can not create invoice. Order was not found.","无法创建发票。未找到订单。" "Can't retrieve request object","无法获取请求对象" -"Can\'t retrieve entity config: %s","无法获取实体配置:%s" +"Can't retrieve entity config: %s","无法获取实体配置:%s" "Cancel","取消" "Cannot complete this operation from non-admin area.","无法从非管理员区域完成该操作。" "Card type does not match credit card number.","信用卡类型与信用卡号不匹配。" @@ -155,7 +155,7 @@ "Invalid messages storage ""%s"" for layout messages initialization","对布局消息初始化中无效的消息存储“%s”" "Invalid query","无效的查询" "Invalid transactional email code: ","无效的交易电子邮件代码:" -"Invalid website\'s configuration path: %s","无效的网站配置路径:%s" +"Invalid website's configuration path: %s","无效的网站配置路径:%s" "JavaScript Settings","JavaScript 设置" "Layout","布局" "Leave empty for access from any location.","从任何位置访问留空。" @@ -197,7 +197,7 @@ "Parent directory does not exist: %s","父目录不存在:%s" "Path ""%value%"" is not available and cannot be used.","路径 ""%value%"" 不可用,因此无法使用。" "Path ""%value%"" is protected and cannot be used.","路径 ""%value%"" 受保护,无法使用。" -"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","路径 ""%value%"" 可能不包含父目录遍历 (""../"", ""..\\).""" +"Path ""%value%"" may not include parent directory traversal (""../"", ""..\").","路径 ""%value%"" 可能不包含父目录遍历 (""../"", ""..\")." "Please define flag code.","请定义旗帜代码。" "Please enter 6 or more characters. Leading or trailing spaces will be ignored.","请输入六个或更多字符。开头或结尾处的空格会被忽略。" "Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","请输入至少7个字符。密码应包含数字与字母。" @@ -250,7 +250,7 @@ "Profiler","配置文件" "Recovery Link Expiration Interval (days)","恢复链接过期周期(天)" "Request Path for Specified Store","特殊店铺的请求路径" -"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","所请求的文件可能没有包含在父目录遍历中 (""../"", ""..\\ notation)""" +"Requested file may not include parent directory traversal (""../"", ""..\" notation)","所请求的文件可能没有包含在父目录遍历中 (""../"", ""..\" notation)" "Requested invalid store ""%s""","请求了无效店铺 ""%s""" "Resource is not set.","资源未设置。" "Retrieve store data","检索商店数据" diff --git a/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php b/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php index 54b071057125a..326aad789c911 100644 --- a/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php +++ b/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php @@ -56,8 +56,8 @@ class Alert extends \Magento\Core\Model\Config\Value protected $_runModelPath = ''; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory @@ -67,8 +67,8 @@ class Alert extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, diff --git a/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php b/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php index c01551eaa23fa..53b6c5a703bcb 100644 --- a/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php +++ b/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php @@ -56,8 +56,8 @@ class Sitemap extends \Magento\Core\Model\Config\Value protected $_runModelPath = ''; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory @@ -67,8 +67,8 @@ class Sitemap extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, diff --git a/app/code/Magento/Cron/Model/Config/Source/Frequency.php b/app/code/Magento/Cron/Model/Config/Source/Frequency.php index 33e90942e8e98..c6450a34f0c20 100644 --- a/app/code/Magento/Cron/Model/Config/Source/Frequency.php +++ b/app/code/Magento/Cron/Model/Config/Source/Frequency.php @@ -27,7 +27,7 @@ namespace Magento\Cron\Model\Config\Source; -class Frequency implements \Magento\Core\Model\Option\ArrayInterface +class Frequency implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Cron/Model/Schedule.php b/app/code/Magento/Cron/Model/Schedule.php index 4d798b6de6fca..951501b05fea0 100644 --- a/app/code/Magento/Cron/Model/Schedule.php +++ b/app/code/Magento/Cron/Model/Schedule.php @@ -66,16 +66,16 @@ class Schedule extends \Magento\Core\Model\AbstractModel protected $_date; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Date $date * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Date $date, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency.php b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency.php index 2c642e25910f3..d7189e52cba61 100644 --- a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency.php +++ b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency.php @@ -38,17 +38,17 @@ class Currency extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit.php b/app/code/Magento/Customer/Block/Adminhtml/Edit.php index 558a52328eea5..7522db41be9f1 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit.php @@ -38,18 +38,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php index 915e30d6b7013..714c41f4abe04 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php @@ -48,20 +48,20 @@ class Group /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Customer\Helper\Address $customerAddress, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php index 64e950c138111..a7462de733dd3 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php @@ -67,7 +67,7 @@ class Account extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Customer\Model\FormFactory $customerFactory @@ -77,7 +77,7 @@ class Account extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Customer\Model\FormFactory $customerFactory, diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php index 6cb63bba68b29..57f2c09a5810f 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php @@ -66,7 +66,7 @@ class Addresses extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Json\EncoderInterface $jsonEncoder @@ -83,7 +83,7 @@ class Addresses extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Helper\Data $coreData, \Magento\Json\EncoderInterface $jsonEncoder, diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php index 41f0bead10dfb..2cbc55688662c 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php @@ -41,7 +41,7 @@ class Cart extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -60,7 +60,7 @@ class Cart extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Data\CollectionFactory $dataCollectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -68,7 +68,7 @@ public function __construct( \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Data\CollectionFactory $dataCollectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_dataCollectionFactory = $dataCollectionFactory; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php index 628f6c34926e0..10b23f93f8aad 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php @@ -35,18 +35,18 @@ class Carts extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php index ea485ac551a29..039cc3eb186d4 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php @@ -44,14 +44,14 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, array $data = array() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php index e48a50a07a361..85d51997c1b16 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php @@ -38,7 +38,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,14 +51,14 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid/Renderer/Action.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid/Renderer/Action.php index ea50e48dffd5e..8ed79b883ccb1 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid/Renderer/Action.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid/Renderer/Action.php @@ -38,18 +38,18 @@ class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php index 366135c44f4c5..48b8c2b819975 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php @@ -41,11 +41,11 @@ class Orders extends \Magento\Backend\Block\Widget\Grid\Extended * @var \Magento\Sales\Helper\Reorder */ protected $_salesReorder = null; - + /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -59,7 +59,7 @@ class Orders extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory * @param \Magento\Sales\Helper\Reorder $salesReorder - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -67,7 +67,7 @@ public function __construct( \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory, \Magento\Sales\Helper\Reorder $salesReorder, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php index 83198e812a2c9..101e60094dc9a 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php @@ -46,7 +46,7 @@ class View /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -74,7 +74,7 @@ class View * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param \Magento\Log\Model\CustomerFactory $logFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Log\Model\Visitor $modelVisitor * @param \Magento\Stdlib\DateTime $dateTime * @param array $data @@ -83,7 +83,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, \Magento\Log\Model\CustomerFactory $logFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Log\Model\Visitor $modelVisitor, \Magento\Stdlib\DateTime $dateTime, array $data = array() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php index 4079a5918753b..8758a1a9f824a 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php @@ -38,7 +38,7 @@ class Accordion extends \Magento\Backend\Block\Widget\Accordion /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -56,14 +56,14 @@ class Accordion extends \Magento\Backend\Block\Widget\Accordion * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $itemsFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Wishlist\Model\Resource\Item\CollectionFactory $itemsFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php index 13592e72bacbf..7aabf99eb3052 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php @@ -41,7 +41,7 @@ class Cart extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -60,7 +60,7 @@ class Cart extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Data\CollectionFactory $dataCollectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -68,7 +68,7 @@ public function __construct( \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Data\CollectionFactory $dataCollectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_dataCollectionFactory = $dataCollectionFactory; @@ -95,7 +95,12 @@ protected function _prepareCollection() if ($this->getWebsiteId()) { $quote->setWebsite($this->_storeManager->getWebsite($this->getWebsiteId())); } - $quote->loadByCustomer($this->_coreRegistry->registry('current_customer')); + + /** @var \Magento\Customer\Model\Customer $currentCustomer */ + $currentCustomer = $this->_coreRegistry->registry('current_customer'); + if (!is_null($currentCustomer)) { + $quote->loadByCustomer($currentCustomer->getId()); + } if ($quote) { $collection = $quote->getItemsCollection(false); diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php index 842c508245385..f53ebc888fb24 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php @@ -38,7 +38,7 @@ class Orders extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,14 +51,14 @@ class Orders extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php index 58b5f7e846ffc..e21b631e2b74f 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php @@ -56,7 +56,7 @@ class Sales extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -74,14 +74,14 @@ class Sales extends \Magento\Backend\Block\Template * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Sales\Model\Resource\Sale\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Sales\Model\Resource\Sale\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; @@ -101,8 +101,11 @@ public function _beforeToHtml() $this->_currency = $this->_currencyFactory->create() ->load($this->_storeConfig->getConfig(\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE)); + $customerId = $this->_coreRegistry->registry('current_customer') + ? $this->_coreRegistry->registry('current_customer')->getId() + : 0; $this->_collection = $this->_collectionFactory->create() - ->setCustomerFilter($this->_coreRegistry->registry('current_customer')) + ->setCustomerFilter($customerId) ->setOrderStateFilter(\Magento\Sales\Model\Order::STATE_CANCELED, true) ->load(); diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php index c0e0567366c9c..c5694f36c3aac 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php @@ -38,7 +38,7 @@ class Wishlist extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,14 +51,14 @@ class Wishlist extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Wishlist\Model\Resource\Item\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php index 81acf1f765537..ff408a82e72fa 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php @@ -34,7 +34,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -42,14 +42,14 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php index 275b93ad43a7e..349dd3e0db47b 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php @@ -34,7 +34,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -45,13 +45,13 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, array $data = array() ) { diff --git a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php index b61f3869d9ac2..3217b72a543dc 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php @@ -42,14 +42,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer, array $data = array() diff --git a/app/code/Magento/Customer/Controller/Account.php b/app/code/Magento/Customer/Controller/Account.php index e8c2f15923b17..4bfe575994c04 100644 --- a/app/code/Magento/Customer/Controller/Account.php +++ b/app/code/Magento/Customer/Controller/Account.php @@ -63,7 +63,7 @@ class Account extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -132,7 +132,7 @@ class Account extends \Magento\App\Action\Action /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\UrlFactory $urlFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -150,7 +150,7 @@ class Account extends \Magento\App\Action\Action */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\UrlFactory $urlFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group.php b/app/code/Magento/Customer/Controller/Adminhtml/Group.php index 26cf4bd51ccf9..a863a573415e8 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group.php @@ -36,7 +36,7 @@ class Group extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -44,7 +44,7 @@ class Group extends \Magento\Backend\App\Action * @var \Magento\Customer\Service\V1\CustomerGroupServiceInterface */ protected $_groupService; - + /** * @var \Magento\Customer\Service\V1\Dto\CustomerGroupBuilder */ @@ -52,13 +52,13 @@ class Group extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param \Magento\Customer\Service\V1\Dto\CustomerGroupBuilder $customerGroupBuilder */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, \Magento\Customer\Service\V1\Dto\CustomerGroupBuilder $customerGroupBuilder ) { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index.php b/app/code/Magento/Customer/Controller/Adminhtml/Index.php index 163b217c047d6..8a937768c28bb 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index.php @@ -37,7 +37,7 @@ class Index extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -74,7 +74,7 @@ class Index extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\Response\Http\FileFactory $fileFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Customer\Model\AddressFactory $addressFactory @@ -82,7 +82,7 @@ class Index extends \Magento\Backend\App\Action */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\Response\Http\FileFactory $fileFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Customer\Model\AddressFactory $addressFactory, @@ -313,7 +313,7 @@ public function saveAction() } // Done Saving customer, finish save action - $this->_objectManager->get('Magento\Core\Model\Registry') + $this->_objectManager->get('Magento\Registry') ->register(self::REGISTRY_CURRENT_CUSTOMER, $customer); $this->messageManager->addSuccess(__('You saved the customer.')); diff --git a/app/code/Magento/Customer/Helper/Data.php b/app/code/Magento/Customer/Helper/Data.php index 7d305ab1194d7..c0aeaa3a15926 100644 --- a/app/code/Magento/Customer/Helper/Data.php +++ b/app/code/Magento/Customer/Helper/Data.php @@ -113,8 +113,16 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_customerAddress = null; /** - * Core store config - * + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @var \Magento\Customer\Model\Config\Share + */ + protected $_configShare; + + /** * @var \Magento\Core\Model\Store\Config */ protected $_coreStoreConfig; @@ -148,16 +156,13 @@ class Data extends \Magento\App\Helper\AbstractHelper * @var \Magento\Math\Random */ protected $mathRandom; - - /** - * @var \Magento\Customer\Model\Converter - */ - protected $_converter; /** * @param \Magento\App\Helper\Context $context * @param \Magento\Customer\Helper\Address $customerAddress * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Customer\Model\Config\Share $configShare * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\ConfigInterface $coreConfig * @param \Magento\Customer\Model\Session $customerSession @@ -165,23 +170,25 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Customer\Model\FormFactory $formFactory * @param \Magento\Escaper $escaper * @param \Magento\Math\Random $mathRandom - * @param \Magento\Customer\Model\Converter */ public function __construct( \Magento\App\Helper\Context $context, \Magento\Customer\Helper\Address $customerAddress, \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Customer\Model\Config\Share $configShare, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\ConfigInterface $coreConfig, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, \Magento\Customer\Model\FormFactory $formFactory, \Magento\Escaper $escaper, - \Magento\Math\Random $mathRandom, - \Magento\Customer\Model\Converter $converter + \Magento\Math\Random $mathRandom ) { $this->_customerAddress = $customerAddress; $this->_coreData = $coreData; + $this->_storeManager = $storeManager; + $this->_configShare = $configShare; $this->_coreStoreConfig = $coreStoreConfig; $this->_coreConfig = $coreConfig; $this->_customerSession = $customerSession; @@ -189,7 +196,6 @@ public function __construct( $this->_formFactory = $formFactory; $this->_escaper = $escaper; $this->mathRandom = $mathRandom; - $this->_converter = $converter; parent::__construct($context); } @@ -786,17 +792,36 @@ protected function _createForm() return $this->_formFactory->create(); } + /** - * Loads the values from a customer model. - * This is a wrapper for the converter object. + * Check store availability for customer given the customerId * - * TODO to be removed after service refactoring is done + * @param int $customerWebsiteId + * @param int $storeId + * @return bool + */ + public function isCustomerInStore($customerWebsiteId, $storeId) + { + $ids = $this->getSharedStoreIds($customerWebsiteId); + return in_array($storeId, $ids); + } + + /** + * Retrieve shared store ids * - * @param \Magento\Customer\Model\Customer $customerModel - * @return \Magento\Customer\Service\V1\Dto\Customer + * @param int $customerWebsiteId + * @return array */ - public function createCustomerFromModel($customerModel) + public function getSharedStoreIds($customerWebsiteId) { - return $this->_converter->createCustomerFromModel($customerModel); + $ids = array(); + if ((bool)$this->_configShare->isWebsiteScope()) { + $ids = $this->_storeManager->getWebsite($customerWebsiteId)->getStoreIds(); + } else { + foreach ($this->_storeManager->getStores() as $store) { + $ids[] = $store->getId(); + } + } + return $ids; } } diff --git a/app/code/Magento/Customer/Model/Address.php b/app/code/Magento/Customer/Model/Address.php index 4165b79e5662b..0564df6394dfb 100644 --- a/app/code/Magento/Customer/Model/Address.php +++ b/app/code/Magento/Customer/Model/Address.php @@ -47,8 +47,8 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_customerFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig @@ -60,8 +60,8 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index c6e61d2d1c3a4..1c03bf1e9412a 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Customer\Model\Address; + /** * Address abstract model * @@ -33,9 +35,11 @@ * @method string getMiddlename() * @method string getLastname() * @method int getCountryId() + * @method string getCity() + * @method string getTelephone() + * @method string getPostcode() + * @method bool getShouldIgnoreValidation() */ -namespace Magento\Customer\Model\Address; - class AbstractAddress extends \Magento\Core\Model\AbstractModel { /** @@ -100,8 +104,8 @@ class AbstractAddress extends \Magento\Core\Model\AbstractModel protected $_countryFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig @@ -112,8 +116,8 @@ class AbstractAddress extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, @@ -439,7 +443,7 @@ protected function _beforeSave() /** * Validate address attribute values * - * @return bool + * @return bool|array */ public function validate() { diff --git a/app/code/Magento/Customer/Model/Address/Converter.php b/app/code/Magento/Customer/Model/Address/Converter.php new file mode 100644 index 0000000000000..e0933690ba997 --- /dev/null +++ b/app/code/Magento/Customer/Model/Address/Converter.php @@ -0,0 +1,163 @@ +_addressBuilder = $addressBuilder; + $this->_addressFactory = $addressFactory; + $this->_regionBuilder = $regionBuilder; + } + + /** + * Creates an address model out of an address DTO. + * + * @param Address $addressDto + * @return AddressModel + */ + public function createAddressModel(Address $addressDto) + { + $addressModel = $this->_addressFactory->create(); + $this->updateAddressModel($addressModel, $addressDto); + + return $addressModel; + } + + /** + * Updates an Address Model based on information from an Address DTO. + * + * @param AddressModel $addressModel + * @param Address $address + * return null + */ + public function updateAddressModel(AddressModel $addressModel, Address $address) + { + // Set all attributes + foreach ($address->getAttributes() as $attributeCode => $attributeData) { + if (Address::KEY_REGION == $attributeCode && $address->getRegion() instanceof Region) { + $addressModel->setDataUsingMethod(Address::KEY_REGION, $address->getRegion()->getRegion()); + $addressModel->setDataUsingMethod('region_code', $address->getRegion()->getRegionCode()); + $addressModel->setDataUsingMethod(Address::KEY_REGION_ID, $address->getRegion()->getRegionId()); + } else { + $addressModel->setDataUsingMethod($attributeCode, $attributeData); + } + } + // Set customer related data + $isBilling = $address->isDefaultBilling(); + $addressModel->setIsDefaultBilling($isBilling); + $addressModel->setIsDefaultShipping($address->isDefaultShipping()); + // Need to use attribute set or future updates can cause data loss + if (!$addressModel->getAttributeSetId()) { + $addressModel->setAttributeSetId(CustomerMetadataServiceInterface::ATTRIBUTE_SET_ID_ADDRESS); + } + } + + /** + * Make address DTO out of an address model + * + * @param AddressModel $addressModel + * @param int $defaultBillingId + * @param int $defaultShippingId + * @return Address + */ + public function createAddressFromModel(AddressModel $addressModel, $defaultBillingId, $defaultShippingId) + { + $addressId = $addressModel->getId(); + $validAttributes = array_merge( + $addressModel->getDefaultAttributeCodes(), + [ + Address::KEY_ID, 'region_id', Address::KEY_REGION, Address::KEY_STREET, 'vat_is_valid', + Address::KEY_DEFAULT_BILLING, Address::KEY_DEFAULT_SHIPPING, 'vat_request_id', 'vat_request_date', + 'vat_request_success' + ] + ); + $addressData = []; + foreach ($addressModel->getAttributes() as $attribute) { + $code = $attribute->getAttributeCode(); + if (!in_array($code, $validAttributes) && $addressModel->getData($code) !== null) { + $addressData[$code] = $addressModel->getData($code); + } + } + + $this->_addressBuilder->populateWithArray(array_merge($addressData, [ + Address::KEY_STREET => $addressModel->getStreet(), + Address::KEY_ID => $addressId, + Address::KEY_DEFAULT_BILLING => $addressId === $defaultBillingId, + Address::KEY_DEFAULT_SHIPPING => $addressId === $defaultShippingId, + Address::KEY_CUSTOMER_ID => $addressModel->getCustomerId(), + Address::KEY_REGION => [ + Region::KEY_REGION => $addressModel->getRegion(), + Region::KEY_REGION_ID => $addressModel->getRegionId(), + Region::KEY_REGION_CODE => $addressModel->getRegionCode() + ] + ])); + + $addressDto = $this->_addressBuilder->create(); + return $addressDto; + } +} diff --git a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php index cf9ec68684b9b..9329c765deecd 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php @@ -39,8 +39,8 @@ class Street extends \Magento\Core\Model\Config\Value protected $_eavConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Eav\Model\Config $eavConfig @@ -49,8 +49,8 @@ class Street extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php b/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php index e4d05453b940e..fae6b81a16ab5 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php @@ -41,8 +41,8 @@ class Customer extends \Magento\Core\Model\Config\Value protected $_eavConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Eav\Model\Config $eavConfig @@ -51,8 +51,8 @@ class Customer extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Customer/Model/Config/Share.php b/app/code/Magento/Customer/Model/Config/Share.php index c4f768c5e4fdc..8afa2d373146f 100644 --- a/app/code/Magento/Customer/Model/Config/Share.php +++ b/app/code/Magento/Customer/Model/Config/Share.php @@ -34,14 +34,14 @@ namespace Magento\Customer\Model\Config; class Share extends \Magento\Core\Model\Config\Value - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * Xml config path to customers sharing scope value * */ const XML_PATH_CUSTOMER_ACCOUNT_SHARE = 'customer/account_share/scope'; - + /** * Possible customer sharing scopes * @@ -64,8 +64,8 @@ class Share extends \Magento\Core\Model\Config\Value /** * Constructor * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -75,8 +75,8 @@ class Share extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Store\Config $coreStoreConfig, diff --git a/app/code/Magento/Customer/Model/Config/Source/Address/Type.php b/app/code/Magento/Customer/Model/Config/Source/Address/Type.php index 5b4b1d02a9fc8..18a12bae3062b 100644 --- a/app/code/Magento/Customer/Model/Config/Source/Address/Type.php +++ b/app/code/Magento/Customer/Model/Config/Source/Address/Type.php @@ -33,7 +33,7 @@ */ namespace Magento\Customer\Model\Config\Source\Address; -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * Retrieve possible customer address types diff --git a/app/code/Magento/Customer/Model/Config/Source/Group.php b/app/code/Magento/Customer/Model/Config/Source/Group.php index f8eaeeb2bc126..4e95a0604bcfb 100644 --- a/app/code/Magento/Customer/Model/Config/Source/Group.php +++ b/app/code/Magento/Customer/Model/Config/Source/Group.php @@ -27,7 +27,7 @@ namespace Magento\Customer\Model\Config\Source; -class Group implements \Magento\Core\Model\Option\ArrayInterface +class Group implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Customer/Model/Config/Source/Group/Multiselect.php b/app/code/Magento/Customer/Model/Config/Source/Group/Multiselect.php index a5fd1261d3a18..082661da17e28 100644 --- a/app/code/Magento/Customer/Model/Config/Source/Group/Multiselect.php +++ b/app/code/Magento/Customer/Model/Config/Source/Group/Multiselect.php @@ -26,7 +26,7 @@ namespace Magento\Customer\Model\Config\Source\Group; -class Multiselect implements \Magento\Core\Model\Option\ArrayInterface +class Multiselect implements \Magento\Option\ArrayInterface { /** * Customer groups options array diff --git a/app/code/Magento/Customer/Model/Converter.php b/app/code/Magento/Customer/Model/Converter.php index 88c8efd75047a..e9fe9bbf70583 100644 --- a/app/code/Magento/Customer/Model/Converter.php +++ b/app/code/Magento/Customer/Model/Converter.php @@ -74,6 +74,8 @@ public function createCustomerFromModel(Customer $customerModel) /** + * Retrieve customer model by his ID. + * * @param int $customerId * @throws NoSuchEntityException If customer with customerId is not found. * @return Customer @@ -90,6 +92,27 @@ public function getCustomerModel($customerId) } } + /** + * Retrieve customer model by his email. + * + * @param string $customerEmail + * @param int $websiteId + * @throws NoSuchEntityException If customer with the specified customer email not found. + * @return Customer + */ + public function getCustomerModelByEmail($customerEmail, $websiteId = null) + { + $customer = $this->_customerFactory->create(); + if (isset($websiteId)) { + $customer->setWebsiteId($websiteId); + } + $customer->loadByEmail($customerEmail); + if (!$customer->getId()) { + throw new NoSuchEntityException('email', $customerEmail); + } else { + return $customer; + } + } /** * Creates a customer model from a customer entity. @@ -118,13 +141,37 @@ public function createCustomerModel(CustomerDto $customer) // Need to use attribute set or future updates can cause data loss if (!$customerModel->getAttributeSetId()) { - $customerModel->setAttributeSetId(CustomerMetadataServiceInterface::CUSTOMER_ATTRIBUTE_SET_ID); - return $customerModel; + $customerModel->setAttributeSetId(CustomerMetadataServiceInterface::ATTRIBUTE_SET_ID_CUSTOMER); } return $customerModel; } + /** + * Update customer model with the data from the data object + * + * @param Customer $customerModel + * @param \Magento\Customer\Service\V1\Dto\Customer $customerData + * @return void + */ + public function updateCustomerModel( + \Magento\Customer\Model\Customer $customerModel, + \Magento\Customer\Service\V1\Dto\Customer $customerData + ) { + $attributes = $customerData->__toArray(); + foreach ($attributes as $attributeCode => $attributeValue) { + $customerModel->setDataUsingMethod($attributeCode, $attributeValue); + } + $customerId = $customerData->getCustomerId(); + if ($customerId) { + $customerModel->setId($customerId); + } + // Need to use attribute set or future calls to customerModel::save can cause data loss + if (!$customerModel->getAttributeSetId()) { + $customerModel->setAttributeSetId(CustomerMetadataServiceInterface::ATTRIBUTE_SET_ID_CUSTOMER); + } + } + /** * Loads the values from a customer model * @@ -134,13 +181,18 @@ public function createCustomerModel(CustomerDto $customer) protected function _populateBuilderWithAttributes(Customer $customerModel) { $attributes = []; + $systemAttributes = ['entity_type_id', 'attribute_set_id']; foreach ($customerModel->getAttributes() as $attribute) { $attrCode = $attribute->getAttributeCode(); - $value = $customerModel->getData($attrCode); - if (null == $value) { + $value = $customerModel->getDataUsingMethod($attrCode); + if (null === $value || in_array($attrCode, $systemAttributes)) { continue; } - $attributes[$attrCode] = $value; + if ($attrCode == 'entity_id') { + $attributes[\Magento\Customer\Service\V1\Dto\Customer::ID] = $value; + } else { + $attributes[$attrCode] = $value; + } } return $this->_customerBuilder->populateWithArray($attributes); diff --git a/app/code/Magento/Customer/Model/Customer.php b/app/code/Magento/Customer/Model/Customer.php index 24c9746daa626..734c868614d94 100644 --- a/app/code/Magento/Customer/Model/Customer.php +++ b/app/code/Magento/Customer/Model/Customer.php @@ -26,6 +26,8 @@ namespace Magento\Customer\Model; +use Magento\Customer\Service\V1\Dto\CustomerBuilder as CustomerDtoBuilder; + /** * Customer model * @@ -37,6 +39,8 @@ * @method mixed getDisableAutoGroupChange() * @method \Magento\Customer\Model\Customer setDisableAutoGroupChange($value) * @method \Magento\Customer\Model\Customer setGroupId($value) + * @method \Magento\Customer\Model\Customer setDefaultBilling($value) + * @method \Magento\Customer\Model\Customer setDefaultShipping($value) */ class Customer extends \Magento\Core\Model\AbstractModel { @@ -51,7 +55,6 @@ class Customer extends \Magento\Core\Model\AbstractModel const XML_PATH_RESET_PASSWORD_TEMPLATE = 'customer/password/reset_password_template'; - const XML_PATH_DEFAULT_EMAIL_DOMAIN = 'customer/create_account/email_domain'; const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm'; const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template'; const XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template'; @@ -119,9 +122,6 @@ class Customer extends \Magento\Core\Model\AbstractModel */ protected $_isReadonly = false; - /** @var \Magento\Email\Model\Sender */ - protected $_sender; - /** @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -156,14 +156,9 @@ class Customer extends \Magento\Core\Model\AbstractModel protected $_addressesFactory; /** - * @var \Magento\Email\Model\Template\MailerFactory - */ - protected $_mailerFactory; - - /** - * @var \Magento\Email\Model\InfoFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_emailInfoFactory; + protected $_transportBuilder; /** * @var \Magento\Customer\Model\AttributeFactory @@ -191,10 +186,14 @@ class Customer extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @var CustomerDtoBuilder + */ + protected $_customerDtoBuilder; + + /** + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Customer\Helper\Data $customerData - * @param \Magento\Email\Model\Sender $sender * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -202,21 +201,20 @@ class Customer extends \Magento\Core\Model\AbstractModel * @param Config\Share $configShare * @param AddressFactory $addressFactory * @param Resource\Address\CollectionFactory $addressesFactory - * @param \Magento\Email\Model\Template\MailerFactory $mailerFactory - * @param \Magento\Email\Model\InfoFactory $emailInfoFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param AttributeFactory $attributeFactory * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Math\Random $mathRandom * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Data\Collection\Db $resourceCollection + * @param CustomerDtoBuilder $customerDtoBuilder * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Customer\Helper\Data $customerData, - \Magento\Email\Model\Sender $sender, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $config, \Magento\Core\Model\Store\Config $coreStoreConfig, @@ -224,31 +222,30 @@ public function __construct( \Magento\Customer\Model\Config\Share $configShare, \Magento\Customer\Model\AddressFactory $addressFactory, \Magento\Customer\Model\Resource\Address\CollectionFactory $addressesFactory, - \Magento\Email\Model\Template\MailerFactory $mailerFactory, - \Magento\Email\Model\InfoFactory $emailInfoFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, \Magento\Customer\Model\AttributeFactory $attributeFactory, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Math\Random $mathRandom, \Magento\Stdlib\DateTime $dateTime, \Magento\Data\Collection\Db $resourceCollection = null, + CustomerDtoBuilder $customerDtoBuilder, array $data = array() ) { $this->_customerData = $customerData; $this->_coreStoreConfig = $coreStoreConfig; - $this->_sender = $sender; $this->_storeManager = $storeManager; $this->_config = $config; $this->_configShare = $configShare; $this->_addressFactory = $addressFactory; $this->_addressesFactory = $addressesFactory; - $this->_mailerFactory = $mailerFactory; - $this->_emailInfoFactory = $emailInfoFactory; + $this->_transportBuilder = $transportBuilder; $this->_groupService = $groupService; $this->_attributeFactory = $attributeFactory; $this->_encryptor = $encryptor; $this->mathRandom = $mathRandom; $this->dateTime = $dateTime; + $this->_customerDtoBuilder = $customerDtoBuilder; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -330,6 +327,24 @@ protected function _beforeSave() return $this; } + /** + * {@inheritdoc} + */ + protected function _afterSave() + { + $customerData = (array)$this->getData(); + $customerData[\Magento\Customer\Service\V1\Dto\Customer::ID] = $this->getId(); + $dataDto = $this->_customerDtoBuilder->populateWithArray($customerData)->create(); + $customerOrigData = (array)$this->getOrigData(); + $customerOrigData[\Magento\Customer\Service\V1\Dto\Customer::ID] = $this->getId(); + $origDataDto = $this->_customerDtoBuilder->populateWithArray($customerOrigData)->create(); + $this->_eventManager->dispatch( + 'customer_save_after_dto', + array('customer_dto' => $dataDto, 'orig_customer_dto' => $origDataDto) + ); + return parent::_afterSave(); + } + /** * Change customer password * @@ -694,7 +709,7 @@ public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeI } $this->_sendEmailTemplate($types[$type], self::XML_PATH_REGISTER_EMAIL_IDENTITY, - array('customer' => $this, 'back_url' => $backUrl), $storeId); + array('customer' => $this, 'back_url' => $backUrl, 'store' => $this->getStore()), $storeId); return $this; } @@ -732,7 +747,7 @@ public function getRandomConfirmationKey() public function sendPasswordReminderEmail() { $this->_sendEmailTemplate(self::XML_PATH_REMIND_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY, - array('customer' => $this), $this->getStoreId()); + array('customer' => $this, 'store' => $this->getStore()), $this->getStoreId()); return $this; } @@ -748,18 +763,19 @@ public function sendPasswordReminderEmail() */ protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null) { - /** @var $mailer \Magento\Email\Model\Template\Mailer */ - $mailer = $this->_createMailer(); - $emailInfo = $this->_createEmailInfo(); - $emailInfo->addTo($this->getEmail(), $this->getName()); - $mailer->addEmailInfo($emailInfo); - - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig($sender, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($this->_coreStoreConfig->getConfig($template, $storeId)); - $mailer->setTemplateParams($templateParams); - $mailer->send(); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder + ->setTemplateIdentifier($this->_coreStoreConfig->getConfig($template, $storeId)) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars($templateParams) + ->setFrom($this->_coreStoreConfig->getConfig($sender, $storeId)) + ->addTo($this->getEmail(), $this->getName()) + ->getTransport(); + $transport->sendMessage(); + return $this; } @@ -776,7 +792,7 @@ public function sendPasswordResetConfirmationEmail() } $this->_sendEmailTemplate(self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY, - array('customer' => $this), $storeId + array('customer' => $this, 'store' => $this->getStore()), $storeId ); return $this; @@ -794,14 +810,21 @@ public function sendPasswordResetNotificationEmail() $storeId = $this->_getWebsiteStoreId(); } - $this->_sender->send( - $this->getEmail(), - $this->getName(), - self::XML_PATH_RESET_PASSWORD_TEMPLATE, - self::XML_PATH_FORGOT_EMAIL_IDENTITY, - array('customer' => $this), - $storeId - ); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder + ->setTemplateIdentifier( + $this->_coreStoreConfig->getConfig(self::XML_PATH_RESET_PASSWORD_TEMPLATE, $storeId) + ) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array('customer' => $this, 'store' => $this->getStore())) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_FORGOT_EMAIL_IDENTITY, $storeId)) + ->addTo($this->getEmail(), $this->getName()) + ->getTransport(); + $transport->sendMessage(); + return $this; } @@ -834,24 +857,6 @@ public function getTaxClassId() return $this->getData('tax_class_id'); } - /** - * Check store availability for customer - * - * @param \Magento\Core\Model\Store | int $store - * @return bool - */ - public function isInStore($store) - { - if ($store instanceof \Magento\Core\Model\Store) { - $storeId = $store->getId(); - } else { - $storeId = $store; - } - - $availableStores = $this->getSharedStoreIds(); - return in_array($storeId, $availableStores); - } - /** * Retrieve store where customer was created * @@ -865,6 +870,7 @@ public function getStore() /** * Retrieve shared store ids * + * @deprecated Use \Magento\Customer\Helper\Data::getSharedStoreIds * @return array */ public function getSharedStoreIds() @@ -1024,7 +1030,8 @@ public function resetErrors() */ protected function _beforeDelete() { - $this->_protectFromNonAdmin(); + //TODO : Revisit and figure handling permissions in MAGETWO-11084 Implementation: Service Context Provider + //$this->_protectFromNonAdmin(); return parent::_beforeDelete(); } @@ -1234,22 +1241,6 @@ protected function _createAddressCollection() return $this->_addressesFactory->create(); } - /** - * @return \Magento\Email\Model\Template\Mailer - */ - protected function _createMailer() - { - return $this->_mailerFactory->create(); - } - - /** - * @return \Magento\Email\Model\Info - */ - protected function _createEmailInfo() - { - return $this->_emailInfoFactory->create(); - } - /** * @return \Magento\Customer\Model\Attribute */ diff --git a/app/code/Magento/Customer/Model/Group.php b/app/code/Magento/Customer/Model/Group.php index 07096fd325858..e7b33e5386d62 100644 --- a/app/code/Magento/Customer/Model/Group.php +++ b/app/code/Magento/Customer/Model/Group.php @@ -84,8 +84,8 @@ class Group extends \Magento\Core\Model\AbstractModel /** * Constructor * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -93,8 +93,8 @@ class Group extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Store\Config $storeConfig, \Magento\Index\Model\Indexer $indexer, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Customer/Model/Metadata/Form.php b/app/code/Magento/Customer/Model/Metadata/Form.php index 2c43148081f66..a90aac1623832 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form.php +++ b/app/code/Magento/Customer/Model/Metadata/Form.php @@ -28,6 +28,13 @@ class Form { + /**#@+ + * Values for ignoreInvisible parameter in constructor + */ + const IGNORE_INVISIBLE = true; + const DONT_IGNORE_INVISIBLE = false; + /**#@-*/ + /** * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface */ @@ -117,7 +124,7 @@ public function __construct( $entityType, $formCode, array $attributeValues = [], - $ignoreInvisible = true, + $ignoreInvisible = self::IGNORE_INVISIBLE, $filterAttributes = [], $isAjax = false ) { @@ -252,7 +259,7 @@ public function restoreData(array $data) if (!isset($data[$attribute->getAttributeCode()])) { $data[$attribute->getAttributeCode()] = false; } - $dataModel->restoreValue($data[$attribute->getAttributeCode()]); + $data[$attribute->getAttributeCode()] = $dataModel->restoreValue($data[$attribute->getAttributeCode()]); } return $data; } @@ -334,7 +341,7 @@ protected function _getValidator(array $data) public function validateData(array $data) { $validator = $this->_getValidator($data); - if (!$validator->isValid(false)) { + if (!$validator->isValid($this->_attributeValues)) { $messages = array(); foreach ($validator->getMessages() as $errorMessages) { $messages = array_merge($messages, (array)$errorMessages); diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Text.php b/app/code/Magento/Customer/Model/Metadata/Form/Text.php index 4322fbfb29d7f..e12387dbda6e2 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Text.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Text.php @@ -28,7 +28,7 @@ class Text extends AbstractData { /** - * @var \Magento\Core\Helper\String + * @var \Magento\Stdlib\String */ protected $_string; diff --git a/app/code/Magento/Customer/Model/Metadata/FormFactory.php b/app/code/Magento/Customer/Model/Metadata/FormFactory.php index c720627859b61..7550fd21d967f 100644 --- a/app/code/Magento/Customer/Model/Metadata/FormFactory.php +++ b/app/code/Magento/Customer/Model/Metadata/FormFactory.php @@ -47,19 +47,25 @@ public function __construct(\Magento\ObjectManager $objectManager) * @param string $entityType * @param string $formCode * @param array $attributeValues + * @param bool $ignoreInvisible + * @param array $filterAttributes * @param bool $isAjax * @return \Magento\Customer\Model\Metadata\Form */ public function create( $entityType, $formCode, - $attributeValues = [], + array $attributeValues = [], + $ignoreInvisible = Form::IGNORE_INVISIBLE, + $filterAttributes = [], $isAjax = false ) { $params = [ 'entityType' => $entityType, 'formCode' => $formCode, 'attributeValues' => $attributeValues, + 'ignoreInvisible' => $ignoreInvisible, + 'filterAttributes' => $filterAttributes, 'isAjax' => $isAjax, ]; return $this->_objectManager->create('Magento\Customer\Model\Metadata\Form', $params); diff --git a/app/code/Magento/Customer/Model/Metadata/Validator.php b/app/code/Magento/Customer/Model/Metadata/Validator.php index 0fab0b4422e23..bcc4ca8446e7e 100644 --- a/app/code/Magento/Customer/Model/Metadata/Validator.php +++ b/app/code/Magento/Customer/Model/Metadata/Validator.php @@ -34,6 +34,11 @@ class Validator extends \Magento\Eav\Model\Validator\Attribute\Data */ protected $_entityType; + /** + * @var array + */ + protected $_entityData; + /** * @param ElementFactory $attrDataFactory */ @@ -45,18 +50,17 @@ public function __construct(ElementFactory $attrDataFactory) /** * Validate EAV model attributes with data models * - * @param \Magento\Core\Model\AbstractModel $entity + * @param \Magento\Object|array $entityData Data set from the Model attributes * @return bool */ - public function isValid($entity) + public function isValid($entityData) { - $data = array(); - if ($this->_data) { - $data = $this->_data; - } elseif ($entity instanceof \Magento\Object) { - $data = $entity->getData(); + if ($entityData instanceof \Magento\Object) { + $this->_entityData = $entityData->getData(); + } else { + $this->_entityData = $entityData; } - return $this->validateData($data, $this->_attributes, $this->_entityType); + return $this->validateData($this->_data, $this->_attributes, $this->_entityType); } /** @@ -76,10 +80,13 @@ public function validateData($data, $attributes, $entityType) $data[$attributeCode] = null; } $dataModel = $this->_attrDataFactory->create( - $attribute, $entityType, $data[$attributeCode] + $attribute, $data[$attributeCode], $entityType ); $dataModel->setExtractedData($data); - $result = $dataModel->validateValue($data[$attributeCode]); + $value = empty($data[$attributeCode]) && isset($this->_entityData[$attributeCode]) + ? $this->_entityData[$attributeCode] + : $data[$attributeCode]; + $result = $dataModel->validateValue($value); if (true !== $result) { $this->_addErrorMessages($attributeCode, (array)$result); } diff --git a/app/code/Magento/Customer/Model/Observer.php b/app/code/Magento/Customer/Model/Observer.php index da20618c4052d..10f638f2b82c4 100644 --- a/app/code/Magento/Customer/Model/Observer.php +++ b/app/code/Magento/Customer/Model/Observer.php @@ -51,7 +51,7 @@ class Observer /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -65,12 +65,12 @@ class Observer /** * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Customer\Helper\Data $customerData, \Magento\Customer\Helper\Address $customerAddress, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_customerData = $customerData; $this->_customerAddress = $customerAddress; diff --git a/app/code/Magento/Customer/Model/Resource/Customer/CustomersTypeOptions.php b/app/code/Magento/Customer/Model/Resource/Customer/CustomersTypeOptions.php index d057937fc38da..586a12dda0ba9 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/CustomersTypeOptions.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/CustomersTypeOptions.php @@ -25,7 +25,7 @@ */ namespace Magento\Customer\Model\Resource\Customer; -class CustomersTypeOptions implements \Magento\Core\Model\Option\ArrayInterface +class CustomersTypeOptions implements \Magento\Option\ArrayInterface { /** * Return statuses option array diff --git a/app/code/Magento/Customer/Model/Session.php b/app/code/Magento/Customer/Model/Session.php index c3ff8c4eca0fb..6936852020583 100644 --- a/app/code/Magento/Customer/Model/Session.php +++ b/app/code/Magento/Customer/Model/Session.php @@ -110,6 +110,17 @@ class Session extends \Magento\Session\SessionManager * @var \Magento\App\ResponseInterface */ protected $response; + + /** + * @var \Magento\Customer\Service\V1\Dto\Customer + */ + protected $_customerDataObject; + + /** + * @var \Magento\Customer\Model\Converter + */ + protected $_converter; + /** * @param \Magento\App\RequestInterface $request * @param \Magento\Session\SidResolverInterface $sidResolver @@ -126,6 +137,8 @@ class Session extends \Magento\Session\SessionManager * @param \Magento\Core\Model\Session $session * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Customer\Model\Converter $converter + * @param \Magento\App\ResponseInterface $response * @param \Magento\Customer\Service\V1\CustomerServiceInterface $customerService * @param \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService * @param null $sessionName @@ -147,6 +160,7 @@ public function __construct( \Magento\Core\Model\Session $session, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Customer\Model\Converter $converter, \Magento\App\ResponseInterface $response, \Magento\Customer\Service\V1\CustomerServiceInterface $customerService, \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService, @@ -167,6 +181,7 @@ public function __construct( $this->response = $response; parent::__construct($request, $sidResolver, $sessionConfig, $saveHandler, $validator, $storage); $this->start($sessionName); + $this->_converter = $converter; $this->_eventManager->dispatch('customer_session_init', array('customer_session' => $this)); } @@ -189,12 +204,8 @@ public function getCustomerConfigShare() public function setCustomerDto(CustomerDto $customer) { $this->_customer = $customer; - if ($customer === null) { - $this->setCustomerId(null); - } else { - $this->response->setVary('customer_group', $customer->getGroupId()); - $this->setCustomerId($customer->getCustomerId()); - } + $this->response->setVary('customer_group', $customer->getGroupId()); + $this->setCustomerId($customer->getCustomerId()); return $this; } @@ -218,6 +229,30 @@ public function getCustomerDto() return $this->_customer; } + /** + * Returns Customer data object with the customer information + * + * @return \Magento\Customer\Service\V1\Dto\Customer + */ + public function getCustomerData() + { + /* TODO refactor this after all usages of the setCustomer is refactored */ + return $this->_converter->createCustomerFromModel($this->getCustomer()); + } + + /** + * Set Customer data object with the customer information + * + * @param \Magento\Customer\Service\V1\Dto\Customer $customerData + * @return $this + */ + public function setCustomerData(\Magento\Customer\Service\V1\Dto\Customer $customerData) + { + $this->setId($customerData->getCustomerId()); + $this->_converter->updateCustomerModel($this->getCustomer(), $customerData); + return $this; + } + /** * Set customer model and the customer id in session @@ -228,16 +263,12 @@ public function getCustomerDto() public function setCustomer(Customer $customerModel) { $this->_customerModel = $customerModel; - if ($customerModel === null) { - $this->setCustomerId(null); - } else { - $this->response->setVary('customer_group', $customerModel->getGroupId()); - $this->setCustomerId($customerModel->getId()); - if ((!$customerModel->isConfirmationRequired()) && $customerModel->getConfirmation()) { - $customerModel->setConfirmation(null)->save(); - } + $this->response->setVary('customer_group', $customerModel->getGroupId()); + $this->setCustomerId($customerModel->getId()); + if ((!$customerModel->isConfirmationRequired()) && $customerModel->getConfirmation()) { + $customerModel->setConfirmation(null)->save(); } - + return $this; } diff --git a/app/code/Magento/Customer/Service/V1/CustomerAccountService.php b/app/code/Magento/Customer/Service/V1/CustomerAccountService.php index c813684461a48..6bc313c8449fe 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerAccountService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerAccountService.php @@ -86,6 +86,9 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ private $_customerAddressService; + /** @var \Magento\ObjectManager */ + protected $_objectManager; + /** * Constructor * @@ -98,6 +101,9 @@ class CustomerAccountService implements CustomerAccountServiceInterface * @param Dto\Response\CreateCustomerAccountResponseBuilder $createCustomerAccountResponseBuilder * @param CustomerServiceInterface $customerService * @param CustomerAddressServiceInterface $customerAddressService + * @param \Magento\ObjectManager $objectManager + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( CustomerFactory $customerFactory, @@ -108,7 +114,8 @@ public function __construct( Validator $validator, Dto\Response\CreateCustomerAccountResponseBuilder $createCustomerAccountResponseBuilder, CustomerServiceInterface $customerService, - CustomerAddressServiceInterface $customerAddressService + CustomerAddressServiceInterface $customerAddressService, + \Magento\ObjectManager $objectManager ) { $this->_customerFactory = $customerFactory; $this->_eventManager = $eventManager; @@ -119,6 +126,7 @@ public function __construct( $this->_createCustomerAccountResponseBuilder = $createCustomerAccountResponseBuilder; $this->_customerService = $customerService; $this->_customerAddressService = $customerAddressService; + $this->_objectManager = $objectManager; } @@ -243,7 +251,10 @@ public function createAccount( $customerId = $customer->getCustomerId(); if ($customerId) { $customerModel = $this->_converter->getCustomerModel($customerId); - if ($customerModel->isInStore($storeId)) { + // We can't pass it through DI because going to get circular dependency + /** @var \Magento\Customer\Helper\Data $customerHelper */ + $customerHelper = $this->_objectManager->get('Magento\Customer\Helper\Data'); + if ($customerHelper->isCustomerInStore($customerModel->getWebsiteId(), $storeId)) { return $this->_createCustomerAccountResponseBuilder->setCustomerId($customerId) ->setStatus('') ->create(); diff --git a/app/code/Magento/Customer/Service/V1/CustomerAddressService.php b/app/code/Magento/Customer/Service/V1/CustomerAddressService.php index cc82f53fde333..1fe7991632c9d 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerAddressService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerAddressService.php @@ -27,6 +27,7 @@ use Magento\Customer\Model\Address as CustomerAddressModel; use Magento\Exception\NoSuchEntityException; use Magento\Exception\InputException; +use Magento\Customer\Model\Address\Converter as AddressConverter; /** * Service related to Customer Address related functions @@ -44,14 +45,9 @@ class CustomerAddressService implements CustomerAddressServiceInterface private $_converter; /** - * @var Dto\RegionBuilder + * @var AddressConverter */ - private $_regionBuilder; - - /** - * @var Dto\AddressBuilder - */ - private $_addressBuilder; + private $_addressConverter; /** * Directory data @@ -65,21 +61,18 @@ class CustomerAddressService implements CustomerAddressServiceInterface * * @param \Magento\Customer\Model\AddressFactory $addressFactory * @param \Magento\Customer\Model\Converter $converter - * @param Dto\RegionBuilder $regionBuilder - * @param Dto\AddressBuilder $addressBuilder + * @param AddressConverter $addressConverter * @param \Magento\Directory\Helper\Data $directoryData */ public function __construct( \Magento\Customer\Model\AddressFactory $addressFactory, \Magento\Customer\Model\Converter $converter, - Dto\RegionBuilder $regionBuilder, - Dto\AddressBuilder $addressBuilder, + AddressConverter $addressConverter, \Magento\Directory\Helper\Data $directoryData ) { $this->_addressFactory = $addressFactory; $this->_converter = $converter; - $this->_regionBuilder = $regionBuilder; - $this->_addressBuilder = $addressBuilder; + $this->_addressConverter = $addressConverter; $this->_directoryData = $directoryData; } @@ -97,7 +90,7 @@ public function getAddresses($customerId) $result = array(); /** @var $address CustomerAddressModel */ foreach ($addresses as $address) { - $result[] = $this->_createAddress( + $result[] = $this->_addressConverter->createAddressFromModel( $address, $defaultBillingId, $defaultShippingId @@ -117,7 +110,7 @@ public function getDefaultBillingAddress($customerId) if ($address === false) { return null; } - return $this->_createAddress( + return $this->_addressConverter->createAddressFromModel( $address, $customer->getDefaultBilling(), $customer->getDefaultShipping() @@ -135,7 +128,7 @@ public function getDefaultShippingAddress($customerId) if ($address === false) { return null; } - return $this->_createAddress($address, + return $this->_addressConverter->createAddressFromModel($address, $customer->getDefaultBilling(), $customer->getDefaultShipping() ); @@ -152,9 +145,10 @@ public function getAddressById($addressId) if (!$address->getId()) { throw new NoSuchEntityException('addressId', $addressId); } + $customer = $this->_converter->getCustomerModel($address->getCustomerId()); - return $this->_createAddress( + return $this->_addressConverter->createAddressFromModel( $address, $customer->getDefaultBilling(), $customer->getDefaultShipping() @@ -195,7 +189,7 @@ public function saveAddresses($customerId, array $addresses) $addressModel = $this->_addressFactory->create(); $addressModel->setCustomer($customerModel); } - $this->_updateAddressModel($addressModel, $address); + $this->_addressConverter->updateAddressModel($addressModel, $address); $inputException = $this->_validate($addressModel, $inputException, $i); $addressModels[] = $addressModel; @@ -215,97 +209,7 @@ public function saveAddresses($customerId, array $addresses) } /** - * Updates an Address Model based on information from an Address DTO. - * - * @param CustomerAddressModel $addressModel - * @param Dto\Address $address - */ - private function _updateAddressModel(CustomerAddressModel $addressModel, Dto\Address $address) - { - // Set all attributes - foreach ($address->getAttributes() as $attributeCode => $attributeData) { - if ('region' == $attributeCode - && $address->getRegion() instanceof Dto\Region - ) { - $addressModel->setData('region', $address->getRegion()->getRegion()); - $addressModel->setData('region_code', $address->getRegion()->getRegionCode()); - $addressModel->setData('region_id', $address->getRegion()->getRegionId()); - } else { - $addressModel->setData($attributeCode, $attributeData); - } - } - // Set customer related data - $isBilling = $address->isDefaultBilling(); - $addressModel->setIsDefaultBilling($isBilling); - $addressModel->setIsDefaultShipping($address->isDefaultShipping()); - // Need to use attribute set or future updates can cause data loss - if (!$addressModel->getAttributeSetId()) { - $addressModel->setAttributeSetId(CustomerMetadataServiceInterface::ADDRESS_ATTRIBUTE_SET_ID); - } - } - - /** - * Create address based on model - * - * @param CustomerAddressModel $addressModel - * @param int $defaultBillingId - * @param int $defaultShippingId - * @return Dto\Address - */ - private function _createAddress( - CustomerAddressModel $addressModel, - $defaultBillingId, - $defaultShippingId - ) { - $addressId = $addressModel->getId(); - $validAttributes = array_merge( - $addressModel->getDefaultAttributeCodes(), - [ - 'id', - 'region_id', - 'region', - 'street', - 'vat_is_valid', - 'default_billing', - 'default_shipping', - //TODO: create VAT object at MAGETWO-16860 - 'vat_request_id', - 'vat_request_date', - 'vat_request_success' - ] - ); - $addressData = []; - foreach ($addressModel->getAttributes() as $attribute) { - $code = $attribute->getAttributeCode(); - if (!in_array($code, $validAttributes) && $addressModel->getData($code) !== null) { - $addressData[$code] = $addressModel->getData($code); - } - } - - $this->_addressBuilder->populateWithArray( - array_merge( - $addressData, - [ - 'street' => $addressModel->getStreet(), - 'id' => $addressId, - 'default_billing' => $addressId === $defaultBillingId, - 'default_shipping' => $addressId === $defaultShippingId, - 'customer_id' => $addressModel->getCustomerId(), - 'region' => [ - 'region_code' => $addressModel->getRegionCode(), - 'region' => $addressModel->getRegion(), - 'region_id' => $addressModel->getRegionId(), - ], - ] - ) - ); - - $retValue = $this->_addressBuilder->create(); - return $retValue; - } - - /** - * Validate Customer Addrresss attribute values. + * Validate Customer Addresses attribute values. * * @param CustomerAddressModel $customerAddressModel the model to validate * @param InputException $exception the exception to add errors to diff --git a/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php b/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php index 4740fa2e76f45..761313ba7639c 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php @@ -143,40 +143,6 @@ public function getAttributes($entityType, $formCode) return $attributes; } - /** - * @inheritdoc - */ - public function getCustomerAttributeMetadata($attributeCode) - { - return $this->getAttributeMetadata('customer', $attributeCode); - } - - /** - * @inheritdoc - */ - public function getAllCustomerAttributeMetadata() - { - return $this->getAllAttributeSetMetadata('customer', self::CUSTOMER_ATTRIBUTE_SET_ID); - } - - /** - * @inheritdoc - */ - public function getAddressAttributeMetadata($attributeCode) - { - return $this->getAttributeMetadata('customer_address', $attributeCode); - } - - /** - * @inheritdoc - */ - public function getAllAddressAttributeMetadata() - { - return $this->getAllAttributeSetMetadata('customer_address', self::ADDRESS_ATTRIBUTE_SET_ID); - } - - - /** * Load collection with filters applied * @@ -229,6 +195,39 @@ private function _createMetadataAttribute($attribute) return $this->_attributeMetadataBuilder->create(); } + /** + * @inheritdoc + */ + public function getCustomerAttributeMetadata($attributeCode) + { + return $this->getAttributeMetadata('customer', $attributeCode); + } + + /** + * @inheritdoc + */ + public function getAllCustomerAttributeMetadata() + { + return $this->getAllAttributeSetMetadata('customer', self::ATTRIBUTE_SET_ID_CUSTOMER); + } + + /** + * @inheritdoc + */ + public function getAddressAttributeMetadata($attributeCode) + { + return $this->getAttributeMetadata('customer_address', $attributeCode); + } + + /** + * @inheritdoc + */ + public function getAllAddressAttributeMetadata() + { + return $this->getAllAttributeSetMetadata('customer_address', self::ATTRIBUTE_SET_ID_ADDRESS); + } + + /** * Helper for getting access to an entity types DTO cache. * diff --git a/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php b/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php index fcbc2f37c588d..32189cf3df66e 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php +++ b/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php @@ -31,8 +31,10 @@ */ interface CustomerMetadataServiceInterface { - const CUSTOMER_ATTRIBUTE_SET_ID = 1; - const ADDRESS_ATTRIBUTE_SET_ID = 2; + const ATTRIBUTE_SET_ID_CUSTOMER = 1; + const ATTRIBUTE_SET_ID_ADDRESS = 2; + const ENTITY_TYPE_CUSTOMER = 'customer'; + const ENTITY_TYPE_ADDRESS = 'customer_address'; /** * Retrieve Attribute Metadata diff --git a/app/code/Magento/Customer/Service/V1/CustomerService.php b/app/code/Magento/Customer/Service/V1/CustomerService.php index bd96debbe0034..347fc7727dfd3 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerService.php @@ -64,7 +64,6 @@ public function __construct( $this->_customerMetadataService = $customerMetadataService; } - /** * {@inheritdoc} */ @@ -80,6 +79,15 @@ public function getCustomer($customerId) } + /** + * {@inheritdoc} + */ + public function getCustomerByEmail($customerEmail, $websiteId = null) + { + $customerModel = $this->_converter->getCustomerModelByEmail($customerEmail, $websiteId); + return $this->_converter->createCustomerFromModel($customerModel); + } + /** * {@inheritdoc} */ @@ -89,6 +97,8 @@ public function saveCustomer(Dto\Customer $customer, $password = null) if ($password) { $customerModel->setPassword($password); + } elseif (!$customerModel->getId()) { + $customerModel->setPassword($customerModel->generatePassword()); } $this->_validate($customerModel); @@ -156,4 +166,14 @@ protected function _getAttributeMetadata($attributeCode) return null; } } + + /** + * {@inheritdoc} + */ + public function deleteCustomer($customerId) + { + $customerModel = $this->_converter->getCustomerModel($customerId); + $customerModel->delete(); + unset($this->_cache[$customerModel->getId()]); + } } diff --git a/app/code/Magento/Customer/Service/V1/CustomerServiceInterface.php b/app/code/Magento/Customer/Service/V1/CustomerServiceInterface.php index a8683e7688fa1..94f80b803f27a 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerServiceInterface.php +++ b/app/code/Magento/Customer/Service/V1/CustomerServiceInterface.php @@ -52,4 +52,23 @@ public function saveCustomer(Dto\Customer $customer, $password = null); */ public function getCustomer($customerId); + /** + * Retrieve customer by his email. + * + * @param string $customerEmail + * @param int|null $websiteId + * @throws NoSuchEntityException If customer with the specified email is not found. + * @return Dto\Customer + */ + public function getCustomerByEmail($customerEmail, $websiteId = null); + + /** + * Delete Customer + * + * @param int $customerId + * @throws \Magento\Customer\Exception If something goes wrong during delete + * @throws NoSuchEntityException If customer with customerId is not found. + * @return void + */ + public function deleteCustomer($customerId); } diff --git a/app/code/Magento/Customer/Service/V1/Dto/Address.php b/app/code/Magento/Customer/Service/V1/Dto/Address.php index ef93eb3c521b4..704447449b7b1 100644 --- a/app/code/Magento/Customer/Service/V1/Dto/Address.php +++ b/app/code/Magento/Customer/Service/V1/Dto/Address.php @@ -27,20 +27,56 @@ class Address extends \Magento\Service\Entity\AbstractDto implements Eav\EntityInterface { - + const ADDRESS_TYPE_BILLING = 'billing'; + const ADDRESS_TYPE_SHIPPING = 'shipping'; const KEY_COUNTRY_ID = 'country_id'; - - /** - * @var array - */ - private static $_nonAttributes = ['id', 'customer_id', 'region', 'default_billing', 'default_shipping']; + const KEY_DEFAULT_BILLING = 'default_billing'; + const KEY_DEFAULT_SHIPPING = 'default_shipping'; + const KEY_ID = 'id'; + const KEY_CUSTOMER_ID = 'customer_id'; + const KEY_REGION = Region::KEY_REGION; + const KEY_REGION_ID = Region::KEY_REGION_ID; + const KEY_STREET = 'street'; + const KEY_COMPANY = 'company'; + const KEY_TELEPHONE = 'telephone'; + const KEY_FAX = 'fax'; + const KEY_POSTCODE = 'postcode'; + const KEY_CITY = 'city'; + const KEY_FIRSTNAME = 'firstname'; + const KEY_LASTNAME = 'lastname'; + const KEY_MIDDLENAME = 'middlename'; + const KEY_PREFIX = 'prefix'; + const KEY_SUFFIX = 'suffix'; + const KEY_VAT_ID = 'vat_id'; + + protected $_validAttributes = [ + self::KEY_COUNTRY_ID, + self::KEY_DEFAULT_BILLING, + self::KEY_DEFAULT_SHIPPING, + self::KEY_ID, + self::KEY_CUSTOMER_ID, + self::KEY_REGION, + self::KEY_REGION_ID, + self::KEY_STREET, + self::KEY_COMPANY, + self::KEY_TELEPHONE, + self::KEY_FAX, + self::KEY_POSTCODE, + self::KEY_CITY, + self::KEY_FIRSTNAME, + self::KEY_LASTNAME, + self::KEY_MIDDLENAME, + self::KEY_PREFIX, + self::KEY_SUFFIX, + self::KEY_VAT_ID + ]; /** * @return int|null */ public function getId() { - return $this->_get('id'); + return $this->_get(self::KEY_ID); } /** @@ -48,7 +84,7 @@ public function getId() */ public function isDefaultShipping() { - return $this->_get('default_shipping'); + return $this->_get(self::KEY_DEFAULT_SHIPPING); } /** @@ -56,26 +92,24 @@ public function isDefaultShipping() */ public function isDefaultBilling() { - return $this->_get('default_billing'); + return $this->_get(self::KEY_DEFAULT_BILLING); } /** - * @return string[] + * Retrieve array of all attributes, in the form of 'attribute code' => _data; - foreach (self::$_nonAttributes as $keyName) { - unset ($attributes[$keyName]); + $unvalidatedData = $this->__toArray(); + $validData = []; + foreach ($this->_validAttributes as $attributeCode) { + if (isset($unvalidatedData[$attributeCode])) { + $validData[$attributeCode] = $unvalidatedData[$attributeCode]; + } } - - /** This triggers some code in _updateAddressModel in CustomerV1 Service */ - if (!is_null($this->getRegion())) { - $attributes['region']['region_id'] = $this->getRegion()->getRegionId(); - $attributes['region']['region'] = $this->getRegion()->getRegion(); - } - - return $attributes; + return $validData; } /** @@ -85,8 +119,7 @@ public function getAttributes() public function getAttribute($attributeCode) { $attributes = $this->getAttributes(); - if (isset($attributes[$attributeCode]) - && !in_array($attributeCode, self::$_nonAttributes)) { + if (isset($attributes[$attributeCode])) { return $attributes[$attributeCode]; } return null; @@ -97,7 +130,7 @@ public function getAttribute($attributeCode) */ public function getRegion() { - return $this->_get('region'); + return $this->_get(self::KEY_REGION); } /** @@ -113,7 +146,7 @@ public function getCountryId() */ public function getStreet() { - return $this->_get('street'); + return $this->_get(self::KEY_STREET); } /** @@ -121,7 +154,7 @@ public function getStreet() */ public function getCompany() { - return $this->_get('company'); + return $this->_get(self::KEY_COMPANY); } /** @@ -129,7 +162,7 @@ public function getCompany() */ public function getTelephone() { - return $this->_get('telephone'); + return $this->_get(self::KEY_TELEPHONE); } /** @@ -137,7 +170,7 @@ public function getTelephone() */ public function getFax() { - return $this->_get('fax'); + return $this->_get(self::KEY_FAX); } /** @@ -145,7 +178,7 @@ public function getFax() */ public function getPostcode() { - return $this->_get('postcode'); + return $this->_get(self::KEY_POSTCODE); } /** @@ -153,7 +186,7 @@ public function getPostcode() */ public function getCity() { - return $this->_get('city'); + return $this->_get(self::KEY_CITY); } /** @@ -161,7 +194,7 @@ public function getCity() */ public function getFirstname() { - return $this->_get('firstname'); + return $this->_get(self::KEY_FIRSTNAME); } /** @@ -169,7 +202,7 @@ public function getFirstname() */ public function getLastname() { - return $this->_get('lastname'); + return $this->_get(self::KEY_LASTNAME); } /** @@ -177,7 +210,7 @@ public function getLastname() */ public function getMiddlename() { - return $this->_get('middlename'); + return $this->_get(self::KEY_MIDDLENAME); } /** @@ -185,7 +218,7 @@ public function getMiddlename() */ public function getPrefix() { - return $this->_get('prefix'); + return $this->_get(self::KEY_PREFIX); } /** @@ -193,7 +226,7 @@ public function getPrefix() */ public function getSuffix() { - return $this->_get('suffix'); + return $this->_get(self::KEY_SUFFIX); } /** @@ -201,7 +234,7 @@ public function getSuffix() */ public function getVatId() { - return $this->_get('vat_id'); + return $this->_get(self::KEY_VAT_ID); } /** @@ -209,6 +242,6 @@ public function getVatId() */ public function getCustomerId() { - return $this->_get('customer_id'); + return $this->_get(self::KEY_CUSTOMER_ID); } } diff --git a/app/code/Magento/Customer/Service/V1/Dto/AddressBuilder.php b/app/code/Magento/Customer/Service/V1/Dto/AddressBuilder.php index def7cd4dd966d..5e7461cd37f86 100644 --- a/app/code/Magento/Customer/Service/V1/Dto/AddressBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Dto/AddressBuilder.php @@ -25,18 +25,26 @@ */ namespace Magento\Customer\Service\V1\Dto; -class AddressBuilder extends \Magento\Service\Entity\AbstractDtoBuilder +use Magento\Service\Entity\AbstractDto; +use Magento\Service\Entity\AbstractDtoBuilder; + +/** + * @method Address create() + * @method Address mergeDtoWithArray(AbstractDto $dto, array $data) + */ +class AddressBuilder extends AbstractDtoBuilder { + /** @var RegionBuilder */ protected $_regionBuilder; /** - * @param \Magento\Customer\Service\V1\Dto\RegionBuilder $regionBuilder + * @param RegionBuilder $regionBuilder */ public function __construct(RegionBuilder $regionBuilder) { parent::__construct(); $this->_regionBuilder = $regionBuilder; - $this->_data['region'] = $regionBuilder->create(); + $this->_data[Address::KEY_REGION] = $regionBuilder->create(); } /** @@ -45,7 +53,7 @@ public function __construct(RegionBuilder $regionBuilder) */ public function setId($id) { - return $this->_set('id', (string)$id); + return $this->_set(Address::KEY_ID, $id); } /** @@ -54,7 +62,7 @@ public function setId($id) */ public function setDefaultShipping($defaultShipping) { - return $this->_set('default_shipping', (bool)$defaultShipping); + return $this->_set(Address::KEY_DEFAULT_SHIPPING, (bool)$defaultShipping); } /** @@ -63,7 +71,7 @@ public function setDefaultShipping($defaultShipping) */ public function setDefaultBilling($defaultBilling) { - return $this->_set('default_billing', (bool)$defaultBilling); + return $this->_set(Address::KEY_DEFAULT_BILLING, (bool)$defaultBilling); } /** @@ -71,8 +79,20 @@ public function setDefaultBilling($defaultBilling) */ public function populateWithArray(array $data) { - if (isset($data['region'])) { - $data['region'] = new Region($data['region']); + if (array_key_exists(Address::KEY_REGION, $data)) { + if (!is_array($data[Address::KEY_REGION])) { + // Region data has been submitted as individual keys of Address object. Let's extract it. + $regionData = []; + foreach ([Region::KEY_REGION, Region::KEY_REGION_CODE, Region::KEY_REGION_ID] as $attrCode) { + if (isset($data[$attrCode])) { + $regionData[$attrCode] = $data[$attrCode]; + } + } + } else { + $regionData = $data[Address::KEY_REGION]; + } + + $data[Address::KEY_REGION] = $this->_regionBuilder->populateWithArray($regionData)->create(); } return parent::populateWithArray($data); @@ -84,7 +104,7 @@ public function populateWithArray(array $data) */ public function setRegion(Region $region) { - return $this->_set('region', $region); + return $this->_set(Address::KEY_REGION, $region); } /** @@ -93,7 +113,7 @@ public function setRegion(Region $region) */ public function setCountryId($countryId) { - return $this->_set('country_id', $countryId); + return $this->_set(Address::KEY_COUNTRY_ID, $countryId); } /** @@ -102,7 +122,7 @@ public function setCountryId($countryId) */ public function setStreet($street) { - return $this->_set('street', $street); + return $this->_set(Address::KEY_STREET, $street); } /** @@ -111,7 +131,7 @@ public function setStreet($street) */ public function setCompany($company) { - return $this->_set('company', $company); + return $this->_set(Address::KEY_COMPANY, $company); } /** @@ -120,7 +140,7 @@ public function setCompany($company) */ public function setTelephone($telephone) { - return $this->_set('telephone', $telephone); + return $this->_set(Address::KEY_TELEPHONE, $telephone); } /** @@ -129,7 +149,7 @@ public function setTelephone($telephone) */ public function setFax($fax) { - return $this->_set('fax', $fax); + return $this->_set(Address::KEY_FAX, $fax); } /** @@ -138,7 +158,7 @@ public function setFax($fax) */ public function setPostcode($postcode) { - return $this->_set('postcode', $postcode); + return $this->_set(Address::KEY_POSTCODE, $postcode); } /** @@ -147,7 +167,7 @@ public function setPostcode($postcode) */ public function setCity($city) { - return $this->_set('city', $city); + return $this->_set(Address::KEY_CITY, $city); } /** @@ -156,7 +176,7 @@ public function setCity($city) */ public function setFirstname($firstname) { - return $this->_set('firstname', $firstname); + return $this->_set(Address::KEY_FIRSTNAME, $firstname); } /** @@ -165,7 +185,7 @@ public function setFirstname($firstname) */ public function setLastname($lastname) { - return $this->_set('lastname', $lastname); + return $this->_set(Address::KEY_LASTNAME, $lastname); } /** @@ -174,7 +194,7 @@ public function setLastname($lastname) */ public function setMiddlename($middlename) { - return $this->_set('middlename', $middlename); + return $this->_set(Address::KEY_MIDDLENAME, $middlename); } /** @@ -183,7 +203,7 @@ public function setMiddlename($middlename) */ public function setPrefix($prefix) { - return $this->_set('prefix', $prefix); + return $this->_set(Address::KEY_PREFIX, $prefix); } /** @@ -192,7 +212,7 @@ public function setPrefix($prefix) */ public function setSuffix($suffix) { - return $this->_set('suffix', $suffix); + return $this->_set(Address::KEY_SUFFIX, $suffix); } /** @@ -201,7 +221,7 @@ public function setSuffix($suffix) */ public function setVatId($vatId) { - return $this->_set('vat_id', $vatId); + return $this->_set(Address::KEY_VAT_ID, $vatId); } /** @@ -210,7 +230,6 @@ public function setVatId($vatId) */ public function setCustomerId($customerId) { - /** XXX: (string) Needed for tests to pass */ - return $this->_set('customer_id', (string)$customerId); + return $this->_set(Address::KEY_CUSTOMER_ID, $customerId); } } diff --git a/app/code/Magento/Customer/Service/V1/Dto/Customer.php b/app/code/Magento/Customer/Service/V1/Dto/Customer.php index 71030611147e6..d2ae734fd06b9 100644 --- a/app/code/Magento/Customer/Service/V1/Dto/Customer.php +++ b/app/code/Magento/Customer/Service/V1/Dto/Customer.php @@ -31,21 +31,10 @@ */ class Customer extends \Magento\Service\Entity\AbstractDto implements Eav\EntityInterface { - - /** - * @var array Special attribute codes which cannot be set or gotten - * they are used by the model but should not be exposed in the DTO - */ - private static $_nonAttributes = [self::ID]; - - /** - * name of field containing entity id, used to exclude this field from list of attributes. - */ - const ID = 'id'; - - /** + /**#@+ * constants defined for keys of array, makes typos less likely */ + const ID = 'id'; const CONFIRMATION = 'confirmation'; const CREATED_AT = 'created_at'; const CREATED_IN = 'created_in'; @@ -63,30 +52,64 @@ class Customer extends \Magento\Service\Entity\AbstractDto implements Eav\Entity const WEBSITE_ID = 'website_id'; const DEFAULT_BILLING = 'default_billing'; const DEFAULT_SHIPPING = 'default_shipping'; + const RP_TOKEN = 'rp_token'; + const RP_TOKEN_CREATED_AT = 'rp_token_created_at'; + /**#@-*/ + + /** + * A list of valid customer DTO attributes. + * + * @var string[] + */ + protected $_validAttributes = [ + self::ID, + self::CONFIRMATION, + self::CREATED_AT, + self::CREATED_IN, + self::DOB, + self::EMAIL, + self::FIRSTNAME, + self::GENDER, + self::GROUP_ID, + self::LASTNAME, + self::MIDDLENAME, + self::PREFIX, + self::STORE_ID, + self::SUFFIX, + self::TAXVAT, + self::WEBSITE_ID, + self::DEFAULT_BILLING, + self::DEFAULT_SHIPPING, + self::RP_TOKEN, + self::RP_TOKEN_CREATED_AT, + ]; /** * Retrieve array of all attributes, in the form of 'attribute code' => 'attribute value' * - * @return array|\ArrayAccess|\string[] + * @return array */ public function getAttributes() { - $attributes = $this->__toArray(); - foreach (self::$_nonAttributes as $keyName) { - unset ($attributes[$keyName]); + $unvalidatedData = $this->__toArray(); + $validData = []; + foreach ($this->_validAttributes as $attributeCode) { + if (array_key_exists($attributeCode, $unvalidatedData)) { + $validData[$attributeCode] = $unvalidatedData[$attributeCode]; + } } - return $attributes; + return $validData; } /** - * Gets an attribute value. + * Get an attribute value. * * @param string $attributeCode * @return mixed The attribute value or null if the attribute has not been set */ public function getAttribute($attributeCode) { - if (isset($this->_data[$attributeCode])) { + if (in_array($attributeCode, $this->_validAttributes) && isset($this->_data[$attributeCode])) { return $this->_data[$attributeCode]; } else { return null; @@ -234,6 +257,22 @@ public function getTaxvat() */ public function getWebsiteId() { - return $this->_get(self::WEBSITE_ID, 0); + return (int)$this->_get(self::WEBSITE_ID); + } + + /** + * @return string + */ + public function getRpToken() + { + return $this->_get(self::RP_TOKEN); + } + + /** + * @return string + */ + public function getRpTokenCreatedAt() + { + return $this->_get(self::RP_TOKEN_CREATED_AT); } } diff --git a/app/code/Magento/Customer/Service/V1/Dto/CustomerBuilder.php b/app/code/Magento/Customer/Service/V1/Dto/CustomerBuilder.php index c4c1a5383214d..ed959d6cd809a 100644 --- a/app/code/Magento/Customer/Service/V1/Dto/CustomerBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Dto/CustomerBuilder.php @@ -21,17 +21,16 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Dto; /** - * Class Customer - * Uses array to hold data, setters return $this so they can be chained. + * Class Customer. Uses array to hold data, setters return $this so they can be chained. * - * @package Magento\Customer\Service\V1\Dto + * @method Customer create() create() */ class CustomerBuilder extends \Magento\Service\Entity\AbstractDtoBuilder { - /** * @param string $confirmation * @return CustomerBuilder @@ -175,4 +174,22 @@ public function setWebsiteId($websiteId) { return $this->_set(Customer::WEBSITE_ID, $websiteId); } + + /** + * @param string + * @return CustomerBuilder + */ + public function getRpToken($rpToken) + { + return $this->_set(self::RP_TOKEN, $rpToken); + } + + /** + * @param string + * @return CustomerBuilder + */ + public function getRpTokenCreatedAt($rpTokenCreatedAt) + { + return $this->_set(self::RP_TOKEN_CREATED_AT, $rpTokenCreatedAt); + } } diff --git a/app/code/Magento/Customer/Service/V1/Dto/Region.php b/app/code/Magento/Customer/Service/V1/Dto/Region.php index 475602a5e774d..e12e1ff2a7a4d 100644 --- a/app/code/Magento/Customer/Service/V1/Dto/Region.php +++ b/app/code/Magento/Customer/Service/V1/Dto/Region.php @@ -27,12 +27,20 @@ class Region extends \Magento\Service\Entity\AbstractDto { + /**#@+ + * Array keys + */ + const KEY_REGION_CODE = 'region_code'; + const KEY_REGION = 'region'; + const KEY_REGION_ID = 'region_id'; + /**#@-*/ + /** * @return string */ public function getRegionCode() { - return $this->_get('region_code'); + return $this->_get(self::KEY_REGION_CODE); } /** @@ -40,7 +48,7 @@ public function getRegionCode() */ public function getRegion() { - return $this->_get('region'); + return $this->_get(self::KEY_REGION); } /** @@ -48,6 +56,6 @@ public function getRegion() */ public function getRegionId() { - return $this->_get('region_id'); + return $this->_get(self::KEY_REGION_ID); } } diff --git a/app/code/Magento/Customer/Service/V1/Dto/RegionBuilder.php b/app/code/Magento/Customer/Service/V1/Dto/RegionBuilder.php index 1f1d0bbdde0f2..219f22606d40e 100644 --- a/app/code/Magento/Customer/Service/V1/Dto/RegionBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Dto/RegionBuilder.php @@ -33,7 +33,7 @@ class RegionBuilder extends \Magento\Service\Entity\AbstractDtoBuilder */ public function setRegionCode($regionCode) { - $this->_data['region_code'] = $regionCode; + $this->_data[Region::KEY_REGION_CODE] = $regionCode; return $this; } @@ -43,7 +43,7 @@ public function setRegionCode($regionCode) */ public function setRegion($regionName) { - $this->_data['region'] = $regionName; + $this->_data[Region::KEY_REGION] = $regionName; return $this; } @@ -53,7 +53,7 @@ public function setRegion($regionName) */ public function setRegionId($regionId) { - $this->_data['region_id'] = $regionId; + $this->_data[Region::KEY_REGION_ID] = $regionId; return $this; } } diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml index 46d7f44c09aa6..01dff43e73219 100755 --- a/app/code/Magento/Customer/etc/module.xml +++ b/app/code/Magento/Customer/etc/module.xml @@ -44,7 +44,6 @@ - diff --git a/app/code/Magento/Customer/i18n/de_DE.csv b/app/code/Magento/Customer/i18n/de_DE.csv index 10f2e87e88a21..344eac5c4defd 100644 --- a/app/code/Magento/Customer/i18n/de_DE.csv +++ b/app/code/Magento/Customer/i18n/de_DE.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","Bitte geben Sie die Telefonnummer ein." "Please enter the zip/postal code.","Bitte geben Sie die Postleitzahl an." "Please enter your email address below. You will receive a link to reset your password.","Bitte geben Sie Ihre Email-Adresse ein. Sie erhalten dann einen Link mit dem Sie Ihr Passwort zurücksetzen können." -"Please enter your email below and we\'ll send you confirmation link for it.","Bitte geben Sie unten Ihre E-Mail-Adresse ein, und wir senden Ihnen einen Bestätigungslink." +"Please enter your email below and we'll send you confirmation link for it.","Bitte geben Sie unten Ihre E-Mail-Adresse ein, und wir senden Ihnen einen Bestätigungslink." "Please enter your email.","Bitte geben Sie Ihre E-Mail-Adresse ein." "Please make sure your passwords match.","Bitte stellen Sie sicher, dass die Passwörter übereinstimmen." "Please select","Bitte auswählen" @@ -400,7 +400,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","Das Suffix nach dem Namen (Jr., Sr., usw.)" "The title that goes before name (Mr., Mrs., etc.)","Die Anrede vor dem Namen (Hr., Fr., usw.)" "There are no items in customer's wishlist at the moment","Momentan gibt es keine Artikel auf dem Wunschzettel des Kunden" -"There are no items in customer\'s shopping cart at the moment","Es gibt momentan keine Artikel im Kundenwarenkorb" +"There are no items in customer's shopping cart at the moment","Es gibt momentan keine Artikel im Kundenwarenkorb" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","Es existiert schon ein Account mit dieser E-Mail-Adresse. Falls Sie sicher sein sollten, dass es Ihre E-Mail-Adresse ist, klicken Sie hier, um Ihr Passwort und Zugang zum Account zu erhalten." "There was an error validating the VAT ID.","Bei der Überprüfung der Umsatzsteuer-Identifikationsnummer ist ein Fehler aufgetreten." "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","Bei der Überprüfung der Umsatzsteuer-Identifikationsnummer trat ein Fehler auf. Der Kunde würde zu Kundengruppe %s gehören." diff --git a/app/code/Magento/Customer/i18n/en_US.csv b/app/code/Magento/Customer/i18n/en_US.csv index 3e4d50199d3ea..01e4f15289127 100644 --- a/app/code/Magento/Customer/i18n/en_US.csv +++ b/app/code/Magento/Customer/i18n/en_US.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","Please enter the telephone number." "Please enter the zip/postal code.","Please enter the zip/postal code." "Please enter your email address below. You will receive a link to reset your password.","Please enter your email address below. You will receive a link to reset your password." -"Please enter your email below and we\'ll send you confirmation link for it.","Please enter your email below and we\'ll send you confirmation link for it." +"Please enter your email below and we'll send you confirmation link for it.","Please enter your email below and we'll send you confirmation link for it." "Please enter your email.","Please enter your email." "Please make sure your passwords match.","Please make sure your passwords match." "Please select","Please select" @@ -399,7 +399,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","The suffix that goes after name (Jr., Sr., etc.)" "The title that goes before name (Mr., Mrs., etc.)","The title that goes before name (Mr., Mrs., etc.)" "There are no items in customer's wishlist at the moment","There are no items in customer's wishlist at the moment" -"There are no items in customer\'s shopping cart at the moment","There are no items in customer\'s shopping cart at the moment" +"There are no items in customer's shopping cart at the moment","There are no items in customer's shopping cart at the moment" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account." "There was an error validating the VAT ID.","There was an error validating the VAT ID." "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","There was an error validating the VAT ID. The customer would belong to Customer Group %s." diff --git a/app/code/Magento/Customer/i18n/es_ES.csv b/app/code/Magento/Customer/i18n/es_ES.csv index 4d763fe74440f..3cb0ed4b195a9 100644 --- a/app/code/Magento/Customer/i18n/es_ES.csv +++ b/app/code/Magento/Customer/i18n/es_ES.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","Por favor, introduce el número de teléfono." "Please enter the zip/postal code.","Por favor, introduce el código postal." "Please enter your email address below. You will receive a link to reset your password.","Escriba su correo electrónico más abajo. Recibirá un enlace para restablecer su contraseña." -"Please enter your email below and we\'ll send you confirmation link for it.","Introduzca su dirección de correo electrónico a continuación y le enviaremos un enlace de confirmación." +"Please enter your email below and we'll send you confirmation link for it.","Introduzca su dirección de correo electrónico a continuación y le enviaremos un enlace de confirmación." "Please enter your email.","Introduzca su dirección de correo electrónico." "Please make sure your passwords match.","Por favor, asegúrate de que las contraseñas coinciden." "Please select","Seleccione" @@ -399,7 +399,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","El sufijo que va después de nombre (padre, hijo, etc.)" "The title that goes before name (Mr., Mrs., etc.)","El título que va antes del nombre (señor, señorita, etc.)" "There are no items in customer's wishlist at the moment","En este momento no hay artículos en la lista de deseos del cliente." -"There are no items in customer\'s shopping cart at the moment","En este momento no hay artículos en el carrito de compras del cliente." +"There are no items in customer's shopping cart at the moment","En este momento no hay artículos en el carrito de compras del cliente." "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","Ya existe una cuenta con esta dirección de correo electrónico. Si está seguro de que esa es su dirección de correo electrónico, pulse aquí para conseguir su contraseña y acceder a su cuenta." "There was an error validating the VAT ID.","Ha habido un error validando el ID de IVA." "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","Ha habido un error validando el ID de IVA. El cliente podría pertenecer al grupo de cliente %s." diff --git a/app/code/Magento/Customer/i18n/fr_FR.csv b/app/code/Magento/Customer/i18n/fr_FR.csv index b470eb2b18d6b..1e0b8ec9982e0 100644 --- a/app/code/Magento/Customer/i18n/fr_FR.csv +++ b/app/code/Magento/Customer/i18n/fr_FR.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","Veuillez saisir le numéro de téléphone." "Please enter the zip/postal code.","Veuillez saisir le code postal." "Please enter your email address below. You will receive a link to reset your password.","Veuillez entrer votre adresse e-mail ci dessous. Vous allez recevoir un lien pour réinitialiser votre mot de passe." -"Please enter your email below and we\'ll send you confirmation link for it.","Veuillez entrer votre adresse email ci-dessous et nous vous enverrons un lien de confirmation." +"Please enter your email below and we'll send you confirmation link for it.","Veuillez entrer votre adresse email ci-dessous et nous vous enverrons un lien de confirmation." "Please enter your email.","Veuillez entrer votre adresse email." "Please make sure your passwords match.","Veillez à ce que vos mots de passe correspondent." "Please select","Veuillez sélectionner" @@ -399,7 +399,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","Le suffixe suivant le nom (Jr, Sr, etc)" "The title that goes before name (Mr., Mrs., etc.)","Le titre qui va avant le nom (M, Mme, Mlle, etc)" "There are no items in customer's wishlist at the moment","Il n'y a pas d'objets dans la liste de voeux de l'utilisateur" -"There are no items in customer\'s shopping cart at the moment","Il n'y a pas d'objets dans le panier d'utilisateur" +"There are no items in customer's shopping cart at the moment","Il n'y a pas d'objets dans le panier d'utilisateur" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","Il y a déjà un compte avec cette adresse email. Si vous êtes sûr qu'il s'agit de votre adresse email, cliquez ici pour obtenir votre mot de passe et accéder à votre compte." "There was an error validating the VAT ID.","Une erreur est apparue lors de la validation du numéro de TVA." "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","Une erreur est apparue lors de la validation du numéro de TVA. Le client appartiendrait au Groupe de clients %s." diff --git a/app/code/Magento/Customer/i18n/nl_NL.csv b/app/code/Magento/Customer/i18n/nl_NL.csv index 0be78c5df5d18..1ada79004eab6 100644 --- a/app/code/Magento/Customer/i18n/nl_NL.csv +++ b/app/code/Magento/Customer/i18n/nl_NL.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","Vul alstublieft het telefoonnummer in." "Please enter the zip/postal code.","Vul alstublieft de postcode in." "Please enter your email address below. You will receive a link to reset your password.","Voer hieronder uw e-mailadres in. U ontvangt een link waarmee u uw wachtwoord opnieuw kunt instellen." -"Please enter your email below and we\'ll send you confirmation link for it.","Gelieve uw e-mailadres hieronder in te vullen en wij zullen uw een confirmatie link sturen." +"Please enter your email below and we'll send you confirmation link for it.","Gelieve uw e-mailadres hieronder in te vullen en wij zullen uw een confirmatie link sturen." "Please enter your email.","Geef u e-mail in a.u.b." "Please make sure your passwords match.","Let er alstublieft op dat de wachtwoorden overeenkomen." "Please select","Selecteer" @@ -399,7 +399,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","Het achtervoegsel dat achter naam komt (Jr., Sr., etc.)" "The title that goes before name (Mr., Mrs., etc.)","De titel staat voor de naam (Mr., Mrs., e.d.)" "There are no items in customer's wishlist at the moment","Er staan momenteel geen items op het verlanglijstje van de klant" -"There are no items in customer\'s shopping cart at the moment","Er zitten momenteel geen items in het winkelwagentje van de klant" +"There are no items in customer's shopping cart at the moment","Er zitten momenteel geen items in het winkelwagentje van de klant" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","Er is al een account met dit e-mail adres. Indien u zeker weet dat dit uw e-mail adres is, klik hier om uw wachtwoord te ontvangen en toegang te krijgen tot uw account." "There was an error validating the VAT ID.","Er is een fout opgetreden bij het valideren van uw BTW nr." "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","Er is een fout opgetreden bij het valideren van uw BTW nr. De klant zou behoren tot Klant Groep %s." diff --git a/app/code/Magento/Customer/i18n/pt_BR.csv b/app/code/Magento/Customer/i18n/pt_BR.csv index 8fd09f5336c93..1a5d01fb5c9d6 100644 --- a/app/code/Magento/Customer/i18n/pt_BR.csv +++ b/app/code/Magento/Customer/i18n/pt_BR.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","Insira o número de telefone." "Please enter the zip/postal code.","Insira o CEP." "Please enter your email address below. You will receive a link to reset your password.","Por favor informe o seu endereço de e-mail abaixo. Você receberá um link para redefinir sua senha." -"Please enter your email below and we\'ll send you confirmation link for it.","Digite seu e-mail abaixo e enviaremos o link de confirmação." +"Please enter your email below and we'll send you confirmation link for it.","Digite seu e-mail abaixo e enviaremos o link de confirmação." "Please enter your email.","Por favor insira seu email." "Please make sure your passwords match.","Por favor certifique-se que suas senhas coincidem." "Please select","Favor selecionar" @@ -399,7 +399,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","O sufixo que vai atrás do nome (Jr., Sr., etc.)" "The title that goes before name (Mr., Mrs., etc.)","O título que vai antes do nome (Sr., Sra., etc.)" "There are no items in customer's wishlist at the moment","No momento não há itens na lista de desejos do cliente" -"There are no items in customer\'s shopping cart at the moment","Não há itens no carrinho de compras do cliente no momento" +"There are no items in customer's shopping cart at the moment","Não há itens no carrinho de compras do cliente no momento" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","Já existe uma conta com este endereço de email. Se você tem certeza que é o seu endereço de email, clique aqui para obter a sua senha e acessar sua conta." "There was an error validating the VAT ID.","Ocorreu um erro ao validar a ID do VAT." "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","Ocorreu um erro ao validar a ID do VAT. O cliente pertenceria ao grupo de clientes %s." diff --git a/app/code/Magento/Customer/i18n/zh_CN.csv b/app/code/Magento/Customer/i18n/zh_CN.csv index 814d6c969871b..4f523757b4f78 100644 --- a/app/code/Magento/Customer/i18n/zh_CN.csv +++ b/app/code/Magento/Customer/i18n/zh_CN.csv @@ -283,7 +283,7 @@ "Please enter the telephone number.","请输入电话号码。" "Please enter the zip/postal code.","请输入邮编。" "Please enter your email address below. You will receive a link to reset your password.","请在下面输入你的电子邮件地址。你将收到一个重置密码的链接。" -"Please enter your email below and we\'ll send you confirmation link for it.","请在下面输入您的邮件地址,我们将发送确认链接。" +"Please enter your email below and we'll send you confirmation link for it.","请在下面输入您的邮件地址,我们将发送确认链接。" "Please enter your email.","请输入您的电子邮件。" "Please make sure your passwords match.","请确保密码匹配。" "Please select","请选择" @@ -399,7 +399,7 @@ "The suffix that goes after name (Jr., Sr., etc.)","名字后面的后缀(Jr.、Sr.等)" "The title that goes before name (Mr., Mrs., etc.)","姓名前称谓(先生、女士等)" "There are no items in customer's wishlist at the moment","客户的愿望清单中目前没内容" -"There are no items in customer\'s shopping cart at the moment","客户的购物车中目前没内容" +"There are no items in customer's shopping cart at the moment","客户的购物车中目前没内容" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","已有帐户使用该电子邮件地址。如果您确认这是您自己的电子邮件地址,请 点击这里 获取您的密码并访问帐户。" "There was an error validating the VAT ID.","验证 VAT ID 时出错。" "There was an error validating the VAT ID. The customer would belong to Customer Group %s.","验证 VAT ID 时出错。该顾客可属于顾客群体 %s。" diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php index fb1fcf9068783..aed92b1ff835c 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php @@ -45,14 +45,14 @@ class Custom extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\DesignEditor\Model\Theme\Context $themeContext * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\DesignEditor\Model\Theme\Context $themeContext, array $data = array() diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php index d1f48b00bdfe6..af98c210a433c 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php @@ -52,7 +52,7 @@ class ImageSizing extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\DesignEditor\Model\Editor\Tools\Controls\Factory $controlFactory @@ -61,7 +61,7 @@ class ImageSizing extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Eav\Model\Config $eavConfig, \Magento\DesignEditor\Model\Editor\Tools\Controls\Factory $controlFactory, diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php index adbbcc750cb3d..ed4b0324f78ea 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php @@ -50,7 +50,7 @@ class Js extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Theme\Model\Config\Customization $customizationConfig * @param \Magento\DesignEditor\Model\Theme\Context $themeContext @@ -59,7 +59,7 @@ class Js extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Theme\Model\Config\Customization $customizationConfig, \Magento\DesignEditor\Model\Theme\Context $themeContext, diff --git a/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php b/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php index 2cc3f70dc805a..2eab8fb4b71d8 100644 --- a/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php +++ b/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php @@ -64,10 +64,11 @@ class Standard extends \Magento\Core\App\Router\Base * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param string $routerId + * @param \Magento\Code\NameBuilder $nameBuilder * @param \Magento\App\RouterListInterface $routerList * @param \Magento\ObjectManager $objectManager * @param \Magento\Core\App\Request\RewriteService $urlRewriteService - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -81,6 +82,7 @@ public function __construct( \Magento\Core\Model\Store\Config $storeConfig, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, $routerId, + \Magento\Code\NameBuilder $nameBuilder, \Magento\App\RouterListInterface $routerList, \Magento\ObjectManager $objectManager, \Magento\Core\App\Request\RewriteService $urlRewriteService @@ -95,7 +97,8 @@ public function __construct( $storeManager, $storeConfig, $urlSecurityInfo, - $routerId + $routerId, + $nameBuilder ); $this->_urlRewriteService = $urlRewriteService; $this->_objectManager = $objectManager; diff --git a/app/code/Magento/Directory/Model/Config/Source/Allregion.php b/app/code/Magento/Directory/Model/Config/Source/Allregion.php index 11ab8d386d155..c6735123e638a 100644 --- a/app/code/Magento/Directory/Model/Config/Source/Allregion.php +++ b/app/code/Magento/Directory/Model/Config/Source/Allregion.php @@ -26,7 +26,7 @@ namespace Magento\Directory\Model\Config\Source; -class Allregion implements \Magento\Core\Model\Option\ArrayInterface +class Allregion implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Directory/Model/Config/Source/Country.php b/app/code/Magento/Directory/Model/Config/Source/Country.php index 25545a9d57eac..ba649afa9f327 100644 --- a/app/code/Magento/Directory/Model/Config/Source/Country.php +++ b/app/code/Magento/Directory/Model/Config/Source/Country.php @@ -27,7 +27,7 @@ namespace Magento\Directory\Model\Config\Source; -class Country implements \Magento\Core\Model\Option\ArrayInterface +class Country implements \Magento\Option\ArrayInterface { /** * Countries diff --git a/app/code/Magento/Directory/Model/Config/Source/Country/Full.php b/app/code/Magento/Directory/Model/Config/Source/Country/Full.php index 69f91fb4f4f40..295ec53e91725 100644 --- a/app/code/Magento/Directory/Model/Config/Source/Country/Full.php +++ b/app/code/Magento/Directory/Model/Config/Source/Country/Full.php @@ -28,7 +28,7 @@ namespace Magento\Directory\Model\Config\Source\Country; class Full extends \Magento\Directory\Model\Config\Source\Country - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @param bool $isMultiselect diff --git a/app/code/Magento/Directory/Model/Country.php b/app/code/Magento/Directory/Model/Country.php index 515b4e2f77496..90e3171078ded 100644 --- a/app/code/Magento/Directory/Model/Country.php +++ b/app/code/Magento/Directory/Model/Country.php @@ -61,8 +61,8 @@ class Country extends \Magento\Core\Model\AbstractModel protected $_regionCollectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Directory\Model\Country\FormatFactory $formatFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory @@ -71,8 +71,8 @@ class Country extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $locale, \Magento\Directory\Model\Country\FormatFactory $formatFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, diff --git a/app/code/Magento/Directory/Model/Currency.php b/app/code/Magento/Directory/Model/Currency.php index aa5da371fb713..40af802960253 100644 --- a/app/code/Magento/Directory/Model/Currency.php +++ b/app/code/Magento/Directory/Model/Currency.php @@ -78,8 +78,8 @@ class Currency extends \Magento\Core\Model\AbstractModel protected $_currencyFilterFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Directory\Helper\Data $directoryHelper @@ -89,8 +89,8 @@ class Currency extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Directory\Helper\Data $directoryHelper, diff --git a/app/code/Magento/Directory/Model/Currency/Import/Source/Service.php b/app/code/Magento/Directory/Model/Currency/Import/Source/Service.php index b7a08d86ec459..e8be239bac4d4 100644 --- a/app/code/Magento/Directory/Model/Currency/Import/Source/Service.php +++ b/app/code/Magento/Directory/Model/Currency/Import/Source/Service.php @@ -23,7 +23,7 @@ */ namespace Magento\Directory\Model\Currency\Import\Source; -class Service implements \Magento\Core\Model\Option\ArrayInterface +class Service implements \Magento\Option\ArrayInterface { /** * @var \Magento\Directory\Model\Currency\Import\Config diff --git a/app/code/Magento/Directory/Model/Observer.php b/app/code/Magento/Directory/Model/Observer.php index ba7041cc24a96..0bd66c5e6624b 100644 --- a/app/code/Magento/Directory/Model/Observer.php +++ b/app/code/Magento/Directory/Model/Observer.php @@ -59,9 +59,9 @@ class Observer protected $_translate; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_emailTemplateFactory; + protected $_transportBuilder; /** * @var \Magento\Core\Model\StoreManagerInterface @@ -77,7 +77,7 @@ class Observer * @param \Magento\Directory\Model\Currency\Import\Factory $importFactory * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\TranslateInterface $translate - * @param \Magento\Email\Model\TemplateFactory $emailTemplateFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory */ @@ -85,14 +85,14 @@ public function __construct( \Magento\Directory\Model\Currency\Import\Factory $importFactory, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\TranslateInterface $translate, - \Magento\Email\Model\TemplateFactory $emailTemplateFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Directory\Model\CurrencyFactory $currencyFactory ) { $this->_importFactory = $importFactory; $this->_coreStoreConfig = $coreStoreConfig; $this->_translate = $translate; - $this->_emailTemplateFactory = $emailTemplateFactory; + $this->_transportBuilder = $transportBuilder; $this->_storeManager = $storeManager; $this->_currencyFactory = $currencyFactory; } @@ -110,21 +110,22 @@ public function scheduledUpdateCurrencyRates($schedule) return; } + $errors = array(); + $rates = array(); $service = $this->_coreStoreConfig->getConfig(self::IMPORT_SERVICE); - if( !$service ) { + if ($service) { + try { + $importModel = $this->_importFactory->create($service); + $rates = $importModel->fetchRates(); + $errors = $importModel->getMessages(); + } catch (\Exception $e) { + $importWarnings[] = __('FATAL ERROR:') . ' ' . __('We can\'t initialize the import model.'); + } + } else { $importWarnings[] = __('FATAL ERROR:') . ' ' . __('Please specify the correct Import Service.'); } - try { - $importModel = $this->_importFactory->create($service); - } catch (\Exception $e) { - $importWarnings[] = __('FATAL ERROR:') . ' ' . __('We can\'t initialize the import model.'); - } - - $rates = $importModel->fetchRates(); - $errors = $importModel->getMessages(); - - if( sizeof($errors) > 0 ) { + if (sizeof($errors) > 0) { foreach ($errors as $error) { $importWarnings[] = __('WARNING:') . ' ' . $error; } @@ -133,23 +134,23 @@ public function scheduledUpdateCurrencyRates($schedule) if (sizeof($importWarnings) == 0) { $this->_currencyFactory->create()->saveRates($rates); } else { + $translate = $this->_translate->getTranslateInline(); $this->_translate->setTranslateInline(false); - /* @var $mailTemplate \Magento\Email\Model\Template */ - $mailTemplate = $this->_emailTemplateFactory->create(); - $mailTemplate->setDesignConfig(array( - 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId() - )) - ->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_IDENTITY), - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT), - null, - array('warnings' => join("\n", $importWarnings), + $this->_transportBuilder->setTemplateIdentifier( + $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_TEMPLATE) ) - ); - $this->_translate->setTranslateInline(true); + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $this->_storeManager->getStore()->getId(), + )) + ->setTemplateVars(array('warnings' => join("\n", $importWarnings))) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_IDENTITY)) + ->addTo($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT)); + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); + + $this->_translate->setTranslateInline($translate); } } } diff --git a/app/code/Magento/Directory/Model/Resource/Country.php b/app/code/Magento/Directory/Model/Resource/Country.php index 0832b444973c4..5302b9974e92d 100644 --- a/app/code/Magento/Directory/Model/Resource/Country.php +++ b/app/code/Magento/Directory/Model/Resource/Country.php @@ -24,11 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Directory\Model\Resource; + /** * Directory Country Resource Model */ -namespace Magento\Directory\Model\Resource; - class Country extends \Magento\Core\Model\Resource\Db\AbstractDb { /** diff --git a/app/code/Magento/Directory/etc/module.xml b/app/code/Magento/Directory/etc/module.xml index ff57ec40faba2..4d55b7882c7a5 100755 --- a/app/code/Magento/Directory/etc/module.xml +++ b/app/code/Magento/Directory/etc/module.xml @@ -31,7 +31,6 @@ - diff --git a/app/code/Magento/Directory/i18n/de_DE.csv b/app/code/Magento/Directory/i18n/de_DE.csv index 4f56be7ad2b08..b6c8aa2a10f15 100644 --- a/app/code/Magento/Directory/i18n/de_DE.csv +++ b/app/code/Magento/Directory/i18n/de_DE.csv @@ -2,7 +2,7 @@ "Allowed Currencies","Zulässige Währungen" "Base Currency","Basiswährung" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","Die Basiswährung wird für alle Online-Transaktionen verwendet. Der Spielraum richtet sich nach dem Spielraum des Katalogpreises (""Katalog"" > ""Preis"" > ""Spielraum Katalogpreis"")." -"Can\'t convert rate from ""%s-%s"".","Rate kann nicht von ""%s-%s"" konvertiert werden. +"Can't convert rate from ""%s-%s"".","Rate kann nicht von ""%s-%s"" konvertiert werden. diff --git a/app/code/Magento/Directory/i18n/en_US.csv b/app/code/Magento/Directory/i18n/en_US.csv index 3f2500b921b30..378254779cff0 100644 --- a/app/code/Magento/Directory/i18n/en_US.csv +++ b/app/code/Magento/Directory/i18n/en_US.csv @@ -2,7 +2,7 @@ "Allowed Currencies","Allowed Currencies" "Base Currency","Base Currency" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"")." -"Can\'t convert rate from ""%s-%s"".","Can\'t convert rate from ""%s-%s""." +"Can't convert rate from ""%s-%s"".","Can't convert rate from ""%s-%s""." "Cannot retrieve rate from %s.","Cannot retrieve rate from %s." "Connection Timeout in Seconds","Connection Timeout in Seconds" "Continue »","Continue »" diff --git a/app/code/Magento/Directory/i18n/es_ES.csv b/app/code/Magento/Directory/i18n/es_ES.csv index 9303a1ee5b12d..877e6e69984ac 100644 --- a/app/code/Magento/Directory/i18n/es_ES.csv +++ b/app/code/Magento/Directory/i18n/es_ES.csv @@ -2,7 +2,7 @@ "Allowed Currencies","Divisas permitidas" "Base Currency","Divisa base" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","La divisa base se utiliza en todas las transacciones de pago en línea. El alcance queda definido por el alcance del precio del catálogo ((""Catálogo"" > ""Precio"" > ""Alcance del Precio del Catálogo"")." -"Can\'t convert rate from ""%s-%s"".","No se puede convertir la tarifa de ""%s-%s""." +"Can't convert rate from ""%s-%s"".","No se puede convertir la tarifa de ""%s-%s""." "Cannot retrieve rate from %s.","No se puede obtener el tipo de cambio de %s." "Connection Timeout in Seconds","Plazo de expiración de la conexión en segundos" "Continue »","Seguir >" diff --git a/app/code/Magento/Directory/i18n/fr_FR.csv b/app/code/Magento/Directory/i18n/fr_FR.csv index cfae88d7e04e8..ce5d4b714cc5b 100644 --- a/app/code/Magento/Directory/i18n/fr_FR.csv +++ b/app/code/Magento/Directory/i18n/fr_FR.csv @@ -2,7 +2,7 @@ "Allowed Currencies","Devises autorisées" "Base Currency","Devise de base" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","La monnaie de base est utilisée pour tous les paiements en ligne. Le champ est défini par l'étendue des prix du catalogue" -"Can\'t convert rate from ""%s-%s"".","Impossible de convertir le taux depuis « %s-%s ». " +"Can't convert rate from ""%s-%s"".","Impossible de convertir le taux depuis « %s-%s ». " "Cannot retrieve rate from %s.","Ne peut extraire taux du %s." "Connection Timeout in Seconds","Interruption connexion en secondes" "Continue »","Continue »" diff --git a/app/code/Magento/Directory/i18n/nl_NL.csv b/app/code/Magento/Directory/i18n/nl_NL.csv index b3b8b51d85abc..d50f01f2ad0bc 100644 --- a/app/code/Magento/Directory/i18n/nl_NL.csv +++ b/app/code/Magento/Directory/i18n/nl_NL.csv @@ -2,7 +2,7 @@ "Allowed Currencies","Toegestane Munteenheden" "Base Currency","Basis Munteenheid" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","Basis munteenheid wordt gebruikt voor alle online betalingstransacties. Reikwijdte is gedefinieerd door de catalogus prijsreikwijdte (""Catalogus"" > ""Prijs"" > ""Catalogus prijsreikwijdte"")." -"Can\'t convert rate from ""%s-%s"".","Kan tarief niet omzetten van ""%s-%s""." +"Can't convert rate from ""%s-%s"".","Kan tarief niet omzetten van ""%s-%s""." "Cannot retrieve rate from %s.","Kan koers niet terughalen van %s." "Connection Timeout in Seconds","Connectie Timeout in Secondes" "Continue »","Ga verder »" diff --git a/app/code/Magento/Directory/i18n/pt_BR.csv b/app/code/Magento/Directory/i18n/pt_BR.csv index 187c80c56465a..4cd0b3dd4a21f 100644 --- a/app/code/Magento/Directory/i18n/pt_BR.csv +++ b/app/code/Magento/Directory/i18n/pt_BR.csv @@ -2,7 +2,7 @@ "Allowed Currencies","Moedas Permitidas" "Base Currency","Moeda Padrão" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","A Moeda Padrão é usada em todas as transações de pagamento online. O escopo é definido pelo escopo do preço de catálogo (""Catálogo"" > ""Preço"" > ""Escopo do Preço de Catálogo"")." -"Can\'t convert rate from ""%s-%s"".","Não é possível converter taxa de ""%s-%s""." +"Can't convert rate from ""%s-%s"".","Não é possível converter taxa de ""%s-%s""." "Cannot retrieve rate from %s.","Não foi possível recuperar a taxa do %s." "Connection Timeout in Seconds","Duração da Conexão em Segundos" "Continue »","Continuar »" diff --git a/app/code/Magento/Directory/i18n/zh_CN.csv b/app/code/Magento/Directory/i18n/zh_CN.csv index 3bb687c8cb3e3..3650a4d73c19e 100644 --- a/app/code/Magento/Directory/i18n/zh_CN.csv +++ b/app/code/Magento/Directory/i18n/zh_CN.csv @@ -2,7 +2,7 @@ "Allowed Currencies","允许的货币" "Base Currency","基准货币" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","基准货币将被所有在线支付交易所使用。范围则是由分类价格范围 (""分类"" > ""价格"" > ""分类价格范围"")决定的。" -"Can\'t convert rate from ""%s-%s"".","无法执行 ""%s-%s"" 费率转换。" +"Can't convert rate from ""%s-%s"".","无法执行 ""%s-%s"" 费率转换。" "Cannot retrieve rate from %s.","无法从 %s 获取费率。" "Connection Timeout in Seconds","连接超时的秒数" "Continue »","继续 »" diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php index f0613c86c56ec..1202235245b6e 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php @@ -57,18 +57,18 @@ class Downloadable /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index c7e32e9e3a0c3..fd5d4ada360b0 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -69,7 +69,7 @@ class Links /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -103,7 +103,7 @@ class Links * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param \Magento\Downloadable\Helper\File $downloadableFile - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Backend\Model\Config\Source\Yesno $sourceModel * @param \Magento\Downloadable\Model\Link $link * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory @@ -115,7 +115,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Downloadable\Helper\File $downloadableFile, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Backend\Model\Config\Source\Yesno $sourceModel, \Magento\Downloadable\Model\Link $link, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index 0856881b0d282..73c83a0611a1d 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -62,7 +62,7 @@ class Samples /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -86,7 +86,7 @@ class Samples * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param \Magento\Downloadable\Helper\File $downloadableFile - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Downloadable\Model\Sample $sampleModel * @param \Magento\Backend\Model\UrlFactory $urlFactory * @param array $data @@ -96,7 +96,7 @@ public function __construct( \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Downloadable\Helper\File $downloadableFile, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Downloadable\Model\Sample $sampleModel, \Magento\Backend\Model\UrlFactory $urlFactory, array $data = array() diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php index 9bef411e39cff..b2a4e55cbba51 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php @@ -53,7 +53,7 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -67,13 +67,13 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Core\Helper\Data $coreData * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Downloadable/Model/Link.php b/app/code/Magento/Downloadable/Model/Link.php index cce76ad307e76..60de68d63f478 100644 --- a/app/code/Magento/Downloadable/Model/Link.php +++ b/app/code/Magento/Downloadable/Model/Link.php @@ -68,15 +68,15 @@ class Link extends \Magento\Core\Model\AbstractModel const LINK_SHAREABLE_CONFIG = 2; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Downloadable/Model/Product/Type.php b/app/code/Magento/Downloadable/Model/Product/Type.php index 72906e14cb090..389acfc2b1bc7 100644 --- a/app/code/Magento/Downloadable/Model/Product/Type.php +++ b/app/code/Magento/Downloadable/Model/Product/Type.php @@ -86,7 +86,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\Virtual * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\Downloadable\Model\Resource\SampleFactory $sampleResFactory * @param \Magento\Downloadable\Model\Resource\Link $linkResource @@ -105,7 +105,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Downloadable\Helper\File $downloadableFile, \Magento\Downloadable\Model\Resource\SampleFactory $sampleResFactory, diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php index 45722f1720bb8..e15b44f5a3d62 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php @@ -56,8 +56,8 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra protected $_itemsFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -69,8 +69,8 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php index 10e3a85e91fe5..42a176fd6d5d1 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -37,8 +37,8 @@ class Creditmemo extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstr protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -51,8 +51,8 @@ class Creditmemo extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstr * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php index 72c4f8b1172ac..d31f14a7f95f0 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php @@ -37,8 +37,8 @@ class Invoice extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstract protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -51,8 +51,8 @@ class Invoice extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstract * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Downloadable/Model/Sample.php b/app/code/Magento/Downloadable/Model/Sample.php index fb83a5c1e2487..b0ce9b0afed47 100644 --- a/app/code/Magento/Downloadable/Model/Sample.php +++ b/app/code/Magento/Downloadable/Model/Sample.php @@ -49,15 +49,15 @@ class Sample extends \Magento\Core\Model\AbstractModel const XML_PATH_SAMPLES_TITLE = 'catalog/downloadable/samples_title'; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Downloadable/Model/System/Config/Source/Contentdisposition.php b/app/code/Magento/Downloadable/Model/System/Config/Source/Contentdisposition.php index 36a7bdf9019ae..34280adbc04ba 100644 --- a/app/code/Magento/Downloadable/Model/System/Config/Source/Contentdisposition.php +++ b/app/code/Magento/Downloadable/Model/System/Config/Source/Contentdisposition.php @@ -33,7 +33,7 @@ */ namespace Magento\Downloadable\Model\System\Config\Source; -class Contentdisposition implements \Magento\Core\Model\Option\ArrayInterface +class Contentdisposition implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/Downloadable/Model/System/Config/Source/Orderitemstatus.php b/app/code/Magento/Downloadable/Model/System/Config/Source/Orderitemstatus.php index d841d001dca6c..50074b23fdbb0 100644 --- a/app/code/Magento/Downloadable/Model/System/Config/Source/Orderitemstatus.php +++ b/app/code/Magento/Downloadable/Model/System/Config/Source/Orderitemstatus.php @@ -33,7 +33,7 @@ */ namespace Magento\Downloadable\Model\System\Config\Source; -class Orderitemstatus implements \Magento\Core\Model\Option\ArrayInterface +class Orderitemstatus implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/Downloadable/i18n/de_DE.csv b/app/code/Magento/Downloadable/i18n/de_DE.csv index 83e11b986bedd..3bb2638c64964 100644 --- a/app/code/Magento/Downloadable/i18n/de_DE.csv +++ b/app/code/Magento/Downloadable/i18n/de_DE.csv @@ -1,7 +1,7 @@ "Add","Hinzufügen" "Add New Row","Neue Zeile hinzufügen" "Add links and samples to downloadable product","Links und Beispiele zum herunterladbaren Produkt hinzufügen" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Alphanumerische Zeichen, Bindestriche und Unterstriche werden für Dateinamen empfohlen. Unangemessene Zeichen werden durch '_' ersetzt." +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","Alphanumerische Zeichen, Bindestriche und Unterstriche werden für Dateinamen empfohlen. Unangemessene Zeichen werden durch '_' ersetzt." "An error occurred while getting requested content. Please contact the store owner.","Beim Laden des angeforderten Inhalts ist ein Fehler aufgetreten. Bitte kontaktieren Sie den Shopbesitzer." "An error occurred while getting the requested content.","Beim Laden des angeforderten Inhalts ist ein Fehler aufgetreten." "An error occurred while getting the requested content. Please contact the store owner.","Beim Laden des angeforderten Inhalts ist ein Fehler aufgetreten. Bitte kontaktieren Sie den Shopbesitzer." diff --git a/app/code/Magento/Downloadable/i18n/en_US.csv b/app/code/Magento/Downloadable/i18n/en_US.csv index cf7ac4064c268..fb01a8cd48adb 100644 --- a/app/code/Magento/Downloadable/i18n/en_US.csv +++ b/app/code/Magento/Downloadable/i18n/en_US.csv @@ -1,7 +1,7 @@ "Add","Add" "Add New Row","Add New Row" "Add links and samples to downloadable product","Add links and samples to downloadable product" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'." +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'." "An error occurred while getting requested content. Please contact the store owner.","An error occurred while getting requested content. Please contact the store owner." "An error occurred while getting the requested content.","An error occurred while getting the requested content." "An error occurred while getting the requested content. Please contact the store owner.","An error occurred while getting the requested content. Please contact the store owner." diff --git a/app/code/Magento/Downloadable/i18n/es_ES.csv b/app/code/Magento/Downloadable/i18n/es_ES.csv index db1e2d386a5ff..f63ec45bbdd0e 100644 --- a/app/code/Magento/Downloadable/i18n/es_ES.csv +++ b/app/code/Magento/Downloadable/i18n/es_ES.csv @@ -1,7 +1,7 @@ "Add","Añadir" "Add New Row","Agregar nueva fila" "Add links and samples to downloadable product","Añadir enlaces y muestras al producto de descarga" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Se recomiendan los caracteres alfanuméricos, guión y guión bajo para los nombres de fichero. Los caracteres incorrectos se reemplazarán con '_'." +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","Se recomiendan los caracteres alfanuméricos, guión y guión bajo para los nombres de fichero. Los caracteres incorrectos se reemplazarán con '_'." "An error occurred while getting requested content. Please contact the store owner.","Ocurrió un error mientras se recibía el contenido solicitado. Por favor, póngase en contacto con el propietario de la tienda." "An error occurred while getting the requested content.","Ocurrió un error mientras se recibía el contenido solicitado." "An error occurred while getting the requested content. Please contact the store owner.","Ocurrió un error mientras se recibía el contenido solicitado. Por favor, póngase en contacto con el propietario de la tienda." diff --git a/app/code/Magento/Downloadable/i18n/fr_FR.csv b/app/code/Magento/Downloadable/i18n/fr_FR.csv index 288a1942a1820..1aeaeb40fccf4 100644 --- a/app/code/Magento/Downloadable/i18n/fr_FR.csv +++ b/app/code/Magento/Downloadable/i18n/fr_FR.csv @@ -1,7 +1,7 @@ "Add","Ajouter" "Add New Row","Ajouter nouvelle ligne" "Add links and samples to downloadable product","Ajouter des liens et des échantillons au produit téléchargeable" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Il est recommandé de n'utiliser que des lettres, des chiffres, le tiret (-) et le blanc souligné (_) pour les noms de fichiers. Les caractères invalides seront remplacés par '_'." +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","Il est recommandé de n'utiliser que des lettres, des chiffres, le tiret (-) et le blanc souligné (_) pour les noms de fichiers. Les caractères invalides seront remplacés par '_'." "An error occurred while getting requested content. Please contact the store owner.","Une erreur s'est produite en accédant au contenu demandé. Contactez le propriétaire du site." "An error occurred while getting the requested content.","Une erreur s'est produite en accédant au contenu demandé." "An error occurred while getting the requested content. Please contact the store owner.","Un erreur s'est produite en accédant au contenu demandé. Contactez le propriétaire du site." diff --git a/app/code/Magento/Downloadable/i18n/nl_NL.csv b/app/code/Magento/Downloadable/i18n/nl_NL.csv index 38b5197ef69d2..3f50dc48ba220 100644 --- a/app/code/Magento/Downloadable/i18n/nl_NL.csv +++ b/app/code/Magento/Downloadable/i18n/nl_NL.csv @@ -1,7 +1,7 @@ "Add","Toevoegen" "Add New Row","Voeg Nieuwe Rij Toe" "Add links and samples to downloadable product","Voeg links en voorbeelden toe aan te downloaden product" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Alfanumerieke, schuine streep en onderstreepte lettertekens worden aangeraden voor bestandsnamen. Ongeschikte lettertekens worden vervangen met \'_\'." +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","Alfanumerieke, schuine streep en onderstreepte lettertekens worden aangeraden voor bestandsnamen. Ongeschikte lettertekens worden vervangen met '_'." "An error occurred while getting requested content. Please contact the store owner.","Er is een fout opgetreden bij het ophalen van de gevraagde content. Neem alstublieft contact op met de winkeleigenaar." "An error occurred while getting the requested content.","Er is een fout opgetreden bij het ophalen van de gevraagde content." "An error occurred while getting the requested content. Please contact the store owner.","Er is een fout opgetreden bij het ophalen van de gevraagde content. Neem alstublieft contact op met de winkeleigenaar." diff --git a/app/code/Magento/Downloadable/i18n/pt_BR.csv b/app/code/Magento/Downloadable/i18n/pt_BR.csv index 8558da76c5808..d728427b30b6b 100644 --- a/app/code/Magento/Downloadable/i18n/pt_BR.csv +++ b/app/code/Magento/Downloadable/i18n/pt_BR.csv @@ -1,7 +1,7 @@ "Add","Adicionar" "Add New Row","Adicionar Nova Linha" "Add links and samples to downloadable product","Adicionar links e amostras de produto para download" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Caracteres alfanuméricos, traço e sublinhado são recomendados para nomes de arquivos. Caracteres impróprios são substituídos por \'_\'." +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","Caracteres alfanuméricos, traço e sublinhado são recomendados para nomes de arquivos. Caracteres impróprios são substituídos por '_'." "An error occurred while getting requested content. Please contact the store owner.","Ocorreu um erro ao obter o conteúdo solicitado. Por favor contate o proprietário da loja." "An error occurred while getting the requested content.","Ocorreu um erro ao obter o conteúdo solicitado." "An error occurred while getting the requested content. Please contact the store owner.","Ocorreu um erro ao obter o conteúdo solicitado. Por favor contate o proprietário da loja." diff --git a/app/code/Magento/Downloadable/i18n/zh_CN.csv b/app/code/Magento/Downloadable/i18n/zh_CN.csv index 4e4ed829ccc1a..0b7be786272e0 100644 --- a/app/code/Magento/Downloadable/i18n/zh_CN.csv +++ b/app/code/Magento/Downloadable/i18n/zh_CN.csv @@ -1,7 +1,7 @@ "Add","添加" "Add New Row","添加新行" "Add links and samples to downloadable product","为可下载产品添加链接与范例" -"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","建议对文件名使用字母、横线,以及下划线字符。错误的字符将被使用 \'_\'替换。" +"Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with '_'.","建议对文件名使用字母、横线,以及下划线字符。错误的字符将被使用 '_'替换。" "An error occurred while getting requested content. Please contact the store owner.","获取所请求内容时出错。请联系店铺所有者。" "An error occurred while getting the requested content.","获取所请求的内容时出错。" "An error occurred while getting the requested content. Please contact the store owner.","获取所请求的内容时出错。请联系店铺所有者。" diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php index bb6a45e97f6f8..ee86f3edde8cd 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php @@ -70,7 +70,7 @@ abstract class AbstractMain /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Eav\Helper\Data $eavData * @param \Magento\Backend\Model\Config\Source\YesnoFactory $yesnoFactory @@ -80,7 +80,7 @@ abstract class AbstractMain */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Eav\Helper\Data $eavData, \Magento\Backend\Model\Config\Source\YesnoFactory $yesnoFactory, diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php index 22d9a3860bee8..aae5663aabf9d 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php @@ -35,7 +35,7 @@ class Labels extends \Magento\Backend\Block\Template { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -46,12 +46,12 @@ class Labels extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { parent::__construct($context, $data); diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php index 02ff145855820..5c91e805910a3 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php @@ -38,7 +38,7 @@ class Options extends \Magento\Backend\Block\Template { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -59,14 +59,14 @@ class Options extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory, \Magento\Validator\UniversalFactory $universalFactory, array $data = array() diff --git a/app/code/Magento/Eav/Helper/Data.php b/app/code/Magento/Eav/Helper/Data.php index a50aab19ccac9..4f80bb998074c 100644 --- a/app/code/Magento/Eav/Helper/Data.php +++ b/app/code/Magento/Eav/Helper/Data.php @@ -59,18 +59,26 @@ class Data extends \Magento\App\Helper\AbstractHelper */ protected $_attributeConfig; + /** + * @var \Magento\Eav\Model\Config + */ + protected $_eavConfig; + /** * @param \Magento\App\Helper\Context $context * @param \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\App\Helper\Context $context, \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig, - \Magento\Core\Model\Store\Config $coreStoreConfig + \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Eav\Model\Config $eavConfig ) { $this->_coreStoreConfig = $coreStoreConfig; $this->_attributeConfig = $attributeConfig; + $this->_eavConfig = $eavConfig; parent::__construct($context); } @@ -164,4 +172,25 @@ public function getInputTypesValidatorData() { return $this->_coreStoreConfig->getConfig(self::XML_PATH_VALIDATOR_DATA_INPUT_TYPES); } + + /** + * Retrieve attribute metadata. + * + * @param string $entityTypeCode + * @param string $attributeCode + * @return array
    [
    +     *      'entity_type_id' => $entityTypeId,
    +     *      'attribute_id' => $attributeId,
    +     *      'attribute_table' => $attributeTable
    +     * ]
    + */ + public function getAttributeMetadata($entityTypeCode, $attributeCode) + { + $attribute = $this->_eavConfig->getAttribute($entityTypeCode, $attributeCode); + return [ + 'entity_type_id' => $attribute->getEntityTypeId(), + 'attribute_id' => $attribute->getAttributeId(), + 'attribute_table' => $attribute->getBackend()->getTable(), + ]; + } } diff --git a/app/code/Magento/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php b/app/code/Magento/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php index adfa4def53c68..7a8316005e275 100644 --- a/app/code/Magento/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php +++ b/app/code/Magento/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Adminhtml\System\Config\Source; -class Inputtype implements \Magento\Core\Model\Option\ArrayInterface +class Inputtype implements \Magento\Option\ArrayInterface { /** * Return array of options diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Text.php b/app/code/Magento/Eav/Model/Attribute/Data/Text.php index 8330b6310829b..967bc8ab4ab6e 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Text.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Text.php @@ -37,7 +37,7 @@ class Text extends \Magento\Eav\Model\Attribute\Data\AbstractData { /** - * @var \Magento\Core\Helper\String + * @var \Magento\Stdlib\String */ protected $_string; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index 21e8828fe2024..5f203ea9e7cf9 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -74,8 +74,8 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute protected $_catalogProductFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory @@ -89,8 +89,8 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\Data $coreData, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory, diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php index e62a57013b2f1..1b22e7f784e3e 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php @@ -120,8 +120,8 @@ abstract class AbstractAttribute protected $_universalFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory @@ -133,8 +133,8 @@ abstract class AbstractAttribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Helper\Data $coreData, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory, diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Entity/Attribute/Set.php index 3b19e293b1220..f5a0a85bce8e6 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Set.php @@ -80,8 +80,8 @@ class Set extends \Magento\Core\Model\AbstractModel protected $_resourceAttribute; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\GroupFactory $attrGroupFactory * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory @@ -91,8 +91,8 @@ class Set extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\GroupFactory $attrGroupFactory, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/AbstractSource.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/AbstractSource.php index 66d9c151a2c24..63e5880217da8 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/AbstractSource.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/AbstractSource.php @@ -33,7 +33,7 @@ * @author Magento Core Team */ abstract class AbstractSource - implements \Magento\Eav\Model\Entity\Attribute\Source\SourceInterface, \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Eav\Model\Entity\Attribute\Source\SourceInterface, \Magento\Option\ArrayInterface { /** * Reference to the attribute instance diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php index ca9da43215add..c3676831f0323 100644 --- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php +++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php @@ -1097,7 +1097,7 @@ public function setRowIdFieldName($fieldName) */ public function _loadEntities($printQuery = false, $logQuery = false) { - $entity = $this->getEntity(); + $this->getEntity(); if ($this->_pageSize) { $this->getSelect()->limitPage($this->getCurPage(), $this->_pageSize); @@ -1546,4 +1546,38 @@ public function getLoadedIds() { return array_keys($this->_items); } + + /** + * Clear collection + * @return $this + */ + public function clear() + { + $this->_itemsById = array(); + return parent::clear(); + } + + /** + * Remove all items from collection + * @return $this + */ + public function removeAllItems() + { + $this->_itemsById = array(); + return parent::removeAllItems(); + } + + /** + * Remove item from collection by item key + * + * @param mixed $key + * @return $this + */ + public function removeItemByKey($key) + { + if (isset($this->_items[$key])) { + unset($this->_itemsById[$this->_items[$key]->getId()]); + } + return parent::removeItemByKey($key); + } } diff --git a/app/code/Magento/Eav/Model/Entity/Type.php b/app/code/Magento/Eav/Model/Entity/Type.php index 96a285394277f..1645cd88521ed 100644 --- a/app/code/Magento/Eav/Model/Entity/Type.php +++ b/app/code/Magento/Eav/Model/Entity/Type.php @@ -103,8 +103,8 @@ class Type extends \Magento\Core\Model\AbstractModel protected $_universalFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attSetFactory * @param \Magento\Eav\Model\Entity\StoreFactory $storeFactory @@ -114,8 +114,8 @@ class Type extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, \Magento\Eav\Model\Entity\Attribute\SetFactory $attSetFactory, \Magento\Eav\Model\Entity\StoreFactory $storeFactory, diff --git a/app/code/Magento/Eav/Model/Form/Element.php b/app/code/Magento/Eav/Model/Form/Element.php index 3dc2c829d7760..ea60b5c88d6ea 100644 --- a/app/code/Magento/Eav/Model/Form/Element.php +++ b/app/code/Magento/Eav/Model/Form/Element.php @@ -59,16 +59,16 @@ class Element extends \Magento\Core\Model\AbstractModel protected $_eavConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Eav/Model/Form/Fieldset.php b/app/code/Magento/Eav/Model/Form/Fieldset.php index 4fb96b91f8bfb..c2577394a6dee 100644 --- a/app/code/Magento/Eav/Model/Form/Fieldset.php +++ b/app/code/Magento/Eav/Model/Form/Fieldset.php @@ -55,16 +55,16 @@ class Fieldset extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Eav/Model/Form/Type.php b/app/code/Magento/Eav/Model/Form/Type.php index 89b8a3a3bfb5d..9410aa0884d65 100644 --- a/app/code/Magento/Eav/Model/Form/Type.php +++ b/app/code/Magento/Eav/Model/Form/Type.php @@ -64,8 +64,8 @@ class Type extends \Magento\Core\Model\AbstractModel protected $_elementFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Eav\Model\Form\FieldsetFactory $fieldsetFactory * @param \Magento\Eav\Model\Form\ElementFactory $elementFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -73,8 +73,8 @@ class Type extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Eav\Model\Form\FieldsetFactory $fieldsetFactory, \Magento\Eav\Model\Form\ElementFactory $elementFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php index 090b316c34fa1..5d1430865e8d8 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php @@ -38,7 +38,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collection { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registryManager; @@ -47,7 +47,7 @@ class Collection * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Model\Registry $registryManager + * @param \Magento\Registry $registryManager * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ @@ -56,7 +56,7 @@ public function __construct( \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Model\Registry $registryManager, + \Magento\Registry $registryManager, $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index b1e80c09b207b..8a01cbab82735 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -144,14 +144,14 @@ public function setStoreFilter($storeId = null, $useDefaultValue = true) } /** - * Add option id(s) frilter to collection + * Add option id(s) filter to collection * * @param int|array $optionId * @return $this */ public function setIdFilter($optionId) { - return $this->addFieldToFilter('option_id', array('in' => $optionId)); + return $this->addFieldToFilter('main_table.option_id', array('in' => $optionId)); } /** diff --git a/app/code/Magento/Eav/i18n/de_DE.csv b/app/code/Magento/Eav/i18n/de_DE.csv index 22a5a022beae7..d4dce2922b8b1 100644 --- a/app/code/Magento/Eav/i18n/de_DE.csv +++ b/app/code/Magento/Eav/i18n/de_DE.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","Attributobjekt ist undefiniert" "Attribute set with the ""%s"" name already exists.","Attributset mit dem Namen ""%s"" besteht bereits." "Attribute with the same code","Attribut mit dem gleichen Code" -"Can\'t create table: %s","Kann keine Tabelle erstellen: %s" +"Can't create table: %s","Kann keine Tabelle erstellen: %s" "Catalog Input Type for Store Owner","Katalog Eingabetyp für Shopbesitzer" "Current module EAV entity is undefined","Aktuelles Modul EAV-Einheit ist nicht definiert" "Current module pathname is undefined","Der derzeitige Modulpfad ist undefiniert" @@ -107,7 +107,7 @@ "System","System" "Text Area","Textbereich" "Text Field","Textfeld" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","Der Attributcode \'%s\' wurde vom System reserviert. Bitte probieren Sie einen anderen Attributcode aus." +"The attribute code '%s' is reserved by system. Please try another attribute code","Der Attributcode '%s' wurde vom System reserviert. Bitte probieren Sie einen anderen Attributcode aus." "The value of attribute ""%s"" must be unique","Der Wert des Attributs ""%s"" muss einzigartig sein." "The value of attribute ""%s"" must be unique.","Der Wert des Attributs ""%s"" muss einzigartig sein." "URL","URL" diff --git a/app/code/Magento/Eav/i18n/en_US.csv b/app/code/Magento/Eav/i18n/en_US.csv index cc86ab1496911..87734b831566b 100644 --- a/app/code/Magento/Eav/i18n/en_US.csv +++ b/app/code/Magento/Eav/i18n/en_US.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","Attribute object is undefined" "Attribute set with the ""%s"" name already exists.","Attribute set with the ""%s"" name already exists." "Attribute with the same code","Attribute with the same code" -"Can\'t create table: %s","Can\'t create table: %s" +"Can't create table: %s","Can't create table: %s" "Catalog Input Type for Store Owner","Catalog Input Type for Store Owner" "Current module EAV entity is undefined","Current module EAV entity is undefined" "Current module pathname is undefined","Current module pathname is undefined" @@ -107,7 +107,7 @@ "System","System" "Text Area","Text Area" "Text Field","Text Field" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","The attribute code \'%s\' is reserved by system. Please try another attribute code" +"The attribute code '%s' is reserved by system. Please try another attribute code","The attribute code '%s' is reserved by system. Please try another attribute code" "The value of attribute ""%s"" must be unique","The value of attribute ""%s"" must be unique" "The value of attribute ""%s"" must be unique.","The value of attribute ""%s"" must be unique." "URL","URL" diff --git a/app/code/Magento/Eav/i18n/es_ES.csv b/app/code/Magento/Eav/i18n/es_ES.csv index 0bd271735d972..250578defc44c 100644 --- a/app/code/Magento/Eav/i18n/es_ES.csv +++ b/app/code/Magento/Eav/i18n/es_ES.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","Objeto de campo indefinido" "Attribute set with the ""%s"" name already exists.","El atributo fijado con el nombre ""%s"" ya existe." "Attribute with the same code","Atributo con el mismo código" -"Can\'t create table: %s","No se puede crear la tabla: %s" +"Can't create table: %s","No se puede crear la tabla: %s" "Catalog Input Type for Store Owner","Tipo de entrada de catálogo para el dueño de la tienda" "Current module EAV entity is undefined","Entidad de módulo EAV actual indefinida" "Current module pathname is undefined","Módulo URL actual indefinido" @@ -107,7 +107,7 @@ "System","Sistema" "Text Area","Área de Texto" "Text Field","Campo de Texto" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","El código de atributo \'%s\' está reservado por el sistema. Por favor, prueba con otro código de atributo" +"The attribute code '%s' is reserved by system. Please try another attribute code","El código de atributo '%s' está reservado por el sistema. Por favor, prueba con otro código de atributo" "The value of attribute ""%s"" must be unique","El valor del atributo ""%s"" tiene que ser único" "The value of attribute ""%s"" must be unique.","El valor del atributo ""%s"" tiene que ser único." "URL","URL" diff --git a/app/code/Magento/Eav/i18n/fr_FR.csv b/app/code/Magento/Eav/i18n/fr_FR.csv index bed65a5677cbb..dee07cd04a866 100644 --- a/app/code/Magento/Eav/i18n/fr_FR.csv +++ b/app/code/Magento/Eav/i18n/fr_FR.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","L'attribut de l'objet n'est pas défini" "Attribute set with the ""%s"" name already exists.","Un attribut avec le nom ""%s"" existe déjà." "Attribute with the same code","Attribut avec le même code" -"Can\'t create table: %s","Ne peut pas créer la table : %s" +"Can't create table: %s","Ne peut pas créer la table : %s" "Catalog Input Type for Store Owner","Type d'entrée de catalogue pour le propriétaire de la boutique" "Current module EAV entity is undefined","L'entité de module actuelle EAV n'est pas définie" "Current module pathname is undefined","Le nom du répertoire du module actuel n'est pas défini" @@ -107,7 +107,7 @@ "System","Système" "Text Area","Zone de texte" "Text Field","Champ de texte" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","Le code d'attribut \'%s\' est réservé par le système. Veuillez essayer un autre code" +"The attribute code '%s' is reserved by system. Please try another attribute code","Le code d'attribut '%s' est réservé par le système. Veuillez essayer un autre code" "The value of attribute ""%s"" must be unique","La valeur de l'attribut ""%s"" doit être unique" "The value of attribute ""%s"" must be unique.","La valeur de l'attribut ""%s"" doit être unique." "URL","URL" diff --git a/app/code/Magento/Eav/i18n/nl_NL.csv b/app/code/Magento/Eav/i18n/nl_NL.csv index 0e58223045a68..fc59d4a4f3fa1 100644 --- a/app/code/Magento/Eav/i18n/nl_NL.csv +++ b/app/code/Magento/Eav/i18n/nl_NL.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","Attribuut object is ongedefinieerd" "Attribute set with the ""%s"" name already exists.","Attributenset met naam ""%s"" bestaat al." "Attribute with the same code","Attribuut met zelfde code" -"Can\'t create table: %s","Kan geen tabel creëren: %s" +"Can't create table: %s","Kan geen tabel creëren: %s" "Catalog Input Type for Store Owner","Catalogus Input Type voor Winkeleigenaar" "Current module EAV entity is undefined","Huidige module EAV eenheid in ongedefinieerd" "Current module pathname is undefined","Huidige module padnaam is ongedefinieerd" @@ -107,7 +107,7 @@ "System","Systeem" "Text Area","Tekstgebied" "Text Field","Tekstveld" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","De attribuutcode \'%s\' is door het systeem gereserveerd. Probeer alsjeblieft een andere attribuutcode." +"The attribute code '%s' is reserved by system. Please try another attribute code","De attribuutcode '%s' is door het systeem gereserveerd. Probeer alsjeblieft een andere attribuutcode." "The value of attribute ""%s"" must be unique","De waarde van attribuut ""%s"" moet uniek zijn" "The value of attribute ""%s"" must be unique.","De waarde van attribute ""%s"" moet uniek zijn." "URL","URL" diff --git a/app/code/Magento/Eav/i18n/pt_BR.csv b/app/code/Magento/Eav/i18n/pt_BR.csv index 4629f833bce51..41e063a99733b 100644 --- a/app/code/Magento/Eav/i18n/pt_BR.csv +++ b/app/code/Magento/Eav/i18n/pt_BR.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","Objeto do atributo é indefinido" "Attribute set with the ""%s"" name already exists.","Atributo definido com o nome ""%s"" já existe." "Attribute with the same code","Atributo com o mesmo código" -"Can\'t create table: %s","Não é possível criar tabela: %s" +"Can't create table: %s","Não é possível criar tabela: %s" "Catalog Input Type for Store Owner","Catálogo de Tipo de Entrada para Dono da Loja" "Current module EAV entity is undefined","Módulo de entidade EAV atual indefinido" "Current module pathname is undefined","Nome do caminho do módulo atual indefinido" @@ -107,7 +107,7 @@ "System","Sistema" "Text Area","Área de texto" "Text Field","Campo de texto" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","O código de atributo \'%s\' é reservado pelo sistema. Tente outro código de atributo" +"The attribute code '%s' is reserved by system. Please try another attribute code","O código de atributo '%s' é reservado pelo sistema. Tente outro código de atributo" "The value of attribute ""%s"" must be unique","O valor do atributo ""%s"" tem de ser único." "The value of attribute ""%s"" must be unique.","O valor do atributo ""%s"" tem de ser único." "URL","URL" diff --git a/app/code/Magento/Eav/i18n/zh_CN.csv b/app/code/Magento/Eav/i18n/zh_CN.csv index 5d54aa8a21988..d74c3a834780a 100644 --- a/app/code/Magento/Eav/i18n/zh_CN.csv +++ b/app/code/Magento/Eav/i18n/zh_CN.csv @@ -41,7 +41,7 @@ "Attribute object is undefined","属性对象未定义" "Attribute set with the ""%s"" name already exists.","使用“%s”为名的属性已存在。" "Attribute with the same code","使用相同代码的属性" -"Can\'t create table: %s","无法创建表格:%s" +"Can't create table: %s","无法创建表格:%s" "Catalog Input Type for Store Owner","店铺所有者的分类输出类型" "Current module EAV entity is undefined","当前模块EAV实体未定义" "Current module pathname is undefined","当前模块路径名未定义" @@ -107,7 +107,7 @@ "System","系统" "Text Area","文本区" "Text Field","文本字段" -"The attribute code \'%s\' is reserved by system. Please try another attribute code","属性代码‘%s’已被系统预留。请尝试另一个属性代码" +"The attribute code '%s' is reserved by system. Please try another attribute code","属性代码‘%s’已被系统预留。请尝试另一个属性代码" "The value of attribute ""%s"" must be unique","属性“%s”的值必须为唯一" "The value of attribute ""%s"" must be unique.","属性“%s”的值必须为唯一。" "URL","URL" diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php index c9b0322d3ef4b..db9c1d15cca97 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php @@ -36,7 +36,7 @@ class Edit extends \Magento\Backend\Block\Widget { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registryManager; @@ -75,7 +75,7 @@ class Edit extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Backend\Model\Menu\Config $menuConfig * @param \Magento\Backend\Model\Config\Structure $configStructure * @param \Magento\Email\Model\Template\Config $emailConfig @@ -85,7 +85,7 @@ class Edit extends \Magento\Backend\Block\Widget public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Backend\Model\Menu\Config $menuConfig, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\Email\Model\Template\Config $emailConfig, diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php index d04321a6b97ee..75c642e0b796d 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php @@ -44,7 +44,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\VariableFactory $variableFactory * @param \Magento\Email\Model\Source\Variables $variables @@ -52,7 +52,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\VariableFactory $variableFactory, \Magento\Email\Model\Source\Variables $variables, diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php index 631aeecc8a9be..f9ee75c43c8ca 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php @@ -41,8 +41,8 @@ class Type extends \Magento\Backend\Block\Widget\Grid\Column\Filter\Select */ protected static $_types = array( null => null, - \Magento\Email\Model\Template::TYPE_HTML => 'HTML', - \Magento\Email\Model\Template::TYPE_TEXT => 'Text', + \Magento\App\TemplateTypesInterface::TYPE_HTML => 'HTML', + \Magento\App\TemplateTypesInterface::TYPE_TEXT => 'Text', ); /** diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php index 9914474f69a49..47511c3db31fa 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php @@ -40,8 +40,8 @@ class Type extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRe * @var array */ protected static $_types = array( - \Magento\Email\Model\Template::TYPE_HTML => 'HTML', - \Magento\Email\Model\Template::TYPE_TEXT => 'Text', + \Magento\App\TemplateTypesInterface::TYPE_HTML => 'HTML', + \Magento\App\TemplateTypesInterface::TYPE_TEXT => 'Text', ); /** diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php b/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php index 2214cc2ee343f..f3df50ff705c6 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php @@ -36,7 +36,7 @@ class Preview extends \Magento\Backend\Block\Widget { /** - * @var \Magento\Core\Model\Input\Filter\MaliciousCode + * @var \Magento\Filter\Input\MaliciousCode */ protected $_maliciousCode; @@ -47,13 +47,13 @@ class Preview extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Input\Filter\MaliciousCode $maliciousCode + * @param \Magento\Filter\Input\MaliciousCode $maliciousCode * @param \Magento\Email\Model\TemplateFactory $emailFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Input\Filter\MaliciousCode $maliciousCode, + \Magento\Filter\Input\MaliciousCode $maliciousCode, \Magento\Email\Model\TemplateFactory $emailFactory, array $data = array() ) { diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php index 1fe3730df8af2..7d07797f55a4e 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php @@ -37,17 +37,17 @@ class Template extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); @@ -152,7 +152,7 @@ public function saveAction() } if ($request->getParam('_change_type_flag')) { - $template->setTemplateType(\Magento\Email\Model\Template::TYPE_TEXT); + $template->setTemplateType(\Magento\App\TemplateTypesInterface::TYPE_TEXT); $template->setTemplateStyles(''); } diff --git a/app/code/Magento/Email/Model/BackendTemplate.php b/app/code/Magento/Email/Model/BackendTemplate.php index a1252d2520a92..9d4235c0700cb 100644 --- a/app/code/Magento/Email/Model/BackendTemplate.php +++ b/app/code/Magento/Email/Model/BackendTemplate.php @@ -42,9 +42,9 @@ class BackendTemplate extends Template private $_structure; /** - * @param \Magento\Core\Model\Context $context + * @param \Magento\Model\Context $context * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Filesystem $filesystem @@ -60,9 +60,9 @@ class BackendTemplate extends Template * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, + \Magento\Model\Context $context, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\Filesystem $filesystem, diff --git a/app/code/Magento/Email/Model/Info.php b/app/code/Magento/Email/Model/Info.php deleted file mode 100644 index ce03de10015f8..0000000000000 --- a/app/code/Magento/Email/Model/Info.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ -namespace Magento\Email\Model; - -class Info extends \Magento\Object -{ - /** - * Name list of "Bcc" recipients - * - * @var string[] - */ - protected $_bccNames = array(); - - /** - * Email list of "Bcc" recipients - * - * @var string[] - */ - protected $_bccEmails = array(); - - /** - * Name list of "To" recipients - * - * @var string[] - */ - protected $_toNames = array(); - - /** - * Email list of "To" recipients - * - * @var string[] - */ - protected $_toEmails = array(); - - - /** - * Add new "Bcc" recipient to current email - * - * @param string $email - * @param string|null $name - * @return $this - */ - public function addBcc($email, $name = null) - { - $this->_bccNames[] = $name; - $this->_bccEmails[] = $email; - return $this; - } - - /** - * Add new "To" recipient to current email - * - * @param string $email - * @param string|null $name - * @return $this - */ - public function addTo($email, $name = null) - { - $this->_toNames[] = $name; - $this->_toEmails[] = $email; - return $this; - } - - /** - * Get the name list of "Bcc" recipients - * - * @return string[] - */ - public function getBccNames() - { - return $this->_bccNames; - } - - /** - * Get the email list of "Bcc" recipients - * - * @return string[] - */ - public function getBccEmails() - { - return $this->_bccEmails; - } - - /** - * Get the name list of "To" recipients - * - * @return string[] - */ - public function getToNames() - { - return $this->_toNames; - } - - /** - * Get the email list of "To" recipients - * - * @return string[] - */ - public function getToEmails() - { - return $this->_toEmails; - } -} diff --git a/app/code/Magento/Email/Model/Sender.php b/app/code/Magento/Email/Model/Sender.php deleted file mode 100644 index aeb7681b37fb6..0000000000000 --- a/app/code/Magento/Email/Model/Sender.php +++ /dev/null @@ -1,88 +0,0 @@ - - */ -class Sender -{ - /** - * @var \Magento\Email\Model\Template\Mailer - */ - protected $_mailer; - - /** - * @var \Magento\Email\Model\Info - */ - protected $_emailInfo; - - /** - * @var \Magento\Core\Model\Store - */ - protected $_store; - - /** - * @param \Magento\Email\Model\Template\Mailer $mailer - * @param \Magento\Email\Model\Info $info - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - */ - public function __construct( - \Magento\Email\Model\Template\Mailer $mailer, - \Magento\Email\Model\Info $info, - \Magento\Core\Model\StoreManagerInterface $storeManager - ) { - $this->_mailer = $mailer; - $this->_emailInfo = $info; - $this->_store = $storeManager->getStore(); - } - - /** - * @param string $email - * @param string $name - * @param string $template - * @param string $sender - * @param array $templateParams - * @param int $storeId - * @return $this - */ - public function send($email, $name, $template, $sender, $templateParams, $storeId) - { - $this->_store->load($storeId); - $this->_emailInfo->addTo($email, $name); - $this->_mailer->addEmailInfo($this->_emailInfo); - $this->_mailer->setSender($this->_store->getConfig($sender, $this->_store->getId())); - $this->_mailer->setStoreId($this->_store->getId()); - $this->_mailer->setTemplateId($this->_store->getConfig($template, $this->_store->getId())); - $this->_mailer->setTemplateParams($templateParams); - $this->_mailer->send(); - return $this; - } -} diff --git a/app/code/Magento/Email/Model/Source/Variables.php b/app/code/Magento/Email/Model/Source/Variables.php index 4c07c230f4e03..cf8e873889d7b 100644 --- a/app/code/Magento/Email/Model/Source/Variables.php +++ b/app/code/Magento/Email/Model/Source/Variables.php @@ -32,7 +32,7 @@ * @package Magento_Email * @author Magento Core Team */ -class Variables implements \Magento\Core\Model\Option\ArrayInterface +class Variables implements \Magento\Option\ArrayInterface { /** * Assoc array of configuration variables diff --git a/app/code/Magento/Email/Model/Template.php b/app/code/Magento/Email/Model/Template.php index 335f8b39a856b..864dc2ca7d7c8 100644 --- a/app/code/Magento/Email/Model/Template.php +++ b/app/code/Magento/Email/Model/Template.php @@ -71,7 +71,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Template extends \Magento\Core\Model\Template +class Template extends \Magento\Core\Model\Template implements \Magento\Mail\TemplateInterface { /** * Configuration path for default email templates @@ -121,6 +121,11 @@ class Template extends \Magento\Core\Model\Template */ protected $_replyTo = ''; + /** + * @var array + */ + protected $_vars = array(); + /** * @var \Exception|null */ @@ -163,15 +168,9 @@ class Template extends \Magento\Core\Model\Template protected $_emailFilterFactory; /** - * Types of template - */ - const TYPE_TEXT = 1; - const TYPE_HTML = 2; - - /** - * @param \Magento\Core\Model\Context $context + * @param \Magento\Model\Context $context * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Filesystem $filesystem @@ -179,16 +178,16 @@ class Template extends \Magento\Core\Model\Template * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\App\ConfigInterface $coreConfig - * @param \Magento\Email\Model\Template\FilterFactory $emailFilterFactory - * @param \Magento\Email\Model\Template\Config $emailConfig + * @param Template\FilterFactory $emailFilterFactory + * @param Template\Config $emailConfig * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, + \Magento\Model\Context $context, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\Filesystem $filesystem, @@ -270,16 +269,6 @@ protected function _getLogoAlt($store) return $store->getFrontendName(); } - /** - * Retrieve mail object instance - * - * @return \Zend_Mail - */ - protected function _getMail() - { - return new \Zend_Mail('utf-8'); - } - /** * Declare template processing filter * @@ -402,7 +391,12 @@ public function isValidForSend() */ public function getType() { - return $this->getTemplateType(); + $templateType = $this->getTemplateType(); + if (is_null($templateType) && $this->getId()) { + $templateType = $this->_emailConfig->getTemplateType($this->getId()); + $templateType = $templateType == 'html' ? self::TYPE_HTML : self::TYPE_TEXT; + } + return $templateType; } /** @@ -410,7 +404,7 @@ public function getType() * * @param array $variables * @return string - * @throws \Exception + * @throws \Magento\Mail\Exception */ public function getProcessedTemplate(array $variables = array()) { @@ -443,9 +437,8 @@ public function getProcessedTemplate(array $variables = array()) ->filter($this->getPreparedTemplateText()); } catch (\Exception $e) { $this->_cancelDesignConfig(); - throw $e; + throw new \Magento\Mail\Exception($e->getMessage(), $e->getCode(), $e); } - $this->_cancelDesignConfig(); return $processedResult; } @@ -481,101 +474,6 @@ public function getInclude($template, array $variables) return $includeTemplate->getProcessedTemplate($variables); } - /** - * Send mail to recipient - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - * @param array|string $email E-mail(s) - * @param array|string|null $name receiver name(s) - * @param array $variables template variables - * @return bool - */ - public function send($email, $name = null, array $variables = array()) - { - if (!$this->isValidForSend()) { - $this->_logger->logException( - new \Exception('This letter cannot be sent.') // translation is intentionally omitted - ); - return false; - } - - $emails = array_values((array)$email); - $names = is_array($name) ? $name : (array)$name; - $names = array_values($names); - foreach ($emails as $key => $email) { - if (!isset($names[$key])) { - $names[$key] = substr($email, 0, strpos($email, '@')); - } - } - - $variables['email'] = reset($emails); - $variables['name'] = reset($names); - - ini_set('SMTP', $this->_coreStoreConfig->getConfig('system/smtp/host')); - ini_set('smtp_port', $this->_coreStoreConfig->getConfig('system/smtp/port')); - - $mail = $this->_getMail(); - foreach ($this->_bcc as $bcc) { - $mail->addBcc($bcc); - } - if ($this->_returnPath) { - $mail->setReturnPath($this->_returnPath); - } - if ($this->_replyTo) { - $mail->setReplyTo($this->_replyTo); - } - - $setReturnPath = $this->_coreStoreConfig->getConfig(self::XML_PATH_SENDING_SET_RETURN_PATH); - switch ($setReturnPath) { - case 1: - $returnPathEmail = $this->getSenderEmail(); - break; - case 2: - $returnPathEmail = $this->_coreStoreConfig->getConfig(self::XML_PATH_SENDING_RETURN_PATH_EMAIL); - break; - default: - $returnPathEmail = null; - break; - } - - if ($returnPathEmail !== null) { - $mailTransport = new \Zend_Mail_Transport_Sendmail("-f" . $returnPathEmail); - \Zend_Mail::setDefaultTransport($mailTransport); - } - - foreach ($emails as $key => $email) { - $mail->addTo($email, '=?utf-8?B?' . base64_encode($names[$key]) . '?='); - } - - $this->setUseAbsoluteLinks(true); - $text = $this->getProcessedTemplate($variables, true); - - if ($this->isPlain()) { - $mail->setBodyText($text); - } else { - $mail->setBodyHTML($text); - } - - $mail->setSubject('=?utf-8?B?' . base64_encode($this->getProcessedTemplateSubject($variables)) . '?='); - $mail->setFrom($this->getSenderEmail(), $this->getSenderName()); - - $result = false; - $this->_sendingException = null; - try { - $mail->send(); - $result = true; - } catch (\Exception $e) { - $this->_logger->logException($e); - $this->_sendingException = $e; - } - $this->_bcc = array(); - $this->_returnPath = ''; - $this->_replyTo = ''; - - return $result; - } - /** * Get exception, generated during send() method * @@ -586,60 +484,12 @@ public function getSendingException() return $this->_sendingException; } - /** - * Send transactional email to recipient - * - * @param int|string $templateId - * @param string|array $sender sender information, can be declared as part of config path - * @param string $email recipient email - * @param string $name recipient name - * @param array $vars variables which can be used in template - * @param int|null $storeId - * @return $this - * @throws Exception - */ - public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null) - { - $this->setSentSuccess(false); - if (($storeId === null) && $this->getDesignConfig()->getStore()) { - $storeId = $this->getDesignConfig()->getStore(); - } - - if (is_numeric($templateId)) { - $this->load($templateId); - } else { - $this->loadDefault($templateId); - } - - if (!$this->getId()) { - throw new Exception(__('Invalid transactional email code: %1', $templateId)); - } - - if (!is_array($sender)) { - $this->setSenderName( - $this->_coreStoreConfig->getConfig('trans_email/ident_' . $sender . '/name', $storeId) - ); - $this->setSenderEmail( - $this->_coreStoreConfig->getConfig('trans_email/ident_' . $sender . '/email', $storeId) - ); - } else { - $this->setSenderName($sender['name']); - $this->setSenderEmail($sender['email']); - } - - if (!isset($vars['store'])) { - $vars['store'] = $this->_storeManager->getStore($storeId); - } - $this->setSentSuccess($this->send($email, $name, $vars)); - return $this; - } - /** * Process email subject * * @param array $variables * @return string - * @throws \Exception + * @throws \Magento\Mail\Exception */ public function getProcessedTemplateSubject(array $variables) { @@ -658,7 +508,7 @@ public function getProcessedTemplateSubject(array $variables) ->filter($this->getTemplateSubject()); } catch (\Exception $e) { $this->_cancelDesignConfig(); - throw $e; + throw new \Magento\Mail\Exception($e->getMessage(), $e->getCode(), $e); } $this->_cancelDesignConfig(); return $processedResult; @@ -746,18 +596,85 @@ public function getVariablesOptionArray($withGroup = false) /** * Validate email template code * - * @throws Exception + * @throws \Magento\Mail\Exception * @return $this */ protected function _beforeSave() { $code = $this->getTemplateCode(); if (empty($code)) { - throw new Exception(__('The template Name must not be empty.')); + throw new \Magento\Mail\Exception(__('The template Name must not be empty.')); } if ($this->_getResource()->checkCodeUsage($this)) { - throw new Exception(__('Duplicate Of Template Name')); + throw new \Magento\Mail\Exception(__('Duplicate Of Template Name')); } return parent::_beforeSave(); } + + /** + * Get processed template + * + * @return string + * @throws \Magento\Mail\Exception + */ + public function processTemplate() + { + $templateId = $this->getId(); + if (is_numeric($templateId)) { + $this->load($templateId); + } else { + $this->loadDefault($templateId); + } + + if (!$this->getId()) { + throw new \Magento\Mail\Exception(__('Invalid transactional email code: %1', $templateId)); + } + + $this->setUseAbsoluteLinks(true); + $text = $this->getProcessedTemplate($this->_getVars(), true); + return $text; + } + + /** + * Get processed subject + * + * @return string + */ + public function getSubject() + { + return $this->getProcessedTemplateSubject($this->_getVars()); + } + + /** + * Set template variables + * + * @param array $vars + * @return $this + */ + public function setVars(array $vars) + { + $this->_vars = $vars; + return $this; + } + + /** + * Set template options + * + * @param array $options + * @return $this + */ + public function setOptions(array $options) + { + return $this->setDesignConfig($options); + } + + /** + * Retrieve template variables + * + * @return array + */ + protected function _getVars() + { + return $this->_vars; + } } diff --git a/app/code/Magento/Email/Model/Template/Mailer.php b/app/code/Magento/Email/Model/Template/Mailer.php deleted file mode 100644 index 3725becbef482..0000000000000 --- a/app/code/Magento/Email/Model/Template/Mailer.php +++ /dev/null @@ -1,195 +0,0 @@ - - */ -class Mailer extends \Magento\Object -{ - /** - * List of email infos - * - * @var array - * @see Info - */ - protected $_emailInfos = array(); - - /** - * Email template factory - * - * @var \Magento\Email\Model\TemplateFactory - */ - protected $_coreEmailTemplateFactory; - - /** - * @param \Magento\Email\Model\TemplateFactory $coreEmailTemplateFactory - * @param array $data - */ - public function __construct( - \Magento\Email\Model\TemplateFactory $coreEmailTemplateFactory, - array $data = array() - ) { - parent::__construct($data); - $this->_coreEmailTemplateFactory = $coreEmailTemplateFactory; - } - - /** - * Add new email info to corresponding list - * - * @param Info $emailInfo - * @return $this - */ - public function addEmailInfo(Info $emailInfo) - { - $this->_emailInfos[] = $emailInfo; - return $this; - } - - /** - * Send all emails from email list - * @see self::$_emailInfos - * - * @return $this - */ - public function send() - { - /** @var $emailTemplate \Magento\Email\Model\Template */ - $emailTemplate = $this->_coreEmailTemplateFactory->create(); - // Send all emails from corresponding list - while (!empty($this->_emailInfos)) { - $emailInfo = array_pop($this->_emailInfos); - // Handle "Bcc" recipients of the current email - $emailTemplate->addBcc($emailInfo->getBccEmails()); - // Set required design parameters and delegate email sending to \Magento\Email\Model\Template - $designConfig = array( - 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'store' => $this->getStoreId() - ); - $emailTemplate->setDesignConfig($designConfig); - - $emailTemplate->sendTransactional( - $this->getTemplateId(), - $this->getSender(), - $emailInfo->getToEmails(), - $emailInfo->getToNames(), - $this->getTemplateParams(), - $this->getStoreId() - ); - } - return $this; - } - - /** - * Set email sender - * - * @param string|array $sender - * @return $this - */ - public function setSender($sender) - { - return $this->setData('sender', $sender); - } - - /** - * Get email sender - * - * @return string|array|null - */ - public function getSender() - { - return $this->_getData('sender'); - } - - /** - * Set store id - * - * @param int $storeId - * @return $this - */ - public function setStoreId($storeId) - { - return $this->setData('store_id', $storeId); - } - - /** - * Get store id - * - * @return int|null - */ - public function getStoreId() - { - return $this->_getData('store_id'); - } - - /** - * Set template id - * - * @param int $templateId - * @return $this - */ - public function setTemplateId($templateId) - { - return $this->setData('template_id', $templateId); - } - - /** - * Get template id - * - * @return int|null - */ - public function getTemplateId() - { - return $this->_getData('template_id'); - } - - /** - * Set template parameters - * - * @param array $templateParams - * @return $this - */ - public function setTemplateParams(array $templateParams) - { - return $this->setData('template_params', $templateParams); - } - - /** - * Get template parameters - * - * @return array|null - */ - public function getTemplateParams() - { - return $this->_getData('template_params'); - } -} diff --git a/app/code/Magento/Email/Model/Template/SenderResolver.php b/app/code/Magento/Email/Model/Template/SenderResolver.php new file mode 100644 index 0000000000000..0c05aa045d3be --- /dev/null +++ b/app/code/Magento/Email/Model/Template/SenderResolver.php @@ -0,0 +1,67 @@ +_storeConfig = $coreStoreConfig; + } + + /** + * {@inheritdoc} + */ + public function resolve($sender, $scopeId = null) + { + $result = array(); + + if (!is_array($sender)) { + $result['name'] = $this->_storeConfig->getConfig('trans_email/ident_' . $sender . '/name', $scopeId); + $result['email'] = $this->_storeConfig->getConfig('trans_email/ident_' . $sender . '/email', $scopeId); + } else { + $result = $sender; + } + + if (!isset($result['name']) || !isset($result['email'])) { + throw new \Magento\Mail\Exception(__('Invalid sender data')); + } + + return $result; + } +} diff --git a/app/code/Magento/Email/etc/di.xml b/app/code/Magento/Email/etc/di.xml index 04b5c5f62383a..0152107669b25 100644 --- a/app/code/Magento/Email/etc/di.xml +++ b/app/code/Magento/Email/etc/di.xml @@ -24,7 +24,9 @@ */ --> + + + + + - - - \ No newline at end of file diff --git a/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php b/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php index 8ebed8e02cfe9..cd16e6680972a 100644 --- a/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php +++ b/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php @@ -38,18 +38,18 @@ class Form extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/GiftMessage/Model/Message.php b/app/code/Magento/GiftMessage/Model/Message.php index ff24e5a9ded01..396c46440ed15 100644 --- a/app/code/Magento/GiftMessage/Model/Message.php +++ b/app/code/Magento/GiftMessage/Model/Message.php @@ -53,16 +53,16 @@ class Message extends \Magento\Core\Model\AbstractModel protected $_typeFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\GiftMessage\Model\Resource\Message $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param \Magento\GiftMessage\Model\TypeFactory $typeFactory * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\GiftMessage\Model\Resource\Message $resource, \Magento\Data\Collection\Db $resourceCollection, \Magento\GiftMessage\Model\TypeFactory $typeFactory, diff --git a/app/code/Magento/GoogleAdwords/Helper/Data.php b/app/code/Magento/GoogleAdwords/Helper/Data.php index 630af87551269..4f9060df29050 100644 --- a/app/code/Magento/GoogleAdwords/Helper/Data.php +++ b/app/code/Magento/GoogleAdwords/Helper/Data.php @@ -82,7 +82,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeConfig; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -90,13 +90,13 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\App\Helper\Context $context * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry */ public function __construct( \Magento\App\Helper\Context $context, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Store\ConfigInterface $storeConfig, - \Magento\Core\Model\Registry $registry + \Magento\Registry $registry ) { parent::__construct($context); $this->_config = $config; diff --git a/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php b/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php index 8ab09a8cca552..b49e659952780 100644 --- a/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php +++ b/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php @@ -41,8 +41,8 @@ abstract class AbstractConversion extends \Magento\Core\Model\Config\Value protected $_validatorFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Validator\ObjectFactory $validatorCompositeFactory @@ -52,8 +52,8 @@ abstract class AbstractConversion extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Validator\ObjectFactory $validatorCompositeFactory, diff --git a/app/code/Magento/GoogleAdwords/Model/Config/Source/Language.php b/app/code/Magento/GoogleAdwords/Model/Config/Source/Language.php index 3b7ecdf143d25..486ec5e0f1dc1 100644 --- a/app/code/Magento/GoogleAdwords/Model/Config/Source/Language.php +++ b/app/code/Magento/GoogleAdwords/Model/Config/Source/Language.php @@ -28,7 +28,7 @@ /** * @SuppressWarnings(PHPMD.LongVariable) */ -class Language implements \Magento\Core\Model\Option\ArrayInterface +class Language implements \Magento\Option\ArrayInterface { /** * @var \Zend_Locale diff --git a/app/code/Magento/GoogleAdwords/Model/Config/Source/ValueType.php b/app/code/Magento/GoogleAdwords/Model/Config/Source/ValueType.php index f932af03235fa..0ccdf743671bb 100644 --- a/app/code/Magento/GoogleAdwords/Model/Config/Source/ValueType.php +++ b/app/code/Magento/GoogleAdwords/Model/Config/Source/ValueType.php @@ -25,7 +25,7 @@ */ namespace Magento\GoogleAdwords\Model\Config\Source; -class ValueType implements \Magento\Core\Model\Option\ArrayInterface +class ValueType implements \Magento\Option\ArrayInterface { /** * Get conversation value type option diff --git a/app/code/Magento/GoogleAdwords/Model/Observer.php b/app/code/Magento/GoogleAdwords/Model/Observer.php index 4e82eb584f9e2..b762db0ed3bd6 100644 --- a/app/code/Magento/GoogleAdwords/Model/Observer.php +++ b/app/code/Magento/GoogleAdwords/Model/Observer.php @@ -41,12 +41,12 @@ class Observer * Constructor * * @param \Magento\GoogleAdwords\Helper\Data $helper - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Resource\Order\Collection $collection */ public function __construct( \Magento\GoogleAdwords\Helper\Data $helper, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Model\Resource\Order\Collection $collection ) { $this->_helper = $helper; diff --git a/app/code/Magento/GoogleCheckout/Model/Api.php b/app/code/Magento/GoogleCheckout/Model/Api.php index 0bc99cb88f19c..bd552f70b25ab 100644 --- a/app/code/Magento/GoogleCheckout/Model/Api.php +++ b/app/code/Magento/GoogleCheckout/Model/Api.php @@ -256,7 +256,7 @@ public function debugData($debugData) { if ($this->getDebugFlag()) { $this->objectManager->create( - 'Magento\Core\Model\Log\Adapter', + 'Magento\Logger\Adapter', array('fileName' => 'payment_googlecheckout.log') )->setFilterDataKeys($this->_debugReplacePrivateDataKeys)->log($debugData); } diff --git a/app/code/Magento/GoogleCheckout/Model/Payment.php b/app/code/Magento/GoogleCheckout/Model/Payment.php index 6ebdafea5c902..d7c5dfd8bef63 100644 --- a/app/code/Magento/GoogleCheckout/Model/Payment.php +++ b/app/code/Magento/GoogleCheckout/Model/Payment.php @@ -66,7 +66,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Core\Model\DateFactory $dateFactory, \Magento\UrlFactory $urlFactory, \Magento\GoogleCheckout\Model\ApiFactory $apiFactory, diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Checkout/Image.php b/app/code/Magento/GoogleCheckout/Model/Source/Checkout/Image.php index feb6d7ead9019..c8a64c1fd13c2 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Checkout/Image.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Checkout/Image.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source\Checkout; -class Image implements \Magento\Core\Model\Option\ArrayInterface +class Image implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Locale.php b/app/code/Magento/GoogleCheckout/Model/Source/Locale.php index 73abb3374ebb1..f51d3ec4d1a27 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Locale.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Locale.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source; -class Locale implements \Magento\Core\Model\Option\ArrayInterface +class Locale implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Carrier.php b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Carrier.php index 7d1f4428f65b9..b8d21e4ef6d16 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Carrier.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Carrier.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source\Shipping; -class Carrier implements \Magento\Core\Model\Option\ArrayInterface +class Carrier implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Category.php b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Category.php index b08c138721ed0..35575ad7489e1 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Category.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Category.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source\Shipping; -class Category implements \Magento\Core\Model\Option\ArrayInterface +class Category implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Units.php b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Units.php index ff4dff7b7b8f1..eb77f171f75fa 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Units.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Units.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source\Shipping; -class Units implements \Magento\Core\Model\Option\ArrayInterface +class Units implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php index 5f2f38a8d74d9..09e64f900d18a 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source\Shipping\Virtual; -class Method implements \Magento\Core\Model\Option\ArrayInterface +class Method implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php index 8241d6a243272..2f5a89397af39 100644 --- a/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php +++ b/app/code/Magento/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php @@ -27,7 +27,7 @@ namespace Magento\GoogleCheckout\Model\Source\Shipping\Virtual; -class Schedule implements \Magento\Core\Model\Option\ArrayInterface +class Schedule implements \Magento\Option\ArrayInterface { public function toOptionArray() { diff --git a/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php b/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php index bbd4b6945cc5f..7065fef6526ba 100644 --- a/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php +++ b/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php @@ -33,7 +33,7 @@ abstract class AbstractCode extends \Magento\View\Element\Template protected $_registryName; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -50,14 +50,14 @@ abstract class AbstractCode extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\GoogleOptimizer\Helper\Data $helper - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\GoogleOptimizer\Helper\Data $helper, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\GoogleOptimizer\Helper\Code $codeHelper, array $data = array() ) { diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php index b6069c8ec6d19..4a26443b4bd4d 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php @@ -34,7 +34,7 @@ abstract class AbstractTab protected $_helperData; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -51,7 +51,7 @@ abstract class AbstractTab /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\GoogleOptimizer\Helper\Data $helperData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper * @param \Magento\GoogleOptimizer\Helper\Form $formHelper * @param \Magento\Data\FormFactory $formFactory @@ -60,7 +60,7 @@ abstract class AbstractTab public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\GoogleOptimizer\Helper\Data $helperData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\GoogleOptimizer\Helper\Code $codeHelper, \Magento\GoogleOptimizer\Helper\Form $formHelper, \Magento\Data\FormFactory $formFactory, diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php index f7381f6a0571b..2ab61a2520faf 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php @@ -29,7 +29,7 @@ class Googleoptimizer extends \Magento\Catalog\Block\Adminhtml\Form { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -45,7 +45,7 @@ class Googleoptimizer /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper * @param \Magento\GoogleOptimizer\Helper\Form $formHelper @@ -53,7 +53,7 @@ class Googleoptimizer */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\GoogleOptimizer\Helper\Code $codeHelper, \Magento\GoogleOptimizer\Helper\Form $formHelper, diff --git a/app/code/Magento/GoogleOptimizer/Block/Code/Page.php b/app/code/Magento/GoogleOptimizer/Block/Code/Page.php index 52d4ae14912e3..85861557f213b 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Code/Page.php +++ b/app/code/Magento/GoogleOptimizer/Block/Code/Page.php @@ -35,7 +35,7 @@ class Page extends \Magento\GoogleOptimizer\Block\AbstractCode /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\GoogleOptimizer\Helper\Data $helper - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper * @param \Magento\Cms\Model\Page $page * @param array $data @@ -43,7 +43,7 @@ class Page extends \Magento\GoogleOptimizer\Block\AbstractCode public function __construct( \Magento\View\Element\Template\Context $context, \Magento\GoogleOptimizer\Helper\Data $helper, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\GoogleOptimizer\Helper\Code $codeHelper, \Magento\Cms\Model\Page $page, array $data = array() diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php index 6cb7e0e3b5339..59593bf18f318 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php @@ -33,18 +33,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php index 213a6bf347d17..dbeb6a710bb92 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php @@ -48,7 +48,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -82,7 +82,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\GoogleShopping\Model\Resource\Type\CollectionFactory $typeCollectionFactory * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory @@ -94,7 +94,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\GoogleShopping\Model\Resource\Type\CollectionFactory $typeCollectionFactory, \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory, diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php index 59151f7476143..9e994564c7c3f 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php @@ -35,17 +35,17 @@ class Types extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/GoogleShopping/Model/Attribute.php b/app/code/Magento/GoogleShopping/Model/Attribute.php index ee98f4a13c844..a801c3be2c385 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute.php @@ -91,8 +91,8 @@ class Attribute extends \Magento\Core\Model\AbstractModel protected $_productFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -102,8 +102,8 @@ class Attribute extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php b/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php index 01a96861e447a..eda5dfb2b06a4 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php @@ -42,8 +42,8 @@ class ContentLanguage extends \Magento\GoogleShopping\Model\Attribute\DefaultAtt protected $_config; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -54,8 +54,8 @@ class ContentLanguage extends \Magento\GoogleShopping\Model\Attribute\DefaultAtt * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php b/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php index fb3a8378f17b9..ecf0a91c02fa0 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php @@ -42,8 +42,8 @@ class Destinations extends \Magento\GoogleShopping\Model\Attribute\DefaultAttrib protected $_config; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -54,8 +54,8 @@ class Destinations extends \Magento\GoogleShopping\Model\Attribute\DefaultAttrib * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php b/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php index 6258d88110c99..e04937a8f65cd 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php @@ -49,8 +49,8 @@ class GoogleProductCategory extends \Magento\GoogleShopping\Model\Attribute\Defa protected $_typeFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -62,8 +62,8 @@ class GoogleProductCategory extends \Magento\GoogleShopping\Model\Attribute\Defa * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php b/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php index f05d2814fc7c2..afd8ec7807185 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php @@ -40,8 +40,8 @@ class ImageLink extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_catalogProduct = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -52,8 +52,8 @@ class ImageLink extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Link.php b/app/code/Magento/GoogleShopping/Model/Attribute/Link.php index a5cdea272839d..6e4d63b9ec407 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Link.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Link.php @@ -42,8 +42,8 @@ class Link extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_coreStoreConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -54,8 +54,8 @@ class Link extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php index 8bced43baca90..88fb052adb07f 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php @@ -69,8 +69,8 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $catalogPrice; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -84,8 +84,8 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php b/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php index 0d28c42396b7b..7529ba3bd915a 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php @@ -42,8 +42,8 @@ class ProductType extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribu protected $_categoryFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -54,8 +54,8 @@ class ProductType extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribu * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php b/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php index ecffcee6fcd48..4c1adcc0fd1b3 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php @@ -42,8 +42,8 @@ class TargetCountry extends \Magento\GoogleShopping\Model\Attribute\DefaultAttri protected $_config; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -54,8 +54,8 @@ class TargetCountry extends \Magento\GoogleShopping\Model\Attribute\DefaultAttri * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php b/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php index ea9b5986e5e72..ba7614a13ead0 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php @@ -57,8 +57,8 @@ class Tax extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_config; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct @@ -71,8 +71,8 @@ class Tax extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, diff --git a/app/code/Magento/GoogleShopping/Model/Item.php b/app/code/Magento/GoogleShopping/Model/Item.php index 151a4b994341f..46c8383856daf 100644 --- a/app/code/Magento/GoogleShopping/Model/Item.php +++ b/app/code/Magento/GoogleShopping/Model/Item.php @@ -79,8 +79,8 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_productFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\GoogleShopping\Model\Service\ItemFactory $itemFactory * @param \Magento\GoogleShopping\Model\TypeFactory $typeFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -90,8 +90,8 @@ class Item extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\GoogleShopping\Model\Service\ItemFactory $itemFactory, \Magento\GoogleShopping\Model\TypeFactory $typeFactory, \Magento\Catalog\Model\ProductFactory $productFactory, diff --git a/app/code/Magento/GoogleShopping/Model/Service.php b/app/code/Magento/GoogleShopping/Model/Service.php index af05e102dce16..9e7150e348492 100644 --- a/app/code/Magento/GoogleShopping/Model/Service.php +++ b/app/code/Magento/GoogleShopping/Model/Service.php @@ -44,7 +44,7 @@ class Service extends \Magento\Object /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -58,7 +58,7 @@ class Service extends \Magento\Object /** * Log adapter factory * - * @var \Magento\Core\Model\Log\AdapterFactory + * @var \Magento\Logger\AdapterFactory */ protected $_logAdapterFactory; @@ -80,15 +80,15 @@ class Service extends \Magento\Object * By default is looking for first argument as array and assigns it as object * attributes This behavior may change in child classes * - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Registry $coreRegistry * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Gdata\Gshopping\ContentFactory $contentFactory * @param array $data */ public function __construct( - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Logger\AdapterFactory $logAdapterFactory, + \Magento\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, \Magento\Gdata\Gshopping\ContentFactory $contentFactory, array $data = array() diff --git a/app/code/Magento/GoogleShopping/Model/Service/Item.php b/app/code/Magento/GoogleShopping/Model/Service/Item.php index 97fb4588e4671..3baca8e8ca6a8 100644 --- a/app/code/Magento/GoogleShopping/Model/Service/Item.php +++ b/app/code/Magento/GoogleShopping/Model/Service/Item.php @@ -47,8 +47,8 @@ class Item extends \Magento\GoogleShopping\Model\Service protected $_date; /** - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Registry $coreRegistry * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Gdata\Gshopping\ContentFactory $contentFactory * @param \Magento\Core\Model\Date $date @@ -56,8 +56,8 @@ class Item extends \Magento\GoogleShopping\Model\Service * @param array $data */ public function __construct( - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Logger\AdapterFactory $logAdapterFactory, + \Magento\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, \Magento\Gdata\Gshopping\ContentFactory $contentFactory, \Magento\Core\Model\Date $date, diff --git a/app/code/Magento/GoogleShopping/Model/Source/Accounttype.php b/app/code/Magento/GoogleShopping/Model/Source/Accounttype.php index d11cd66113365..265f9bc06b66d 100644 --- a/app/code/Magento/GoogleShopping/Model/Source/Accounttype.php +++ b/app/code/Magento/GoogleShopping/Model/Source/Accounttype.php @@ -32,7 +32,7 @@ * @package Magento_GoogleShopping * @author Magento Core Team */ -class Accounttype implements \Magento\Core\Model\Option\ArrayInterface +class Accounttype implements \Magento\Option\ArrayInterface { /** * Retrieve option array with account types diff --git a/app/code/Magento/GoogleShopping/Model/Source/Authtype.php b/app/code/Magento/GoogleShopping/Model/Source/Authtype.php index 3878f89c57f88..24231fd8aeae6 100644 --- a/app/code/Magento/GoogleShopping/Model/Source/Authtype.php +++ b/app/code/Magento/GoogleShopping/Model/Source/Authtype.php @@ -32,7 +32,7 @@ * @package Magento_GoogleShopping * @author Magento Core Team */ -class Authtype implements \Magento\Core\Model\Option\ArrayInterface +class Authtype implements \Magento\Option\ArrayInterface { /** * Retrieve option array with authentification types diff --git a/app/code/Magento/GoogleShopping/Model/Source/Country.php b/app/code/Magento/GoogleShopping/Model/Source/Country.php index 6a7f0677af413..31f0125f5ad2d 100644 --- a/app/code/Magento/GoogleShopping/Model/Source/Country.php +++ b/app/code/Magento/GoogleShopping/Model/Source/Country.php @@ -32,7 +32,7 @@ * @package Magento_GoogleShopping * @author Magento Core Team */ -class Country implements \Magento\Core\Model\Option\ArrayInterface +class Country implements \Magento\Option\ArrayInterface { /** * Config diff --git a/app/code/Magento/GoogleShopping/Model/Source/Destinationstates.php b/app/code/Magento/GoogleShopping/Model/Source/Destinationstates.php index 855425ececa87..9f1177628fc81 100644 --- a/app/code/Magento/GoogleShopping/Model/Source/Destinationstates.php +++ b/app/code/Magento/GoogleShopping/Model/Source/Destinationstates.php @@ -32,7 +32,7 @@ * @package Magento_GoogleShopping * @author Magento Core Team */ -class Destinationstates implements \Magento\Core\Model\Option\ArrayInterface +class Destinationstates implements \Magento\Option\ArrayInterface { /** * Retrieve option array with destinations diff --git a/app/code/Magento/GoogleShopping/Model/Type.php b/app/code/Magento/GoogleShopping/Model/Type.php index 8bf42813b7183..b39c2b1c506cc 100644 --- a/app/code/Magento/GoogleShopping/Model/Type.php +++ b/app/code/Magento/GoogleShopping/Model/Type.php @@ -76,8 +76,8 @@ class Type extends \Magento\Core\Model\AbstractModel protected $_collectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute\CollectionFactory $collectionFactory * @param \Magento\GoogleShopping\Model\AttributeFactory $attributeFactory * @param \Magento\GoogleShopping\Model\Config $config @@ -88,8 +88,8 @@ class Type extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute\CollectionFactory $collectionFactory, \Magento\GoogleShopping\Model\AttributeFactory $attributeFactory, \Magento\GoogleShopping\Model\Config $config, diff --git a/app/code/Magento/GoogleShopping/i18n/en_US.csv b/app/code/Magento/GoogleShopping/i18n/en_US.csv index 8f49cd4dc99a2..1a543673558ee 100644 --- a/app/code/Magento/GoogleShopping/i18n/en_US.csv +++ b/app/code/Magento/GoogleShopping/i18n/en_US.csv @@ -81,7 +81,7 @@ "Manage Attribute Mapping","Manage Attribute Mapping" "Manage Attributes","Manage Attributes" "Manage Items","Manage Items" -"Manufacturer\'s Part Number (MPN)","Manufacturer\'s Part Number (MPN)" +"Manufacturer's Part Number (MPN)","Manufacturer's Part Number (MPN)" "Material","Material" "Netherlands","Netherlands" "New Attribute Mapping","New Attribute Mapping" @@ -107,7 +107,7 @@ "Sale Price Effective From Date","Sale Price Effective From Date" "Sale Price Effective To Date","Sale Price Effective To Date" "Save Mapping","Save Mapping" -"See '\\1'","See '\\1'" +"See '\1'","See '\1'" "Session expired during export. Please revise exported products and repeat the process if necessary.","Session expired during export. Please revise exported products and repeat the process if necessary." "Shipping Weight","Shipping Weight" "Size","Size" @@ -117,11 +117,11 @@ "Synchronize","Synchronize" "Target Country","Target Country" "The Google Content item for product '%s' (in '%s' store) has already exist.","The Google Content item for product '%s' (in '%s' store) has already exist." -"The attribute ""%s"" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.","The attribute ""%s"" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content." +"The attribute ""%s"" has incorrect type for Google Shopping. The product with this attribute hasn't been updated in Google Content.","The attribute ""%s"" has incorrect type for Google Shopping. The product with this attribute hasn't been updated in Google Content." "The attribute mapping has been saved.","The attribute mapping has been saved." -"The item ""%s"" hasn\'t been deleted.","The item ""%s"" hasn\'t been deleted." -"The item ""%s"" hasn\'t been updated.","The item ""%s"" hasn\'t been updated." -"The product ""%s"" hasn\'t been added to Google Content.","The product ""%s"" hasn\'t been added to Google Content." +"The item ""%s"" hasn't been deleted.","The item ""%s"" hasn't been deleted." +"The item ""%s"" hasn't been updated.","The item ""%s"" hasn't been updated." +"The product ""%s"" hasn't been added to Google Content.","The product ""%s"" hasn't been added to Google Content." "The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.","The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content." "This action will update items attributes and remove the items which are not available in Google Content. If an attributes was deleted from mapping, it will be deleted from Google too. Continue?","This action will update items attributes and remove the items which are not available in Google Content. If an attributes was deleted from mapping, it will be deleted from Google too. Continue?" "Title","Title" diff --git a/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php b/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php index 267ebe3689759..797444a9f412e 100644 --- a/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php +++ b/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php @@ -51,7 +51,7 @@ class Grouped /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -65,13 +65,13 @@ class Grouped * @param \Magento\Core\Helper\Data $coreHelper * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php b/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php index 312717b86927e..468e44972d08b 100644 --- a/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php +++ b/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php @@ -38,18 +38,18 @@ class ListAssociatedProducts extends \Magento\Backend\Block\Template /** * Registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { parent::__construct($context, $data); diff --git a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit.php b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit.php index 57a627c6b5356..6a1d13762bcca 100644 --- a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit.php +++ b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit.php @@ -27,7 +27,7 @@ class Edit extends \Magento\Backend\App\AbstractAction { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $registry; @@ -43,13 +43,13 @@ class Edit extends \Magento\Backend\App\AbstractAction /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $factory * @param \Magento\Logger $logger */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $factory, \Magento\Logger $logger ) { @@ -104,4 +104,4 @@ public function popupAction() $this->_view->loadLayout(false); $this->_view->renderLayout(); } -} +} diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index 2bac661398016..82760deef5b44 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -104,7 +104,7 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\GroupedProduct\Model\Resource\Product\Link $catalogProductLink * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -123,7 +123,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\GroupedProduct\Model\Resource\Product\Link $catalogProductLink, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php b/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php index e9a0ceaa3497b..bae0ea2b2d941 100644 --- a/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php +++ b/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php @@ -37,7 +37,7 @@ class AssociatedProductsCollection /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -60,17 +60,17 @@ class AssociatedProductsCollection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config * @param mixed $connection - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -85,14 +85,14 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, \Magento\Stdlib\DateTime $dateTime, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config, $connection = null ) { @@ -110,7 +110,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php index 1a55dfc24047d..f3664442717bc 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php @@ -47,7 +47,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\ImportExport\Model\Source\Export\EntityFactory $entityFactory * @param \Magento\ImportExport\Model\Source\Export\FormatFactory $formatFactory @@ -55,7 +55,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\ImportExport\Model\Source\Export\EntityFactory $entityFactory, \Magento\ImportExport\Model\Source\Export\FormatFactory $formatFactory, diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php b/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php index 8a95585134f5a..0913db1759bae 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php @@ -32,18 +32,18 @@ class After extends \Magento\Backend\Block\Template { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_registry = $registry; diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index d28fdd287625d..1da9a152dc2a1 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -53,7 +53,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\ImportExport\Model\Import $importModel * @param \Magento\ImportExport\Model\Source\Import\EntityFactory $entityFactory @@ -62,7 +62,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\ImportExport\Model\Import $importModel, \Magento\ImportExport\Model\Source\Import\EntityFactory $entityFactory, diff --git a/app/code/Magento/ImportExport/Model/AbstractModel.php b/app/code/Magento/ImportExport/Model/AbstractModel.php index 280c9619e4913..e0282c73c30c9 100644 --- a/app/code/Magento/ImportExport/Model/AbstractModel.php +++ b/app/code/Magento/ImportExport/Model/AbstractModel.php @@ -42,8 +42,8 @@ abstract class AbstractModel extends \Magento\Object protected $_debugMode = false; /** - * Loger instance - * @var \Magento\Core\Model\Log\Adapter + * Logger instance + * @var \Magento\Logger\Adapter */ protected $_logInstance; @@ -72,20 +72,20 @@ abstract class AbstractModel extends \Magento\Object protected $_varDirectory; /** - * @var \Magento\Core\Model\Log\AdapterFactory + * @var \Magento\Logger\AdapterFactory */ protected $_adapterFactory; /** * @param \Magento\Logger $logger * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Log\AdapterFactory $adapterFactory + * @param \Magento\Logger\AdapterFactory $adapterFactory * @param array $data */ public function __construct( \Magento\Logger $logger, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Log\AdapterFactory $adapterFactory, + \Magento\Logger\AdapterFactory $adapterFactory, array $data = array() ) { $this->_logger = $logger; diff --git a/app/code/Magento/ImportExport/Model/Export.php b/app/code/Magento/ImportExport/Model/Export.php index 8fa57ee1febed..09bd82c455160 100644 --- a/app/code/Magento/ImportExport/Model/Export.php +++ b/app/code/Magento/ImportExport/Model/Export.php @@ -77,7 +77,7 @@ class Export extends \Magento\ImportExport\Model\AbstractModel /** * @param \Magento\Logger $logger * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Log\AdapterFactory $adapterFactory + * @param \Magento\Logger\AdapterFactory $adapterFactory * @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig * @param \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory * @param \Magento\ImportExport\Model\Export\Adapter\Factory $exportAdapterFac @@ -86,7 +86,7 @@ class Export extends \Magento\ImportExport\Model\AbstractModel public function __construct( \Magento\Logger $logger, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Log\AdapterFactory $adapterFactory, + \Magento\Logger\AdapterFactory $adapterFactory, \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig, \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory, \Magento\ImportExport\Model\Export\Adapter\Factory $exportAdapterFac, diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 7aa86b28ba5b5..c724fc58e7949 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -138,7 +138,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel /** * @param \Magento\Logger $logger * @param \Magento\App\Filesystem $filesystem - * @param \Magento\Core\Model\Log\AdapterFactory $adapterFactory + * @param \Magento\Logger\AdapterFactory $adapterFactory * @param \Magento\ImportExport\Helper\Data $importExportData * @param \Magento\App\ConfigInterface $coreConfig * @param \Magento\ImportExport\Model\Import\ConfigInterface $importConfig @@ -154,7 +154,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel public function __construct( \Magento\Logger $logger, \Magento\App\Filesystem $filesystem, - \Magento\Core\Model\Log\AdapterFactory $adapterFactory, + \Magento\Logger\AdapterFactory $adapterFactory, \Magento\ImportExport\Helper\Data $importExportData, \Magento\App\ConfigInterface $coreConfig, \Magento\ImportExport\Model\Import\ConfigInterface $importConfig, diff --git a/app/code/Magento/ImportExport/Model/Source/Export/Entity.php b/app/code/Magento/ImportExport/Model/Source/Export/Entity.php index 46b88ad7f9e58..ddc47bae55777 100644 --- a/app/code/Magento/ImportExport/Model/Source/Export/Entity.php +++ b/app/code/Magento/ImportExport/Model/Source/Export/Entity.php @@ -32,7 +32,7 @@ * @package Magento_ImportExport * @author Magento Core Team */ -class Entity implements \Magento\Core\Model\Option\ArrayInterface +class Entity implements \Magento\Option\ArrayInterface { /** * @var \Magento\ImportExport\Model\Export\ConfigInterface diff --git a/app/code/Magento/ImportExport/Model/Source/Export/Format.php b/app/code/Magento/ImportExport/Model/Source/Export/Format.php index a4e4a2575875c..06f4853b230f3 100644 --- a/app/code/Magento/ImportExport/Model/Source/Export/Format.php +++ b/app/code/Magento/ImportExport/Model/Source/Export/Format.php @@ -32,7 +32,7 @@ * @package Magento_ImportExport * @author Magento Core Team */ -class Format implements \Magento\Core\Model\Option\ArrayInterface +class Format implements \Magento\Option\ArrayInterface { /** * @var \Magento\ImportExport\Model\Export\ConfigInterface diff --git a/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php b/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php index 0e10b6b0bf141..b22a7174a8e69 100644 --- a/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php +++ b/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php @@ -32,7 +32,7 @@ * @package Magento_ImportExport * @author Magento Core Team */ -abstract class AbstractBehavior implements \Magento\Core\Model\Option\ArrayInterface +abstract class AbstractBehavior implements \Magento\Option\ArrayInterface { /** * Get array of possible values diff --git a/app/code/Magento/ImportExport/Model/Source/Import/Entity.php b/app/code/Magento/ImportExport/Model/Source/Import/Entity.php index 2a87f47c21610..5167dfb414a46 100644 --- a/app/code/Magento/ImportExport/Model/Source/Import/Entity.php +++ b/app/code/Magento/ImportExport/Model/Source/Import/Entity.php @@ -32,7 +32,7 @@ * @package Magento_ImportExport * @author Magento Core Team */ -class Entity implements \Magento\Core\Model\Option\ArrayInterface +class Entity implements \Magento\Option\ArrayInterface { /** * @var \Magento\ImportExport\Model\Import\ConfigInterface diff --git a/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php b/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php index d091e2951ffa8..b96cf377635dd 100644 --- a/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php +++ b/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php @@ -31,18 +31,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Index/Controller/Adminhtml/Process.php b/app/code/Magento/Index/Controller/Adminhtml/Process.php index befa6f651b08f..f700b05a7a666 100644 --- a/app/code/Magento/Index/Controller/Adminhtml/Process.php +++ b/app/code/Magento/Index/Controller/Adminhtml/Process.php @@ -32,7 +32,7 @@ class Process extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -48,13 +48,13 @@ class Process extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Index\Model\ProcessFactory $processFactory * @param \Magento\Index\Model\Indexer $indexer */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Index\Model\ProcessFactory $processFactory, \Magento\Index\Model\Indexer $indexer ) { diff --git a/app/code/Magento/Index/Model/Event.php b/app/code/Magento/Index/Model/Event.php index 9bb89c8ed8e2f..cd861a188a782 100644 --- a/app/code/Magento/Index/Model/Event.php +++ b/app/code/Magento/Index/Model/Event.php @@ -85,8 +85,8 @@ class Event extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param Indexer $indexer * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -94,8 +94,8 @@ class Event extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, Indexer $indexer, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Index/Model/Process.php b/app/code/Magento/Index/Model/Process.php index 4cdb1a0d4d2a9..00eb26af61ecb 100644 --- a/app/code/Magento/Index/Model/Process.php +++ b/app/code/Magento/Index/Model/Process.php @@ -118,8 +118,8 @@ class Process extends \Magento\Core\Model\AbstractModel protected $_indexerConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Index\Model\Resource\Event $resourceEvent * @param \Magento\Index\Model\Indexer\Factory $indexerFactory * @param \Magento\Index\Model\Indexer $indexer @@ -131,8 +131,8 @@ class Process extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Index\Model\Resource\Event $resourceEvent, \Magento\Index\Model\Indexer\Factory $indexerFactory, \Magento\Index\Model\Indexer $indexer, diff --git a/app/code/Magento/Index/Model/Shell.php b/app/code/Magento/Index/Model/Shell.php index e2a53a234156f..002efdc41ac36 100644 --- a/app/code/Magento/Index/Model/Shell.php +++ b/app/code/Magento/Index/Model/Shell.php @@ -32,7 +32,7 @@ * @package Magento_Index * @author Magento Core Team */ -class Shell extends \Magento\Core\Model\AbstractShell +class Shell extends \Magento\App\AbstractShell { /** * Error status - whether errors have happened diff --git a/app/code/Magento/Indexer/Model/Indexer/State.php b/app/code/Magento/Indexer/Model/Indexer/State.php index c85db8e4b5ab3..6b5bab824b1ca 100644 --- a/app/code/Magento/Indexer/Model/Indexer/State.php +++ b/app/code/Magento/Indexer/Model/Indexer/State.php @@ -55,15 +55,15 @@ class State extends \Magento\Core\Model\AbstractModel protected $_eventObject = 'indexer_state'; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Indexer\Model\Resource\Indexer\State $resource * @param \Magento\Indexer\Model\Resource\Indexer\State\Collection $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Indexer\Model\Resource\Indexer\State $resource, \Magento\Indexer\Model\Resource\Indexer\State\Collection $resourceCollection, array $data = array() diff --git a/app/code/Magento/Indexer/Model/Shell.php b/app/code/Magento/Indexer/Model/Shell.php index be4829e44c311..dbe2a024ce4eb 100644 --- a/app/code/Magento/Indexer/Model/Shell.php +++ b/app/code/Magento/Indexer/Model/Shell.php @@ -24,7 +24,7 @@ namespace Magento\Indexer\Model; -class Shell extends \Magento\Core\Model\AbstractShell +class Shell extends \Magento\App\AbstractShell { /** * Error status - whether errors have happened diff --git a/app/code/Magento/Install/i18n/de_DE.csv b/app/code/Magento/Install/i18n/de_DE.csv index e5d2aca4a3707..9324bf6819983 100644 --- a/app/code/Magento/Install/i18n/de_DE.csv +++ b/app/code/Magento/Install/i18n/de_DE.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","Stellen Sie eine vollständige Base URL für die SSL Verbindung zur Verfügung. Zum Beispiel: %s" "Report All Bugs","Alle Bugs Melden" "Required Fields","Pflichtfelder" -"Response from server isn\'t valid.","Serverantwort ist nicht gültig." +"Response from server isn't valid.","Serverantwort ist nicht gültig." "Run admin interface with SSL","Admininterface mit SSL ausführen" "Run this in your shell from Magento root folder:","Führen Sie dies in Ihrer Shell aus dem Magento Rootordner aus:" "Save Session Data In","Sessiondaten speichern in" @@ -106,7 +106,7 @@ "Tables Prefix","Tabellenpräfix" "The URL ""%s"" is invalid.","Die URL ""%s"" ist ungültig." "The URL ""%s"" is not accessible.","Die URL ""%s"" ist nicht verfügbar." -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","Die Version des Datenbankservers stimmt nicht mit den Systemanforderungen (benötigt: %s, vorhanden: %s) überein." +"The database server version doesn't match system requirements (required: %s, actual: %s).","Die Version des Datenbankservers stimmt nicht mit den Systemanforderungen (benötigt: %s, vorhanden: %s) überein." "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","Das Tabellen-Präfix darf nur Buchstaben (a-z), Ziffern (0-9) oder Unterstriche (_) enthalten; das erste Zeichen sollte ein Buchstabe sein." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","Beim Installieren der Magento Packages ist ein Fehler aufgetreten. Bitte lesen Sie das Log, korrigieren Sie Fehler und versuchen sie es erneut." "Time Zone","Zeitzone" diff --git a/app/code/Magento/Install/i18n/en_US.csv b/app/code/Magento/Install/i18n/en_US.csv index 2fb240ea1477e..43192dd0f4c3f 100644 --- a/app/code/Magento/Install/i18n/en_US.csv +++ b/app/code/Magento/Install/i18n/en_US.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","Provide a complete base URL for SSL connection. For example: %s" "Report All Bugs","Report All Bugs" "Required Fields","Required Fields" -"Response from server isn\'t valid.","Response from server isn\'t valid." +"Response from server isn't valid.","Response from server isn't valid." "Run admin interface with SSL","Run admin interface with SSL" "Run this in your shell from Magento root folder:","Run this in your shell from Magento root folder:" "Save Session Data In","Save Session Data In" @@ -106,7 +106,7 @@ "Tables Prefix","Tables Prefix" "The URL ""%s"" is invalid.","The URL ""%s"" is invalid." "The URL ""%s"" is not accessible.","The URL ""%s"" is not accessible." -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","The database server version doesn\'t match system requirements (required: %s, actual: %s)." +"The database server version doesn't match system requirements (required: %s, actual: %s).","The database server version doesn't match system requirements (required: %s, actual: %s)." "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","There was a problem installing Magento packages. Please read the log, correct errors and try again." "Time Zone","Time Zone" diff --git a/app/code/Magento/Install/i18n/es_ES.csv b/app/code/Magento/Install/i18n/es_ES.csv index 36a6422dc4238..9264b240d6558 100644 --- a/app/code/Magento/Install/i18n/es_ES.csv +++ b/app/code/Magento/Install/i18n/es_ES.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","Proporcione una completa URL base para conexión SSL. Por ejemplo: %s" "Report All Bugs","Informar de todos los errores" "Required Fields","Campos obligatorios" -"Response from server isn\'t valid.","La respuesta del servidor no es válida." +"Response from server isn't valid.","La respuesta del servidor no es válida." "Run admin interface with SSL","Ejecutar la interfaz de administración con SSL" "Run this in your shell from Magento root folder:","Ejecute esto en su sistema desde la carpeta raíz de Magento:" "Save Session Data In","Guardar datos de sesión en" @@ -106,7 +106,7 @@ "Tables Prefix","Prefijo de tablas" "The URL ""%s"" is invalid.","El URL ""%s"" no es válido." "The URL ""%s"" is not accessible.","No se puede acceder al URL ""%s""." -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","La versión del servidor de la base de datos no se adecua a los requisitos del sistema (requeridos: %s, existentes: %s)." +"The database server version doesn't match system requirements (required: %s, actual: %s).","La versión del servidor de la base de datos no se adecua a los requisitos del sistema (requeridos: %s, existentes: %s)." "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","El prefijo de tabla solo debe contener letras (a-z), números (0-9) o el carácter de subrayado (_), el primer carácter debería ser una letra." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","Hubo un problema al instalar los paquetes de Magento. Por favor lea el registro, corrija los errores e inténtelo de nuevo." "Time Zone","Zona Horaria" diff --git a/app/code/Magento/Install/i18n/fr_FR.csv b/app/code/Magento/Install/i18n/fr_FR.csv index 93e8dc9a3ff0e..b0dcd01de9575 100644 --- a/app/code/Magento/Install/i18n/fr_FR.csv +++ b/app/code/Magento/Install/i18n/fr_FR.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","Fournir une base complète d'URL pour une connexion SSL. Par exemple : %s" "Report All Bugs","Rapporter tous les bugs" "Required Fields","Champs requis" -"Response from server isn\'t valid.","La réponse du serveur n'est pas valide." +"Response from server isn't valid.","La réponse du serveur n'est pas valide." "Run admin interface with SSL","Exécuter l'interface admin avec SSL" "Run this in your shell from Magento root folder:","Exécuter ceci dans votre shell depuis le dossier racine de Magento :" "Save Session Data In","Enregistrer les données de la session dans" @@ -106,7 +106,7 @@ "Tables Prefix","Préfixe de tables" "The URL ""%s"" is invalid.","L'URL ""%s"" n'est pas valide." "The URL ""%s"" is not accessible.","L'URL ""%s"" n'est pas accessible." -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","La version du serveur de base de données ne correspond pas aux conditions du système (requis : %s, présent : %s)." +"The database server version doesn't match system requirements (required: %s, actual: %s).","La version du serveur de base de données ne correspond pas aux conditions du système (requis : %s, présent : %s)." "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","Le préfixe du tableau ne doit contenir que des lettres (a-z), des chiffres (0-9) ou des tirets bas (_), et le premier caractère doit être une lettre." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","Un problème est survenu lors de l'installation des paquets Magento. Veuillez lire le journal, corriger les erreurs et réessayer." "Time Zone","Fuseau horaire" diff --git a/app/code/Magento/Install/i18n/nl_NL.csv b/app/code/Magento/Install/i18n/nl_NL.csv index 5f347bd891e70..4dc5d5cffebaa 100644 --- a/app/code/Magento/Install/i18n/nl_NL.csv +++ b/app/code/Magento/Install/i18n/nl_NL.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","Geef een volledige basis URL voor SSL connectie. Bijvoorbeeld: %s" "Report All Bugs","Rapporteer Alle Bugs" "Required Fields","Benodigde Velden" -"Response from server isn\'t valid.","Antwoord van de server is niet valide." +"Response from server isn't valid.","Antwoord van de server is niet valide." "Run admin interface with SSL","Start administratie bedieningspaneel met SSL" "Run this in your shell from Magento root folder:","Voer dit in uw shell van uw Magento root folder uit:" "Save Session Data In","Sla Sessie Data Op In" @@ -106,7 +106,7 @@ "Tables Prefix","Tabellen Voorvoegsel" "The URL ""%s"" is invalid.","De URL ""%s"" is ongeldig." "The URL ""%s"" is not accessible.","De URL ""%s"" is niet toegankelijk." -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","De database server komt niet overeen met systeemvereisten (benodigd: %s, werkelijk: %s)." +"The database server version doesn't match system requirements (required: %s, actual: %s).","De database server komt niet overeen met systeemvereisten (benodigd: %s, werkelijk: %s)." "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","In de tabel prefix mogen alleen letters (az), cijfers (0-9) en onderstrepingstekens (_) bevatten, het eerste karakter moet een letter zijn." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","Er was een probleem met het installeren van Magento pakketten. Lees alstublieft het logboek, verbeter fouten en probeer het opnieuw." "Time Zone","Tijdszone" diff --git a/app/code/Magento/Install/i18n/pt_BR.csv b/app/code/Magento/Install/i18n/pt_BR.csv index 49ec5da899556..13257692b1876 100644 --- a/app/code/Magento/Install/i18n/pt_BR.csv +++ b/app/code/Magento/Install/i18n/pt_BR.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","Forneça um URL base completo para a conexão SSL. Por exemplo: %s" "Report All Bugs","Reporte Todos os Erros" "Required Fields","Campos Obrigatórios" -"Response from server isn\'t valid.","Resposta do servidor não é válida." +"Response from server isn't valid.","Resposta do servidor não é válida." "Run admin interface with SSL","Execute a interface de administração com SSL" "Run this in your shell from Magento root folder:","Execute isto em seu sistema operativo a partir da pasta raiz Magento:" "Save Session Data In","Salve Dados de Sessão Em" @@ -106,7 +106,7 @@ "Tables Prefix","Prefixo das Tabelas" "The URL ""%s"" is invalid.","O URL ""%s"" é inválido." "The URL ""%s"" is not accessible.","O URL ""%s"" não está acessível." -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","A versão do servidor do banco de dados não combina com os requisitos de sistema (requerido: %s, atual: %s)." +"The database server version doesn't match system requirements (required: %s, actual: %s).","A versão do servidor do banco de dados não combina com os requisitos de sistema (requerido: %s, atual: %s)." "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","O prefixo da tabela deve conter somente letras (a-z), números (0-9) ou sublinhados (_), o primeiro caractere deve ser uma letra." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","Houve um problema ao instalar pacotes Magento. Por favor leia o registro, corrija erros e tente novamente." "Time Zone","Fuso Horário" diff --git a/app/code/Magento/Install/i18n/zh_CN.csv b/app/code/Magento/Install/i18n/zh_CN.csv index 0f40aedac1fd8..18671198c20b6 100644 --- a/app/code/Magento/Install/i18n/zh_CN.csv +++ b/app/code/Magento/Install/i18n/zh_CN.csv @@ -93,7 +93,7 @@ "Provide a complete base URL for SSL connection. For example: %s","为SSL连接提供完整的基本UEL,例如:%s" "Report All Bugs","报告所有Bug" "Required Fields","必须的字段" -"Response from server isn\'t valid.","来自服务器的响应无效。" +"Response from server isn't valid.","来自服务器的响应无效。" "Run admin interface with SSL","使用SSL运行管理界面。" "Run this in your shell from Magento root folder:","在您的外壳中从Magento根文件夹运行这个:" "Save Session Data In","保存会话数据至" @@ -106,7 +106,7 @@ "Tables Prefix","表格前缀" "The URL ""%s"" is invalid.","URL ""%s"" 无效。" "The URL ""%s"" is not accessible.","URL “%s” 无法访问。" -"The database server version doesn\'t match system requirements (required: %s, actual: %s).","数据库服务器版本不满足要求(需要:%s,实际:%s)。" +"The database server version doesn't match system requirements (required: %s, actual: %s).","数据库服务器版本不满足要求(需要:%s,实际:%s)。" "The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","表前缀只能包含字母 (a-z)、数字 (0-9),或下划线 (_),第一个字符必须是字母。" "There was a problem installing Magento packages. Please read the log, correct errors and try again.","安装Magento包时遇到了错误。请阅读日志,解决问题,并重试。" "Time Zone","时区" diff --git a/app/code/Magento/Install/view/install/css/validate.css b/app/code/Magento/Install/view/install/css/validate.css index d711bafdfeb22..ad76ef7a83a4c 100644 --- a/app/code/Magento/Install/view/install/css/validate.css +++ b/app/code/Magento/Install/view/install/css/validate.css @@ -28,7 +28,7 @@ input.mage-error, textarea.mage-error, ul.mage-error, select.mage-error { } div.mage-error { - background: url("../images/validation_advice_bg.gif") no-repeat scroll 2px 1px transparent; + background: url(../images/validation_advice_bg.gif) no-repeat scroll 2px 1px transparent; clear: both; font-size: 0.95em; font-weight: bold; diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php index b0382acaa5d7c..98fd4ac0347cd 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php @@ -33,7 +33,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry = null; @@ -44,13 +44,13 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container * Initialize dependencies. * * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Integration\Helper\Data $integrationHelper * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Integration\Helper\Data $integrationHelper, array $data = array() ) { diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php index e394cb01c399b..021db1a7beb71 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php @@ -46,7 +46,7 @@ class Integration extends Action const REGISTRY_KEY_CURRENT_INTEGRATION = 'current_integration'; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -72,7 +72,7 @@ class Integration extends Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Logger $logger * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService * @param IntegrationOauthService $oauthService @@ -82,7 +82,7 @@ class Integration extends Action */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Logger $logger, \Magento\Integration\Service\IntegrationV1Interface $integrationService, IntegrationOauthService $oauthService, diff --git a/app/code/Magento/Integration/Model/Integration.php b/app/code/Magento/Integration/Model/Integration.php index 9af81d5aa4642..9e0bdbf54f98b 100644 --- a/app/code/Magento/Integration/Model/Integration.php +++ b/app/code/Magento/Integration/Model/Integration.php @@ -79,16 +79,16 @@ class Integration extends \Magento\Core\Model\AbstractModel protected $_dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Integration/Model/Integration/Source/Status.php b/app/code/Magento/Integration/Model/Integration/Source/Status.php index f62da5a0f3520..8a0abd73bc4a8 100644 --- a/app/code/Magento/Integration/Model/Integration/Source/Status.php +++ b/app/code/Magento/Integration/Model/Integration/Source/Status.php @@ -26,7 +26,7 @@ /** * Integration status options. */ -class Status implements \Magento\Core\Model\Option\ArrayInterface +class Status implements \Magento\Option\ArrayInterface { /** * Retrieve status options array. diff --git a/app/code/Magento/Integration/Model/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Oauth/Consumer.php index b477341532c65..12ad275feb004 100644 --- a/app/code/Magento/Integration/Model/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Oauth/Consumer.php @@ -57,8 +57,8 @@ class Consumer extends \Magento\Core\Model\AbstractModel implements ConsumerInte protected $_keyLengthFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory * @param \Magento\Url\Validator $urlValidator * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -66,8 +66,8 @@ class Consumer extends \Magento\Core\Model\AbstractModel implements ConsumerInte * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, \Magento\Url\Validator $urlValidator, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Integration/Model/Oauth/Nonce.php b/app/code/Magento/Integration/Model/Oauth/Nonce.php index 0e2d8caf8fde5..d6109360d5a9c 100644 --- a/app/code/Magento/Integration/Model/Oauth/Nonce.php +++ b/app/code/Magento/Integration/Model/Oauth/Nonce.php @@ -45,16 +45,16 @@ class Nonce extends \Magento\Core\Model\AbstractModel protected $_oauthData; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Integration\Helper\Oauth\Data $oauthData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Integration\Helper\Oauth\Data $oauthData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Integration/Model/Oauth/Token.php b/app/code/Magento/Integration/Model/Oauth/Token.php index 3f38e219c58c3..cf76dc4cbf26f 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Oauth/Token.php @@ -107,8 +107,8 @@ class Token extends \Magento\Core\Model\AbstractModel /** * Initialize dependencies. * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory * @param \Magento\Url\Validator $urlValidator * @param \Magento\Stdlib\DateTime $dateTime @@ -121,8 +121,8 @@ class Token extends \Magento\Core\Model\AbstractModel * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, \Magento\Url\Validator $urlValidator, \Magento\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Log/Model/Aggregation.php b/app/code/Magento/Log/Model/Aggregation.php index 68f0bbfaf1107..d8b8b258b242f 100644 --- a/app/code/Magento/Log/Model/Aggregation.php +++ b/app/code/Magento/Log/Model/Aggregation.php @@ -50,16 +50,16 @@ class Aggregation extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Log/Model/Cron.php b/app/code/Magento/Log/Model/Cron.php index 376a45bb2d5d4..c0b5be51106de 100644 --- a/app/code/Magento/Log/Model/Cron.php +++ b/app/code/Magento/Log/Model/Cron.php @@ -71,14 +71,14 @@ class Cron extends \Magento\Core\Model\AbstractModel protected $_log; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateFactory; + protected $_transportBuilder; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Email\Model\TemplateFactory $templateFactory + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Log\Model\Log $log * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\TranslateInterface $translate @@ -88,9 +88,9 @@ class Cron extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Email\Model\TemplateFactory $templateFactory, + \Magento\Model\Context $context, + \Magento\Registry $registry, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Log\Model\Log $log, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\TranslateInterface $translate, @@ -99,7 +99,7 @@ public function __construct( \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->_templateFactory = $templateFactory; + $this->_transportBuilder = $transportBuilder; $this->_log = $log; $this->_storeManager = $storeManager; $this->_translate = $translate; @@ -121,23 +121,20 @@ protected function _sendLogCleanEmail() return $this; } - $this->_translate->setTranslateInline(false); - $emailTemplate = $this->_templateFactory->create(); - /* @var $emailTemplate \Magento\Email\Model\Template */ - $emailTemplate->setDesignConfig( - array( - 'area' => 'backend', + $transport = $this->_transportBuilder + ->setTemplateIdentifier($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_LOG_CLEAN_TEMPLATE)) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, 'store' => $this->_storeManager->getStore()->getId() - ) - )->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_LOG_CLEAN_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_LOG_CLEAN_IDENTITY), - $this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT), - null, - array('warnings' => join("\n", $this->_errors)) - ); + )) + ->setTemplateVars(array('warnings' => join("\n", $this->_errors))) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_LOG_CLEAN_IDENTITY)) + ->addTo($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT)) + ->getTransport(); + + $transport->sendMessage(); $this->_translate->setTranslateInline(true); return $this; diff --git a/app/code/Magento/Log/Model/Customer.php b/app/code/Magento/Log/Model/Customer.php index 61d0abcf90d55..10e696e194338 100644 --- a/app/code/Magento/Log/Model/Customer.php +++ b/app/code/Magento/Log/Model/Customer.php @@ -53,16 +53,16 @@ class Customer extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Log/Model/Log.php b/app/code/Magento/Log/Model/Log.php index 4727613c54faa..e511aca581f71 100644 --- a/app/code/Magento/Log/Model/Log.php +++ b/app/code/Magento/Log/Model/Log.php @@ -57,16 +57,16 @@ class Log extends \Magento\Core\Model\AbstractModel protected $_coreStoreConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Log/Model/Shell.php b/app/code/Magento/Log/Model/Shell.php index e90e674e3dbb0..7307452804869 100644 --- a/app/code/Magento/Log/Model/Shell.php +++ b/app/code/Magento/Log/Model/Shell.php @@ -32,7 +32,7 @@ * @package Magento_Log * @author Magento Core Team */ -class Shell extends \Magento\Core\Model\AbstractShell +class Shell extends \Magento\App\AbstractShell { /** * @var \Magento\Log\Model\Shell\Command\Factory diff --git a/app/code/Magento/Log/Model/Visitor.php b/app/code/Magento/Log/Model/Visitor.php index 35a192d1cd97e..86c56dc64c092 100644 --- a/app/code/Magento/Log/Model/Visitor.php +++ b/app/code/Magento/Log/Model/Visitor.php @@ -114,8 +114,8 @@ class Visitor extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Sales\Model\QuoteFactory $quoteFactory @@ -133,8 +133,8 @@ class Visitor extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Sales\Model\QuoteFactory $quoteFactory, diff --git a/app/code/Magento/Log/Model/Visitor/Online.php b/app/code/Magento/Log/Model/Visitor/Online.php index 38c8f12e7de9d..8f7efd2687f0e 100644 --- a/app/code/Magento/Log/Model/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Visitor/Online.php @@ -59,16 +59,16 @@ class Online extends \Magento\Core\Model\AbstractModel protected $_coreStoreConfig; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Log/etc/module.xml b/app/code/Magento/Log/etc/module.xml index f3d7e8dd56d0d..5a11ddf352b06 100755 --- a/app/code/Magento/Log/etc/module.xml +++ b/app/code/Magento/Log/etc/module.xml @@ -34,7 +34,6 @@ - diff --git a/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php b/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php index 38abc9578479f..7b6ddf703468e 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php @@ -24,17 +24,48 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Multishipping\Block\Checkout\Address; + +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; +use Magento\Customer\Helper\Address as CustomerAddressHelper; +use Magento\Exception\NoSuchEntityException; + /** * Multishipping checkout select billing address - * - * @category Magento - * @package Magento_Checkout - * @author Magento Core Team */ -namespace Magento\Multishipping\Block\Checkout\Address; - class Select extends \Magento\Multishipping\Block\Checkout\AbstractMultishipping { + /** + * @var CustomerAddressServiceInterface + */ + protected $_customerAddressService; + + /** + * @var CustomerAddressHelper + */ + protected $_customerAddressHelper; + + /** + * Initialize dependencies. + * + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping + * @param CustomerAddressServiceInterface $customerAddressService + * @param CustomerAddressHelper $customerAddressHelper + * @param array $data + */ + public function __construct( + \Magento\View\Element\Template\Context $context, + \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping, + CustomerAddressServiceInterface $customerAddressService, + CustomerAddressHelper $customerAddressHelper, + array $data = array() + ) { + $this->_customerAddressService = $customerAddressService; + $this->_customerAddressHelper = $customerAddressHelper; + parent::__construct($context, $multishipping, $data); + } + /** * @var bool */ @@ -48,34 +79,85 @@ protected function _prepareLayout() return parent::_prepareLayout(); } + /** + * Get a list of current customer addresses. + * + * @return \Magento\Customer\Service\V1\Dto\Address[] + */ public function getAddressCollection() { - $collection = $this->getData('address_collection'); - if (is_null($collection)) { - $collection = $this->_multishipping->getCustomer()->getAddresses(); - $this->setData('address_collection', $collection); + $addresses = $this->getData('address_collection'); + if (is_null($addresses)) { + try{ + $addresses = $this->_customerAddressService->getAddresses( + $this->_multishipping->getCustomer()->getCustomerId() + ); + } catch (NoSuchEntityException $e) { + return []; + } + $this->setData('address_collection', $addresses); } - return $collection; + return $addresses; } - + + /** + * Represent customer address in HTML format. + * + * @param \Magento\Customer\Service\V1\Dto\Address $addressData + * @return string + */ + public function getAddressAsHtml($addressData) + { + $formatTypeRenderer = $this->_customerAddressHelper->getFormatTypeRenderer('html'); + $result = ''; + if ($formatTypeRenderer) { + $result = $formatTypeRenderer->renderArray($addressData->getAttributes()); + } + return $result; + } + + /** + * Check if provided address is default customer billing address. + * + * @param \Magento\Customer\Service\V1\Dto\Address $address + * @return bool + */ public function isAddressDefaultBilling($address) { return $address->getId() == $this->_multishipping->getCustomer()->getDefaultBilling(); } - + + /** + * Check if provided address is default customer shipping address. + * + * @param \Magento\Customer\Service\V1\Dto\Address $address + * @return bool + */ public function isAddressDefaultShipping($address) { return $address->getId() == $this->_multishipping->getCustomer()->getDefaultShipping(); } - + + /** + * Get URL of customer address edit page. + * + * @param \Magento\Customer\Service\V1\Dto\Address $address + * @return string + */ public function getEditAddressUrl($address) { - return $this->getUrl('*/*/editAddress', array('id'=>$address->getId())); + return $this->getUrl('*/*/editAddress', array('id' => $address->getId())); } + /** + * Get URL of page, at which customer billing address can be set. + * + * @param \Magento\Customer\Service\V1\Dto\Address $address + * @return string + */ public function getSetAddressUrl($address) { - return $this->getUrl('*/*/setBilling', array('id'=>$address->getId())); + return $this->getUrl('*/*/setBilling', array('id' => $address->getId())); } public function getAddNewUrl() diff --git a/app/code/Magento/Multishipping/Block/Checkout/Shipping.php b/app/code/Magento/Multishipping/Block/Checkout/Shipping.php index 1325daba0e856..6f9ae540977e6 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Shipping.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Shipping.php @@ -84,6 +84,9 @@ protected function _prepareLayout() return parent::_prepareLayout(); } + /** + * @return \Magento\Customer\Model\Address[] + */ public function getAddresses() { return $this->getCheckout()->getQuote()->getAllShippingAddresses(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout.php b/app/code/Magento/Multishipping/Controller/Checkout.php index 6272f1848a77c..a43b59692db2e 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout.php +++ b/app/code/Magento/Multishipping/Controller/Checkout.php @@ -18,25 +18,45 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Checkout * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Multishipping checkout controller - * - * @author Magento Core Team - */ namespace Magento\Multishipping\Controller; -use Magento\App\Action\NotFoundException; use Magento\App\RequestInterface; use Magento\Multishipping\Model\Checkout\Type\Multishipping\State; +use Magento\Customer\Service\V1\CustomerServiceInterface as CustomerService; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface as CustomerAccountService; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadataService; +/** + * Multishipping checkout controller + */ class Checkout extends \Magento\Checkout\Controller\Action { + /** + * @param \Magento\App\Action\Context $context + * @param \Magento\Customer\Model\Session $customerSession + * @param CustomerService $customerService + * @param CustomerAccountService $customerAccountService + * @param CustomerMetadataService $customerMetadataService + */ + public function __construct( + \Magento\App\Action\Context $context, + \Magento\Customer\Model\Session $customerSession, + CustomerService $customerService, + CustomerAccountService $customerAccountService, + CustomerMetadataService $customerMetadataService + ) { + parent::__construct( + $context, + $customerSession, + $customerService, + $customerAccountService, + $customerMetadataService + ); + } + /** * Retrieve checkout model * @@ -77,17 +97,6 @@ protected function _getCheckoutSession() return $this->_objectManager->get('Magento\Checkout\Model\Session'); } - /** - * @param \Magento\App\Action\Context $context - * @param \Magento\Customer\Model\Session $customerSession - */ - public function __construct( - \Magento\App\Action\Context $context, - \Magento\Customer\Model\Session $customerSession - ) { - parent::__construct($context, $customerSession); - } - /** * Dispatch request * diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address.php b/app/code/Magento/Multishipping/Controller/Checkout/Address.php index 08bfabfc5e57c..d766bd7eb17ad 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address.php @@ -18,23 +18,37 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Checkout * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * Multishipping checkout address matipulation controller - * - * @category Magento - * @package Magento_Checkout - * @author Magento Core Team - */ namespace Magento\Multishipping\Controller\Checkout; +use Magento\App\Action\Context; +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; + +/** + * Multishipping checkout address manipulation controller + */ class Address extends \Magento\App\Action\Action { + /** @var CustomerAddressServiceInterface */ + protected $_customerAddressService; + + /** + * Initialize dependencies. + * + * @param Context $context + * @param CustomerAddressServiceInterface $customerAddressService + */ + public function __construct( + \Magento\App\Action\Context $context, + CustomerAddressServiceInterface $customerAddressService + ) { + $this->_customerAddressService = $customerAddressService; + parent::__construct($context); + } + /** * Retrieve multishipping checkout model * @@ -89,7 +103,8 @@ public function shippingSavedAction() /** * if we create first address we need reset emd init checkout */ - if (count($this->_getCheckout()->getCustomer()->getAddresses()) == 1) { + $customerId = $this->_getCheckout()->getCustomer()->getCustomerId(); + if (count($this->_customerAddressService->getAddresses($customerId)) == 1) { $this->_getCheckout()->reset(); } $this->_redirect('*/checkout/addresses'); diff --git a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php index e6f3365015663..755d7bccc987b 100644 --- a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php +++ b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php @@ -18,21 +18,17 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Checkout * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Multishipping\Model\Checkout\Type; + +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; + /** * Multishipping checkout model - * - * @category Magento - * @package Magento_Checkout - * @author Magento Core Team */ -namespace Magento\Multishipping\Model\Checkout\Type; - class Multishipping extends \Magento\Checkout\Model\Type\AbstractType { /** @@ -82,6 +78,8 @@ class Multishipping extends \Magento\Checkout\Model\Type\AbstractType protected $paymentSpecification; /** + * Initialize dependencies. + * * @var \Magento\Multishipping\Helper\Data */ protected $helper; @@ -90,6 +88,7 @@ class Multishipping extends \Magento\Checkout\Model\Type\AbstractType * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory + * @param CustomerAddressServiceInterface $customerAddressService * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Session $session @@ -104,6 +103,7 @@ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, + CustomerAddressServiceInterface $customerAddressService, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Session $session, @@ -122,7 +122,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->paymentSpecification = $paymentSpecification; $this->helper = $helper; - parent::__construct($checkoutSession, $customerSession, $orderFactory, $data); + parent::__construct($checkoutSession, $customerSession, $orderFactory, $customerAddressService, $data); $this->_init(); } @@ -138,7 +138,7 @@ protected function _init() * reset quote shipping addresses and items */ $quote = $this->getQuote(); - if (!$this->getCustomer()->getId()) { + if (!$this->getCustomer()->getCustomerId()) { return $this; } @@ -154,7 +154,7 @@ protected function _init() $defaultShipping = $this->getCustomerDefaultShippingAddress(); if ($defaultShipping) { - $quote->getShippingAddress()->importCustomerAddress($defaultShipping); + $quote->getShippingAddress()->importCustomerAddressData($defaultShipping); foreach ($this->getQuoteItems() as $item) { /** @@ -169,8 +169,7 @@ protected function _init() } if ($this->getCustomerDefaultBillingAddress()) { - $quote->getBillingAddress() - ->importCustomerAddress($this->getCustomerDefaultBillingAddress()); + $quote->getBillingAddress()->importCustomerAddressData($this->getCustomerDefaultBillingAddress()); foreach ($this->getQuoteItems() as $item) { if ($item->getParentItemId()) { continue; @@ -336,7 +335,7 @@ public function setShippingItemsInformation($info) $customerDefaultBilling = $this->getCustomerDefaultBillingAddress(); if ($customerDefaultBilling) { - $quote->getBillingAddress()->importCustomerAddress($customerDefaultBilling); + $quote->getBillingAddress()->importCustomerAddressData($customerDefaultBilling); } foreach ($quote->getAllItems() as $_item) { @@ -386,10 +385,14 @@ protected function _addShippingItem($quoteItemId, $data) } $quoteItem->setMultishippingQty((int)$quoteItem->getMultishippingQty()+$qty); $quoteItem->setQty($quoteItem->getMultishippingQty()); - $address = $this->getCustomer()->getAddressById($addressId); - if ($address->getId()) { + try { + $address = $this->_customerAddressService->getAddressById($addressId); + } catch (\Exception $e) { + /** Customer address does not exist. */ + } + if (isset($address)) { if (!$quoteAddress = $this->getQuote()->getShippingAddressByCustomerAddressId($address->getId())) { - $quoteAddress = $this->_addressFactory->create()->importCustomerAddress($address); + $quoteAddress = $this->_addressFactory->create()->importCustomerAddressData($address); $this->getQuote()->addShippingAddress($quoteAddress); } @@ -417,11 +420,15 @@ protected function _addShippingItem($quoteItemId, $data) */ public function updateQuoteCustomerShippingAddress($addressId) { - $address = $this->getCustomer()->getAddressById($addressId); - if ($address) { + try { + $address = $this->_customerAddressService->getAddressById($addressId); + } catch (\Exception $e) { + /** Customer address does not exist. */ + } + if (isset($address)) { $this->getQuote()->getShippingAddressByCustomerAddressId($addressId) ->setCollectShippingRates(true) - ->importCustomerAddress($address) + ->importCustomerAddressData($address) ->collectTotals(); $this->getQuote()->save(); } @@ -436,10 +443,14 @@ public function updateQuoteCustomerShippingAddress($addressId) */ public function setQuoteCustomerBillingAddress($addressId) { - $address = $this->getCustomer()->getAddressById($addressId); - if ($address) { + try { + $address = $this->_customerAddressService->getAddressById($addressId); + } catch (\Exception $e) { + /** Customer address does not exist. */ + } + if (isset($address)) { $this->getQuote()->getBillingAddress($addressId) - ->importCustomerAddress($address) + ->importCustomerAddressData($address) ->collectTotals(); $this->getQuote()->collectTotals()->save(); } diff --git a/app/code/Magento/Multishipping/view/frontend/checkout/address/select.phtml b/app/code/Magento/Multishipping/view/frontend/checkout/address/select.phtml index 25f8a4fdfab14..83429561c3366 100644 --- a/app/code/Magento/Multishipping/view/frontend/checkout/address/select.phtml +++ b/app/code/Magento/Multishipping/view/frontend/checkout/address/select.phtml @@ -18,10 +18,11 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category design * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + +/** @var \Magento\Multishipping\Block\Checkout\Address\Select $this */ ?>
    @@ -30,7 +31,7 @@ getAddressCollection() as $_address): ?>
    - format('html') ?> + getAddressAsHtml($_address) ?> isAddressDefaultBilling($_address)): ?>
    diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php index 9862e6010fcfe..8db0800be8959 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php @@ -41,7 +41,7 @@ class Edit extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -53,13 +53,13 @@ class Edit extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php index ccc52cbe30985..d214d1ba6f83d 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php @@ -25,8 +25,6 @@ */ namespace Magento\Newsletter\Block\Adminhtml\Queue\Edit; -use Magento\Newsletter\Model\Queue; - /** * Newsletter queue edit form * @@ -53,7 +51,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Newsletter\Model\QueueFactory $queueFactory * @param \Magento\Core\Model\System\Store $systemStore @@ -62,7 +60,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Newsletter\Model\QueueFactory $queueFactory, \Magento\Core\Model\System\Store $systemStore, @@ -84,6 +82,7 @@ public function __construct( */ protected function _prepareForm() { + /* @var $queue \Magento\Newsletter\Model\Queue */ $queue = $this->getQueue(); /** @var \Magento\Data\Form $form */ @@ -97,7 +96,7 @@ protected function _prepareForm() $dateFormat = $this->_locale->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM); $timeFormat = $this->_locale->getTimeFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM); - if ($queue->getQueueStatus() == Queue::STATUS_NEVER) { + if ($queue->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_NEVER) { $fieldset->addField('date', 'date', array( 'name' => 'start_at', 'date_format' => $dateFormat, @@ -204,7 +203,7 @@ protected function _prepareForm() 'container_id' => 'field_newsletter_styles', 'value' => $queue->getTemplate()->getTemplateStyles() )); - } elseif (Queue::STATUS_NEVER != $queue->getQueueStatus()) { + } elseif (\Magento\Newsletter\Model\Queue::STATUS_NEVER != $queue->getQueueStatus()) { $fieldset->addField('text', 'textarea', array( 'name' => 'text', 'label' => __('Message'), @@ -249,7 +248,7 @@ protected function _prepareForm() /** * Retrieve queue object * - * @return Queue + * @return \Magento\Newsletter\Model\Queue */ protected function getQueue() { diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php index 5a02cb98f3a9b..87e7f9804fffa 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php @@ -44,7 +44,7 @@ class Website /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -63,7 +63,7 @@ class Website * @param \Magento\Core\Model\Resource\Helper $resourceHelper * @param \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -71,7 +71,7 @@ public function __construct( \Magento\Core\Model\Resource\Helper $resourceHelper, \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php index 9b7b2f862d7db..577f9f71dcb32 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php @@ -45,7 +45,7 @@ class Edit extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -57,13 +57,13 @@ class Edit extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php index 1eb60eb5e4a5d..593e8318f38d4 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php @@ -43,14 +43,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, array $data = array() diff --git a/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/GroupOptionHash.php b/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/GroupOptionHash.php index 71db70818e461..ff7d7055da37a 100644 --- a/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/GroupOptionHash.php +++ b/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/GroupOptionHash.php @@ -25,21 +25,19 @@ */ namespace Magento\Newsletter\Block\Subscribe\Grid\Options; -use Magento\Core\Model\System\Store; - -class GroupOptionHash implements \Magento\Core\Model\Option\ArrayInterface +class GroupOptionHash implements \Magento\Option\ArrayInterface { /** * System Store Model * - * @var Store + * @var \Magento\Core\Model\System\Store */ protected $_systemStore; /** - * @param Store $systemStore + * @param \Magento\Core\Model\System\Store $systemStore */ - public function __construct(Store $systemStore) + public function __construct(\Magento\Core\Model\System\Store $systemStore) { $this->_systemStore = $systemStore; } diff --git a/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/StoreOptionHash.php b/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/StoreOptionHash.php index b48e45a4b149f..a10143abdf627 100644 --- a/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/StoreOptionHash.php +++ b/app/code/Magento/Newsletter/Block/Subscribe/Grid/Options/StoreOptionHash.php @@ -25,21 +25,19 @@ */ namespace Magento\Newsletter\Block\Subscribe\Grid\Options; -use Magento\Core\Model\System\Store; - -class StoreOptionHash implements \Magento\Core\Model\Option\ArrayInterface +class StoreOptionHash implements \Magento\Option\ArrayInterface { /** * System Store Model * - * @var Store + * @var \Magento\Core\Model\System\Store */ protected $_systemStore; /** - * @param Store $systemStore + * @param \Magento\Core\Model\System\Store $systemStore */ - public function __construct(Store $systemStore) + public function __construct(\Magento\Core\Model\System\Store $systemStore) { $this->_systemStore = $systemStore; } diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php index c9aac04b51ed7..fb3e2497230bb 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php @@ -38,17 +38,17 @@ class Queue extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php index d23f4f9773058..3f8e37a187a94 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php @@ -37,16 +37,16 @@ class Template extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Newsletter/Helper/Data.php b/app/code/Magento/Newsletter/Helper/Data.php index fb9ffa05c6576..aaf19f61c0647 100644 --- a/app/code/Magento/Newsletter/Helper/Data.php +++ b/app/code/Magento/Newsletter/Helper/Data.php @@ -44,7 +44,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getConfirmationUrl($subscriber) { - return $this->_urlBuilder->setStore($subscriber->getStoreId()) + return $this->_urlBuilder->setScope($subscriber->getStoreId()) ->getUrl('newsletter/subscriber/confirm', array( 'id' => $subscriber->getId(), 'code' => $subscriber->getCode(), @@ -60,7 +60,7 @@ public function getConfirmationUrl($subscriber) */ public function getUnsubscribeUrl($subscriber) { - return $this->_urlBuilder->setStore($subscriber->getStoreId()) + return $this->_urlBuilder->setScope($subscriber->getStoreId()) ->getUrl('newsletter/subscriber/unsubscribe', array( 'id' => $subscriber->getId(), 'code' => $subscriber->getCode(), diff --git a/app/code/Magento/Newsletter/Model/Problem.php b/app/code/Magento/Newsletter/Model/Problem.php index a16c5a65ab353..52f29879df3c9 100644 --- a/app/code/Magento/Newsletter/Model/Problem.php +++ b/app/code/Magento/Newsletter/Model/Problem.php @@ -62,16 +62,16 @@ class Problem extends \Magento\Core\Model\AbstractModel /** * Construct * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Newsletter/Model/Queue.php b/app/code/Magento/Newsletter/Model/Queue.php index 65c4851d1bab5..1e29e9e94cb60 100644 --- a/app/code/Magento/Newsletter/Model/Queue.php +++ b/app/code/Magento/Newsletter/Model/Queue.php @@ -61,11 +61,6 @@ class Queue extends \Magento\Core\Model\Template */ protected $_template; - /** - * @var \Magento\Email\Model\Template - */ - protected $_emailTemplate = null; - /** * Subscribers collection * @@ -114,13 +109,6 @@ class Queue extends \Magento\Core\Model\Template */ protected $_locale; - /** - * Email template factory - * - * @var \Magento\Email\Model\TemplateFactory - */ - protected $_emailTemplateFactory; - /** * Problem factory * @@ -136,9 +124,14 @@ class Queue extends \Magento\Core\Model\Template protected $_templateFactory; /** - * @param \Magento\Core\Model\Context $context + * @var \Magento\Newsletter\Model\Queue\TransportBuilder + */ + protected $_transportBuilder; + + /** + * @param \Magento\Model\Context $context * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Newsletter\Model\Template\Filter $templateFilter @@ -146,14 +139,14 @@ class Queue extends \Magento\Core\Model\Template * @param \Magento\Core\Model\Date $date * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory * @param \Magento\Newsletter\Model\ProblemFactory $problemFactory - * @param \Magento\Email\Model\TemplateFactory $emailTemplateFactory * @param \Magento\Newsletter\Model\Resource\Subscriber\CollectionFactory $subscriberCollectionFactory + * @param \Magento\Newsletter\Model\Queue\TransportBuilder $transportBuilder * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, + \Magento\Model\Context $context, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Newsletter\Model\Template\Filter $templateFilter, @@ -161,8 +154,8 @@ public function __construct( \Magento\Core\Model\Date $date, \Magento\Newsletter\Model\TemplateFactory $templateFactory, \Magento\Newsletter\Model\ProblemFactory $problemFactory, - \Magento\Email\Model\TemplateFactory $emailTemplateFactory, \Magento\Newsletter\Model\Resource\Subscriber\CollectionFactory $subscriberCollectionFactory, + \Magento\Newsletter\Model\Queue\TransportBuilder $transportBuilder, array $data = array() ) { parent::__construct($context, $design, $registry, $appEmulation, $storeManager, $data); @@ -171,8 +164,8 @@ public function __construct( $this->_locale = $locale; $this->_templateFactory = $templateFactory; $this->_problemFactory = $problemFactory; - $this->_emailTemplateFactory = $emailTemplateFactory; $this->_subscribersCollection = $subscriberCollectionFactory->create(); + $this->_transportBuilder = $transportBuilder; } /** @@ -183,14 +176,6 @@ public function __construct( protected function _construct() { parent::_construct(); - $emailTemplate = $this->_getData('email_template'); - if ($emailTemplate) { - $this->unsetData('email_template'); - if (!($emailTemplate instanceof \Magento\Email\Model\Template)) { - throw new \Exception('Instance of \Magento\Email\Model\Template is expected.'); - } - $this->_emailTemplate = $emailTemplate; - } $this->_init('Magento\Newsletter\Model\Resource\Queue'); } @@ -225,11 +210,10 @@ public function setQueueStartAtByString($startAt) /** * Send messages to subscribers for this queue * - * @param int $count - * @param array $additionalVariables + * @param int $count * @return $this */ - public function sendPerSubscriber($count = 20, array $additionalVariables = array()) + public function sendPerSubscriber($count = 20) { if ($this->getQueueStatus() != self::STATUS_SENDING && ($this->getQueueStatus() != self::STATUS_NEVER && $this->getQueueStartAt()) @@ -253,43 +237,37 @@ public function sendPerSubscriber($count = 20, array $additionalVariables = arra ->setCurPage(1) ->load(); - /** @var \Magento\Email\Model\Template $sender */ - $sender = $this->_emailTemplate ?: $this->_emailTemplateFactory->create(); - $sender->setSenderName($this->getNewsletterSenderName()) - ->setSenderEmail($this->getNewsletterSenderEmail()) - ->setTemplateType(self::TYPE_HTML) - ->setTemplateSubject($this->getNewsletterSubject()) - ->setTemplateText($this->getNewsletterText()) - ->setTemplateStyles($this->getNewsletterStyles()) - ->setTemplateFilter($this->_templateFilter); + $this->_transportBuilder->setTemplateData(array( + 'template_subject' => $this->getNewsletterSubject(), + 'template_text' => $this->getNewsletterText(), + 'template_styles' => $this->getNewsletterStyles(), + 'template_filter' => $this->_templateFilter, + 'template_type' => self::TYPE_HTML, + )); /** @var \Magento\Newsletter\Model\Subscriber $item */ foreach ($collection->getItems() as $item) { - $email = $item->getSubscriberEmail(); - $name = $item->getSubscriberFullName(); - - $sender->emulateDesign($item->getStoreId()); - $successSend = $this->_appState->emulateAreaCode( - self::DEFAULT_DESIGN_AREA, - array($sender, 'send'), - array($email, $name, array('subscriber' => $item)) - ); - $sender->revertDesign(); - - if ($successSend) { - $item->received($this); - } else { + $transport = $this->_transportBuilder + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $item->getStoreId() + )) + ->setTemplateVars(array('subscriber' => $item)) + ->setFrom(['name' => $this->getNewsletterSenderEmail(), 'email' => $this->getNewsletterSenderName()]) + ->addTo($item->getSubscriberEmail(), $item->getSubscriberFullName()) + ->getTransport(); + + try { + $transport->sendMessage(); + } catch (\Magento\Mail\Exception $e) { /** @var \Magento\Newsletter\Model\Problem $problem */ $problem = $this->_problemFactory->create(); $problem->addSubscriberData($item); $problem->addQueueData($this); - $e = $sender->getSendingException(); - if ($e) { - $problem->addErrorData($e); - } + $problem->addErrorData($e); $problem->save(); - $item->received($this); } + $item->received($this); } if (count($collection->getItems()) < $count-1 || count($collection->getItems()) == 0) { diff --git a/app/code/Magento/Newsletter/Model/Queue/Options/Status.php b/app/code/Magento/Newsletter/Model/Queue/Options/Status.php index 151dc94891548..e086ed561b2bf 100644 --- a/app/code/Magento/Newsletter/Model/Queue/Options/Status.php +++ b/app/code/Magento/Newsletter/Model/Queue/Options/Status.php @@ -34,7 +34,7 @@ namespace Magento\Newsletter\Model\Queue\Options; -class Status implements \Magento\Core\Model\Option\ArrayInterface +class Status implements \Magento\Option\ArrayInterface { /** * Return statuses option array diff --git a/app/code/Magento/Newsletter/Model/Queue/TransportBuilder.php b/app/code/Magento/Newsletter/Model/Queue/TransportBuilder.php new file mode 100644 index 0000000000000..be0ac2f1159c8 --- /dev/null +++ b/app/code/Magento/Newsletter/Model/Queue/TransportBuilder.php @@ -0,0 +1,60 @@ +templateData = $data; + return $this; + } + + /** + * @inheritdoc + */ + protected function prepareMessage() + { + $template = $this->getTemplate()->setData($this->templateData); + + $this->message->setMessageType(\Magento\Mail\MessageInterface::TYPE_HTML) + ->setBody($template->getProcessedTemplate()) + ->setSubject($template->getSubject()); + + return $this; + } +} diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index 083eb89e18167..e35dc1cae0e20 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -31,17 +31,17 @@ * @method \Magento\Newsletter\Model\Resource\Subscriber _getResource() * @method \Magento\Newsletter\Model\Resource\Subscriber getResource() * @method int getStoreId() - * @method Subscriber setStoreId(int $value) + * @method $this setStoreId(int $value) * @method string getChangeStatusAt() - * @method Subscriber setChangeStatusAt(string $value) + * @method $this setChangeStatusAt(string $value) * @method int getCustomerId() - * @method Subscriber setCustomerId(int $value) + * @method $this setCustomerId(int $value) * @method string getSubscriberEmail() - * @method Subscriber setSubscriberEmail(string $value) + * @method $this setSubscriberEmail(string $value) * @method int getSubscriberStatus() - * @method Subscriber setSubscriberStatus(int $value) + * @method $this setSubscriberStatus(int $value) * @method string getSubscriberConfirmCode() - * @method Subscriber setSubscriberConfirmCode(string $value) + * @method $this setSubscriberConfirmCode(string $value) * * @category Magento * @package Magento_Newsletter @@ -49,19 +49,19 @@ */ class Subscriber extends \Magento\Core\Model\AbstractModel { - const STATUS_SUBSCRIBED = 1; - const STATUS_NOT_ACTIVE = 2; - const STATUS_UNSUBSCRIBED = 3; - const STATUS_UNCONFIRMED = 4; + const STATUS_SUBSCRIBED = 1; + const STATUS_NOT_ACTIVE = 2; + const STATUS_UNSUBSCRIBED = 3; + const STATUS_UNCONFIRMED = 4; - const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'newsletter/subscription/confirm_email_template'; - const XML_PATH_CONFIRM_EMAIL_IDENTITY = 'newsletter/subscription/confirm_email_identity'; - const XML_PATH_SUCCESS_EMAIL_TEMPLATE = 'newsletter/subscription/success_email_template'; - const XML_PATH_SUCCESS_EMAIL_IDENTITY = 'newsletter/subscription/success_email_identity'; - const XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE = 'newsletter/subscription/un_email_template'; - const XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY = 'newsletter/subscription/un_email_identity'; - const XML_PATH_CONFIRMATION_FLAG = 'newsletter/subscription/confirm'; - const XML_PATH_ALLOW_GUEST_SUBSCRIBE_FLAG = 'newsletter/subscription/allow_guest_subscribe'; + const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'newsletter/subscription/confirm_email_template'; + const XML_PATH_CONFIRM_EMAIL_IDENTITY = 'newsletter/subscription/confirm_email_identity'; + const XML_PATH_SUCCESS_EMAIL_TEMPLATE = 'newsletter/subscription/success_email_template'; + const XML_PATH_SUCCESS_EMAIL_IDENTITY = 'newsletter/subscription/success_email_identity'; + const XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE = 'newsletter/subscription/un_email_template'; + const XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY = 'newsletter/subscription/un_email_identity'; + const XML_PATH_CONFIRMATION_FLAG = 'newsletter/subscription/confirm'; + const XML_PATH_ALLOW_GUEST_SUBSCRIBE_FLAG = 'newsletter/subscription/allow_guest_subscribe'; /** * Prefix of model events names @@ -129,20 +129,18 @@ class Subscriber extends \Magento\Core\Model\AbstractModel protected $_customerFactory; /** - * Email template factory - * - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_emailTemplateFactory; + protected $_transportBuilder; /** * Construct * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Newsletter\Helper\Data $newsletterData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Email\Model\TemplateFactory $emailTemplateFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\TranslateInterface $translate @@ -152,11 +150,11 @@ class Subscriber extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Newsletter\Helper\Data $newsletterData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Email\Model\TemplateFactory $emailTemplateFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\TranslateInterface $translate, @@ -168,7 +166,7 @@ public function __construct( parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_newsletterData = $newsletterData; $this->_coreStoreConfig = $coreStoreConfig; - $this->_emailTemplateFactory = $emailTemplateFactory; + $this->_transportBuilder = $transportBuilder; $this->_customerFactory = $customerFactory; $this->_storeManager = $storeManager; $this->_translate = $translate; @@ -310,8 +308,8 @@ public function setEmail($value) */ public function setIsStatusChanged($value) { - $this->_isStatusChanged = (boolean) $value; - return $this; + $this->_isStatusChanged = (boolean)$value; + return $this; } /** @@ -331,7 +329,7 @@ public function getIsStatusChanged() */ public function isSubscribed() { - if ($this->getId() && $this->getStatus()==self::STATUS_SUBSCRIBED) { + if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) { return true; } @@ -364,7 +362,7 @@ public function loadByCustomer(\Magento\Customer\Model\Customer $customer) if (!empty($data) && $customer->getId() && !$this->getCustomerId()) { $this->setCustomerId($customer->getId()); $this->setSubscriberConfirmCode($this->randomSequence()); - if ($this->getStatus()==self::STATUS_NOT_ACTIVE) { + if ($this->getStatus() == self::STATUS_NOT_ACTIVE) { $this->setStatus($customer->getIsSubscribed() ? self::STATUS_SUBSCRIBED : self::STATUS_UNSUBSCRIBED); } $this->save(); @@ -378,16 +376,16 @@ public function loadByCustomer(\Magento\Customer\Model\Customer $customer) * @param int $length * @return string */ - public function randomSequence($length=32) + public function randomSequence($length = 32) { $id = ''; $par = array(); - $char = array_merge(range('a','z'), range(0,9)); - $charLen = count($char)-1; - for ($i=0; $i<$length; $i++){ + $char = array_merge(range('a', 'z'), range(0, 9)); + $charLen = count($char) - 1; + for ($i = 0; $i < $length; $i++) { $disc = mt_rand(0, $charLen); $par[$i] = $char[$disc]; - $id = $id.$char[$disc]; + $id = $id . $char[$disc]; } return $id; } @@ -407,7 +405,7 @@ public function subscribe($email) $this->setSubscriberConfirmCode($this->randomSequence()); } - $isConfirmNeed = ($this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRMATION_FLAG) == 1) ? true : false; + $isConfirmNeed = ($this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRMATION_FLAG) == 1) ? true : false; $isOwnSubscribes = false; $ownerId = $this->_customerFactory->create() ->setWebsiteId($this->_storeManager->getStore()->getWebsiteId()) @@ -523,7 +521,7 @@ public function subscribeCustomer($customer) */ $confirmation = null; if ($customer->isConfirmationRequired() && ($customer->getConfirmation() != $customer->getPassword())) { - $confirmation = $customer->getConfirmation(); + $confirmation = $customer->getConfirmation(); } $sendInformationEmail = false; @@ -583,7 +581,7 @@ public function subscribeCustomer($customer) */ public function confirm($code) { - if ($this->getCode()==$code) { + if ($this->getCode() == $code) { $this->setStatus(self::STATUS_SUBSCRIBED) ->setIsStatusChanged(true) ->save(); @@ -601,7 +599,7 @@ public function confirm($code) */ public function received(\Magento\Newsletter\Model\Queue $queue) { - $this->getResource()->received($this,$queue); + $this->getResource()->received($this, $queue); return $this; } @@ -616,27 +614,33 @@ public function sendConfirmationRequestEmail() return $this; } - if(!$this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_TEMPLATE) - || !$this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_IDENTITY) - ) { + if (!$this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_TEMPLATE) + || !$this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_IDENTITY) + ) { return $this; } + $translate = $this->_translate->getTranslateInline(); $this->_translate->setTranslateInline(false); - /** @var \Magento\Email\Model\Template $email */ - $email = $this->_emailTemplateFactory->create(); - - $email->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_IDENTITY), - $this->getEmail(), - $this->getName(), - array('subscriber'=>$this) - ); - - $this->_translate->setTranslateInline(true); - + $this->_transportBuilder + ->setTemplateIdentifier( + $this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_TEMPLATE) + ) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $this->_storeManager->getStore()->getId(), + )) + ->setTemplateVars(array( + 'subscriber' => $this, + 'store' => $this->_storeManager->getStore(), + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_CONFIRM_EMAIL_IDENTITY)) + ->addTo($this->getEmail(), $this->getName()); + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); + + $this->_translate->setTranslateInline($translate); return $this; } @@ -651,27 +655,30 @@ public function sendConfirmationSuccessEmail() return $this; } - if(!$this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE) - || !$this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY) + if (!$this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE) + || !$this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY) ) { return $this; } + $translate = $this->_translate->getTranslateInline(); $this->_translate->setTranslateInline(false); - /** @var \Magento\Email\Model\Template $email */ - $email = $this->_emailTemplateFactory->create(); - - $email->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY), - $this->getEmail(), - $this->getName(), - array('subscriber'=>$this) - ); - - $this->_translate->setTranslateInline(true); - + $this->_transportBuilder + ->setTemplateIdentifier( + $this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE) + ) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $this->_storeManager->getStore()->getId(), + )) + ->setTemplateVars(array('subscriber' => $this)) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY)) + ->addTo($this->getEmail(), $this->getName()); + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); + + $this->_translate->setTranslateInline($translate); return $this; } @@ -685,27 +692,32 @@ public function sendUnsubscriptionEmail() if ($this->getImportMode()) { return $this; } - if(!$this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE) - || !$this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY) + if (!$this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE) + || !$this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY) ) { return $this; } + $translate = $this->_translate->getTranslateInline(); $this->_translate->setTranslateInline(false); - /** @var \Magento\Email\Model\Template $email */ - $email = $this->_emailTemplateFactory->create(); - - $email->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY), - $this->getEmail(), - $this->getName(), - array('subscriber'=>$this) - ); - - $this->_translate->setTranslateInline(true); - + $this->_transportBuilder + ->setTemplateIdentifier( + $this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE) + ) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $this->_storeManager->getStore()->getId(), + )) + ->setTemplateVars(array('subscriber' => $this)) + ->setFrom( + $this->_coreStoreConfig->getConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY) + ) + ->addTo($this->getEmail(), $this->getName()); + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); + + $this->_translate->setTranslateInline($translate); return $this; } diff --git a/app/code/Magento/Newsletter/Model/Template.php b/app/code/Magento/Newsletter/Model/Template.php index 2b710a5c01ed2..a0d65f78754bb 100644 --- a/app/code/Magento/Newsletter/Model/Template.php +++ b/app/code/Magento/Newsletter/Model/Template.php @@ -113,9 +113,9 @@ class Template extends \Magento\Core\Model\Template protected $_filterManager; /** - * @param \Magento\Core\Model\Context $context + * @param \Magento\Model\Context $context * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\RequestInterface $request @@ -126,9 +126,9 @@ class Template extends \Magento\Core\Model\Template * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, + \Magento\Model\Context $context, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\RequestInterface $request, diff --git a/app/code/Magento/Ogone/Model/Api.php b/app/code/Magento/Ogone/Model/Api.php index ccc601ae58615..a043d7d48ca8a 100644 --- a/app/code/Magento/Ogone/Model/Api.php +++ b/app/code/Magento/Ogone/Model/Api.php @@ -223,7 +223,7 @@ class Api extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\UrlInterface $urlBuilder @@ -235,7 +235,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\LocaleInterface $locale, \Magento\UrlInterface $urlBuilder, diff --git a/app/code/Magento/Ogone/Model/Source/PaymentAction.php b/app/code/Magento/Ogone/Model/Source/PaymentAction.php index 3e1796abba3e1..8a30bd16d9edb 100644 --- a/app/code/Magento/Ogone/Model/Source/PaymentAction.php +++ b/app/code/Magento/Ogone/Model/Source/PaymentAction.php @@ -29,7 +29,7 @@ */ namespace Magento\Ogone\Model\Source; -class PaymentAction implements \Magento\Core\Model\Option\ArrayInterface +class PaymentAction implements \Magento\Option\ArrayInterface { /** * Prepare payment action list as optional array diff --git a/app/code/Magento/Ogone/Model/Source/Pmlist.php b/app/code/Magento/Ogone/Model/Source/Pmlist.php index a1e8aaf78b754..8188f40b6dc8b 100644 --- a/app/code/Magento/Ogone/Model/Source/Pmlist.php +++ b/app/code/Magento/Ogone/Model/Source/Pmlist.php @@ -29,7 +29,7 @@ */ namespace Magento\Ogone\Model\Source; -class Pmlist implements \Magento\Core\Model\Option\ArrayInterface +class Pmlist implements \Magento\Option\ArrayInterface { /** * Prepare ogone payment block layout as option array diff --git a/app/code/Magento/Ogone/Model/Source/Template.php b/app/code/Magento/Ogone/Model/Source/Template.php index 9a9a6e5af2363..f20386106699c 100644 --- a/app/code/Magento/Ogone/Model/Source/Template.php +++ b/app/code/Magento/Ogone/Model/Source/Template.php @@ -29,7 +29,7 @@ */ namespace Magento\Ogone\Model\Source; -class Template implements \Magento\Core\Model\Option\ArrayInterface +class Template implements \Magento\Option\ArrayInterface { /** * Prepare ogone template mode list as option array diff --git a/app/code/Magento/Ogone/i18n/de_DE.csv b/app/code/Magento/Ogone/i18n/de_DE.csv index 06e117a835115..c929fbab689c9 100644 --- a/app/code/Magento/Ogone/i18n/de_DE.csv +++ b/app/code/Magento/Ogone/i18n/de_DE.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Hintergrundfarbe des Ogone Templates" "Button Background Color of the Ogone Template","Schaltflächenhintergrundfarbe des Ogone Templates" "Button Text Color of the Ogone Template","Schaltflächentextfarbe des Ogone Templates" -"Can\'t detect Ogone payment action","Ogone Zahlungsvorgang konnte nicht erkannt werden" +"Can't detect Ogone payment action","Ogone Zahlungsvorgang konnte nicht erkannt werden" "Cancelled Ogone","Ogone wurde abgebrochen" "Debug","Fehlerbeseitigung" "Declined Ogone","Ogone wurde abgelehnt" @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Ogone Standard-Operation" -"Order can\'t save","Bestellung kann/nicht gespeichert werden" +"Order can't save","Bestellung kann/nicht gespeichert werden" "PSPID","PSPID" "Payment Action","Zahlungsaktion" "Payment Template","Zahlungs-Template" diff --git a/app/code/Magento/Ogone/i18n/en_US.csv b/app/code/Magento/Ogone/i18n/en_US.csv index 7b24fd640c504..8c59ccf0a8645 100644 --- a/app/code/Magento/Ogone/i18n/en_US.csv +++ b/app/code/Magento/Ogone/i18n/en_US.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Background Color of Ogone Template" "Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" "Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Can\'t detect Ogone payment action","Can\'t detect Ogone payment action" +"Can't detect Ogone payment action","Can't detect Ogone payment action" "Cancelled Ogone","Cancelled Ogone" "Debug","Debug" "Declined Ogone","Declined Ogone" @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Ogone Default Operation" -"Order can\'t save","Order can\'t save" +"Order can't save","Order can't save" "PSPID","PSPID" "Payment Action","Payment Action" "Payment Template","Payment Template" diff --git a/app/code/Magento/Ogone/i18n/es_ES.csv b/app/code/Magento/Ogone/i18n/es_ES.csv index 79fdb7b8a63ec..fdb268e408973 100644 --- a/app/code/Magento/Ogone/i18n/es_ES.csv +++ b/app/code/Magento/Ogone/i18n/es_ES.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Color de fondo del modelo de Ogone" "Button Background Color of the Ogone Template","Color de fondo del botón del modelo de Ogone" "Button Text Color of the Ogone Template","Color del texto del botón del modelo de Ogone" -"Can\'t detect Ogone payment action","No se puede detectar la acción de pago de Ogone" +"Can't detect Ogone payment action","No se puede detectar la acción de pago de Ogone" "Cancelled Ogone","Ogone cancelado" "Debug","Depurar" "Declined Ogone","Ogone rechazado" @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Operación por Defecto de Ogone" -"Order can\'t save","La solicitud no se puede archivar" +"Order can't save","La solicitud no se puede archivar" "PSPID","PSPID" "Payment Action","Acción de Pago" "Payment Template","Plantilla de Pago" diff --git a/app/code/Magento/Ogone/i18n/fr_FR.csv b/app/code/Magento/Ogone/i18n/fr_FR.csv index 3b851546de4f9..7826499919b6e 100644 --- a/app/code/Magento/Ogone/i18n/fr_FR.csv +++ b/app/code/Magento/Ogone/i18n/fr_FR.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Couleur de fond du modèle d'Ogone." "Button Background Color of the Ogone Template","Bouton de la couleur de fond du modèle d'Ogone." "Button Text Color of the Ogone Template","Bouton de la couleur du texte du modèle d'Ogone." -"Can\'t detect Ogone payment action","N'arrive pas à détecter le paiement par Ogone." +"Can't detect Ogone payment action","N'arrive pas à détecter le paiement par Ogone." "Cancelled Ogone","Ogone annulé." "Debug","Déboguer" "Declined Ogone","Ogone refusé." @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Opération par défaut Ogone" -"Order can\'t save","Impossible de sauvegarder commande" +"Order can't save","Impossible de sauvegarder commande" "PSPID","PSPID" "Payment Action","Action de paiement" "Payment Template","Modèle paiement" diff --git a/app/code/Magento/Ogone/i18n/nl_NL.csv b/app/code/Magento/Ogone/i18n/nl_NL.csv index 30ffa1f38adfb..fbd4aac676320 100644 --- a/app/code/Magento/Ogone/i18n/nl_NL.csv +++ b/app/code/Magento/Ogone/i18n/nl_NL.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Achtergrond kleur van het Ogone Sjabloon" "Button Background Color of the Ogone Template","Knop Achtergrond Kleur op het Ogone Sjabloon" "Button Text Color of the Ogone Template","Knop Tekst Kleur op het Ogone Sjabloon" -"Can\'t detect Ogone payment action","Kan Ogone Betalingsactie niet vinden" +"Can't detect Ogone payment action","Kan Ogone Betalingsactie niet vinden" "Cancelled Ogone","Ogone Geannuleerd" "Debug","Debug" "Declined Ogone","Ogone Afgewezen" @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Ogone Standaard Operatie" -"Order can\'t save","Bestelling kan niet opgeslagen worden" +"Order can't save","Bestelling kan niet opgeslagen worden" "PSPID","PSP ID" "Payment Action","Betaling" "Payment Template","Betaling Sjabloon" diff --git a/app/code/Magento/Ogone/i18n/pt_BR.csv b/app/code/Magento/Ogone/i18n/pt_BR.csv index 85cd9cb6eac43..6a7548de1b9b5 100644 --- a/app/code/Magento/Ogone/i18n/pt_BR.csv +++ b/app/code/Magento/Ogone/i18n/pt_BR.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Cor de Fundo de Modelo Ogone" "Button Background Color of the Ogone Template","Botão de Cor de Fundo do Modelo Ogone" "Button Text Color of the Ogone Template","Botão de Cor de Texto do Modelo Ogone" -"Can\'t detect Ogone payment action","Não é possível detetar a ação de pagamento Ogone" +"Can't detect Ogone payment action","Não é possível detetar a ação de pagamento Ogone" "Cancelled Ogone","Ogone Cancelada" "Debug","Debug" "Declined Ogone","Ogone Recusada" @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Operação Predifinida Ogone" -"Order can\'t save","Não pode salvar ordem" +"Order can't save","Não pode salvar ordem" "PSPID","PSPID" "Payment Action","Ação de Pagamento" "Payment Template","Modelo de Pagamento" diff --git a/app/code/Magento/Ogone/i18n/zh_CN.csv b/app/code/Magento/Ogone/i18n/zh_CN.csv index cc0261f2580cc..0ca9dbe20a0c1 100644 --- a/app/code/Magento/Ogone/i18n/zh_CN.csv +++ b/app/code/Magento/Ogone/i18n/zh_CN.csv @@ -4,7 +4,7 @@ "Background Color of Ogone Template","Ogone 模板的背景颜色" "Button Background Color of the Ogone Template","Ogone 模板的按钮背景颜色" "Button Text Color of the Ogone Template","Ogone 模板的的按钮文本颜色" -"Can\'t detect Ogone payment action","无法检测 Ogone 支付操作" +"Can't detect Ogone payment action","无法检测 Ogone 支付操作" "Cancelled Ogone","已取消 Ogone" "Debug","调试" "Declined Ogone","已拒绝 Ogone" @@ -30,7 +30,7 @@ "Magento","Magento" "Ogone","Ogone" "Ogone Default Operation","Ogone默认操作" -"Order can\'t save","订单无法保存" +"Order can't save","订单无法保存" "PSPID","PSPID" "Payment Action","支付操作" "Payment Template","支付模板" diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php b/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php index 39336b5f30e9a..a713a1765500e 100644 --- a/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php +++ b/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php @@ -1,5 +1,5 @@ -_getDefaultValues(); - $currentValue = $this->getValue(); - if(!$currentValue) { - $replaceValue = isset($data[$this->getField()]) ? $data[$this->getField()] : false; - $this->setValue($replaceValue); - } - return $this; - } - - /** - * Get Default Config Values - * - * @return array - */ - protected function _getDefaultValues() - { - if (!$this->defaultValues) { - $this->defaultValues = $this->_config->getValue('system/full_page_cache/default'); - } - return $this->defaultValues; - } - - /** - * If fields are empty fill them with default data - * - * @return $this|\Magento\Core\Model\AbstractModel - */ - protected function _afterLoad() - { - $data = $this->_getDefaultValues(); - $currentValue = $this->getValue(); - if(!$currentValue) { - foreach ($data as $field => $value) { - if(strstr($this->getPath(), $field)) { - $this->setValue($value); - $this->save(); - break; - } - } - } - return $this; - } + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\PageCache\Model\System\Config\Backend; + +/** + * Backend model for processing Varnish settings + * + * Class Varnish + * @package Magento\PageCache\Model\System\Config\Backend + */ +class Varnish extends \Magento\Core\Model\Config\Value +{ + /** + * @var array + */ + protected $defaultValues; + + /** + * Set default data if empty fields have been left + * + * @return $this|\Magento\Core\Model\AbstractModel + * @throws \Magento\Core\Exception + */ + protected function _beforeSave() + { + $data = $this->_getDefaultValues(); + $currentValue = $this->getValue(); + if(!$currentValue) { + $replaceValue = isset($data[$this->getField()]) ? $data[$this->getField()] : false; + $this->setValue($replaceValue); + } + return $this; + } + + /** + * Get Default Config Values + * + * @return array + */ + protected function _getDefaultValues() + { + if (!$this->defaultValues) { + $this->defaultValues = $this->_config->getValue('system/full_page_cache/default'); + } + return $this->defaultValues; + } + + /** + * If fields are empty fill them with default data + * + * @return $this|\Magento\Core\Model\AbstractModel + */ + protected function _afterLoad() + { + $data = $this->_getDefaultValues(); + $currentValue = $this->getValue(); + if(!$currentValue) { + foreach ($data as $field => $value) { + if(strstr($this->getPath(), $field)) { + $this->setValue($value); + $this->save(); + break; + } + } + } + return $this; + } } \ No newline at end of file diff --git a/app/code/Magento/PageCache/Model/System/Config/Source/Application.php b/app/code/Magento/PageCache/Model/System/Config/Source/Application.php index 5385933adc468..a0b015305afe5 100644 --- a/app/code/Magento/PageCache/Model/System/Config/Source/Application.php +++ b/app/code/Magento/PageCache/Model/System/Config/Source/Application.php @@ -1,5 +1,5 @@ - 0, 'label'=>__('Built-in Application')), - array('value' => 1, 'label'=>__('Varnish Caching')), - ); - } - - /** - * Get options in "key-value" format - * - * @return array - */ - public function toArray() - { - return array( - 0 => __('Built-in Application'), - 1 => __('Varnish Caching'), - ); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_PageCache + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Used in creating options for Caching Application config value selection + */ +namespace Magento\PageCache\Model\System\Config\Source; + +/** + * Class Application + * + * @package Magento\PageCache\Model\System\Config\Source + */ +class Application implements \Magento\Option\ArrayInterface +{ + /** + * Options getter + * + * @return array + */ + public function toOptionArray() + { + return array( + array('value' => 0, 'label'=>__('Built-in Application')), + array('value' => 1, 'label'=>__('Varnish Caching')), + ); + } + + /** + * Get options in "key-value" format + * + * @return array + */ + public function toArray() + { + return array( + 0 => __('Built-in Application'), + 1 => __('Varnish Caching'), + ); + } +} diff --git a/app/code/Magento/PageCache/view/adminhtml/page_cache_validation.phtml b/app/code/Magento/PageCache/view/adminhtml/page_cache_validation.phtml index 0c552a8d7cb6a..60810e648dc47 100644 --- a/app/code/Magento/PageCache/view/adminhtml/page_cache_validation.phtml +++ b/app/code/Magento/PageCache/view/adminhtml/page_cache_validation.phtml @@ -1,5 +1,5 @@ - - - - \ No newline at end of file diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index 752f6451b1a99..a261b15166710 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -237,6 +237,24 @@ public function getInfoBlockHtml(Info $info, $storeId) return $paymentBlockHtml; } + /** + * Retrieve available billing agreement methods + * + * @param mixed $store + * @param \Magento\Sales\Model\Quote $quote + * @return array + */ + public function getBillingAgreementMethods($store = null, $quote = null) + { + $result = array(); + foreach ($this->getStoreMethods($store, $quote) as $method) { + if ($method->canManageBillingAgreements()) { + $result[] = $method; + } + } + return $result; + } + /** * Get payment methods that implement recurring profilez management * diff --git a/app/code/Magento/Payment/Model/Config/Source/Allmethods.php b/app/code/Magento/Payment/Model/Config/Source/Allmethods.php index 2f2e64f815ead..501bd62b123ed 100644 --- a/app/code/Magento/Payment/Model/Config/Source/Allmethods.php +++ b/app/code/Magento/Payment/Model/Config/Source/Allmethods.php @@ -25,7 +25,7 @@ */ namespace Magento\Payment\Model\Config\Source; -class Allmethods implements \Magento\Core\Model\Option\ArrayInterface +class Allmethods implements \Magento\Option\ArrayInterface { /** * Payment data diff --git a/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php b/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php index 5cdb1435dd95d..e431af2792873 100644 --- a/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php +++ b/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php @@ -25,7 +25,7 @@ */ namespace Magento\Payment\Model\Config\Source; -class Allspecificcountries implements \Magento\Core\Model\Option\ArrayInterface +class Allspecificcountries implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Payment/Model/Config/Source/Cctype.php b/app/code/Magento/Payment/Model/Config/Source/Cctype.php index b40c33ab58b7c..e39845fc3da30 100644 --- a/app/code/Magento/Payment/Model/Config/Source/Cctype.php +++ b/app/code/Magento/Payment/Model/Config/Source/Cctype.php @@ -23,7 +23,7 @@ */ namespace Magento\Payment\Model\Config\Source; -class Cctype implements \Magento\Core\Model\Option\ArrayInterface +class Cctype implements \Magento\Option\ArrayInterface { /** * Payment config model diff --git a/app/code/Magento/Payment/Model/Info.php b/app/code/Magento/Payment/Model/Info.php index 248b7f5122cbc..e32334b508770 100644 --- a/app/code/Magento/Payment/Model/Info.php +++ b/app/code/Magento/Payment/Model/Info.php @@ -50,8 +50,8 @@ class Info extends \Magento\Core\Model\AbstractModel protected $_encryptor; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -59,8 +59,8 @@ class Info extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentData, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index b62232252ebc7..73b16b98802ba 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -50,8 +50,7 @@ abstract class AbstractMethod extends \Magento\Object const CHECK_USE_CHECKOUT = 4; const CHECK_USE_INTERNAL = 16; const CHECK_ORDER_TOTAL_MIN_MAX = 32; - const CHECK_RECURRING_PROFILES = 64; - const CHECK_ZERO_TOTAL = 128; + const CHECK_ZERO_TOTAL = 64; /** * @var string @@ -204,7 +203,7 @@ abstract class AbstractMethod extends \Magento\Object /** * Log adapter factory * - * @var \Magento\Core\Model\Log\AdapterFactory + * @var \Magento\Logger\AdapterFactory */ protected $_logAdapterFactory; @@ -214,14 +213,14 @@ abstract class AbstractMethod extends \Magento\Object * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, array $data = array() ) { parent::__construct($data); @@ -407,17 +406,6 @@ public function canUseForCurrency($currencyCode) return true; } - /** - * Whether can manage recurring profiles - * - * @return bool - */ - public function canManageRecurringProfiles() - { - return $this->_canManageRecurringProfiles - && ($this instanceof \Magento\Payment\Model\Recurring\Profile\MethodInterface); - } - /** * Retrieve payment method code * @@ -743,9 +731,6 @@ public function isAvailable($quote = null) 'quote' => $quote, )); - if ($checkResult->isAvailable && $quote) { - $checkResult->isAvailable = $this->isApplicableToQuote($quote, self::CHECK_RECURRING_PROFILES); - } return $checkResult->isAvailable; } @@ -787,16 +772,10 @@ public function isApplicableToQuote($quote, $checksBitMask) return false; } } - if ($checksBitMask & self::CHECK_RECURRING_PROFILES) { - if (!$this->canManageRecurringProfiles() && $quote->hasRecurringItems()) { - return false; - } - } + if ($checksBitMask & self::CHECK_ZERO_TOTAL) { $total = $quote->getBaseSubtotal() + $quote->getShippingAddress()->getBaseShippingAmount(); - if ($total < 0.0001 && $this->getCode() != 'free' - && !($this->canManageRecurringProfiles() && $quote->hasRecurringItems()) - ) { + if ($total < 0.0001 && $this->getCode() != 'free') { return false; } } diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index a5879aab1a281..89e220d11c99c 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -72,7 +72,7 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -83,7 +83,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Payment/Model/Method/Free.php b/app/code/Magento/Payment/Model/Method/Free.php index 5d7d192ec944a..c1c69af2a9b68 100644 --- a/app/code/Magento/Payment/Model/Method/Free.php +++ b/app/code/Magento/Payment/Model/Method/Free.php @@ -64,7 +64,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ @@ -72,7 +72,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { diff --git a/app/code/Magento/Payment/Model/Source/Cctype.php b/app/code/Magento/Payment/Model/Source/Cctype.php index 1ef747d47d050..98761ffa6e00c 100644 --- a/app/code/Magento/Payment/Model/Source/Cctype.php +++ b/app/code/Magento/Payment/Model/Source/Cctype.php @@ -26,7 +26,7 @@ /** * Payment CC Types Source Model */ -class Cctype implements \Magento\Core\Model\Option\ArrayInterface +class Cctype implements \Magento\Option\ArrayInterface { /** * Allowed CC types diff --git a/app/code/Magento/Payment/Model/Source/Invoice.php b/app/code/Magento/Payment/Model/Source/Invoice.php index c0b8856366a3e..510067e752e87 100644 --- a/app/code/Magento/Payment/Model/Source/Invoice.php +++ b/app/code/Magento/Payment/Model/Source/Invoice.php @@ -30,7 +30,7 @@ * * @author Magento Core Team */ -class Invoice implements \Magento\Core\Model\Option\ArrayInterface +class Invoice implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Payment/etc/payment.xsd b/app/code/Magento/Payment/etc/payment.xsd index e509452511a4d..d42eded6b56f0 100644 --- a/app/code/Magento/Payment/etc/payment.xsd +++ b/app/code/Magento/Payment/etc/payment.xsd @@ -108,6 +108,7 @@ + diff --git a/app/code/Magento/Payment/etc/payment_file.xsd b/app/code/Magento/Payment/etc/payment_file.xsd index 16387cb919fdc..96ef0ab264587 100644 --- a/app/code/Magento/Payment/etc/payment_file.xsd +++ b/app/code/Magento/Payment/etc/payment_file.xsd @@ -108,6 +108,7 @@ + diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php index dc3bd621092bc..50d80e8e1cf5b 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php @@ -21,17 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Billing; /** * Adminhtml billing agreement grid container */ -namespace Magento\Paypal\Block\Adminhtml\Billing; - class Agreement extends \Magento\Backend\Block\Widget\Grid\Container { /** * Initialize billing agreements grid container * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php index b7f3db356c1e7..a308753a1b89c 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement; /** * Adminhtml billing agreements grid */ -namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement; - class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { /** @@ -68,6 +67,8 @@ public function __construct( /** * Set grid params + * + * @return void */ protected function _construct() { @@ -103,7 +104,7 @@ public function getRowUrl($item) /** * Prepare collection for grid * - * @return \Magento\Backend\Block\Widget\Grid\Extended + * @return $this */ protected function _prepareCollection() { @@ -117,7 +118,7 @@ protected function _prepareCollection() /** * Add columns to grid * - * @return \Magento\Backend\Block\Widget\Grid\Extended + * @return $this */ protected function _prepareColumns() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php index ce8b172558d67..ba5eef96bcc2d 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php @@ -21,29 +21,28 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement; /** * Adminhtml billing agreement view */ -namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement; - class View extends \Magento\Backend\Block\Widget\Form\Container { /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; @@ -53,6 +52,7 @@ public function __construct( /** * Initialize view container * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php index 46754f0d85bb0..1fa557a2712ae 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php @@ -21,13 +21,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View; /** * Adminhtml billing agreement view plane */ -namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View; - class Form extends \Magento\Backend\Block\Template { + /** + * @var string + */ protected $_template = 'billing/agreement/view/form.phtml'; } diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index c1e4c82731357..a9c0b1cc8f0f1 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -21,36 +21,42 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Tab; /** * Adminhtml billing agreement info tab */ -namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Tab; - class Info extends \Magento\Backend\Block\Template implements \Magento\Backend\Block\Widget\Tab\TabInterface { + /** + * @var string + */ protected $_template = 'billing/agreement/view/tab/info.phtml'; /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - /** @var \Magento\Customer\Service\V1\CustomerServiceInterface */ + /** + * Customer service + * + * @var \Magento\Customer\Service\V1\CustomerServiceInterface + */ protected $_customerService; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Service\V1\CustomerServiceInterface $customerService * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Service\V1\CustomerServiceInterface $customerService, array $data = array() ) { @@ -60,9 +66,7 @@ public function __construct( } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -70,9 +74,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -80,9 +82,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -90,9 +90,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php index 7911cfeff529d..c34e47fbcd5ab 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Tab; /** * Adminhtml billing agreement related orders tab */ -namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Tab; - class Orders extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { @@ -34,6 +33,7 @@ class Orders extends \Magento\View\Element\Text\ListText /** * Initialize grid params * + * @return void */ protected function _construct() { @@ -42,9 +42,7 @@ protected function _construct() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -52,9 +50,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -62,9 +58,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -72,9 +66,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php index 15be5c97f6737..e9813c9f816bc 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php @@ -32,6 +32,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Initialize tab * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index cd7fa4af34ab1..340a5346317ce 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab; /** * Adminhtml customer billing agreement tab */ -namespace Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab; - class Agreement extends \Magento\Paypal\Block\Adminhtml\Billing\Agreement\Grid implements \Magento\Backend\Block\Widget\Tab\TabInterface @@ -41,7 +40,7 @@ class Agreement /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,7 +50,7 @@ class Agreement * @param \Magento\Paypal\Helper\Data $helper * @param \Magento\Paypal\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory * @param \Magento\Paypal\Model\Billing\Agreement $agreementModel - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -60,7 +59,7 @@ public function __construct( \Magento\Paypal\Helper\Data $helper, \Magento\Paypal\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory, \Magento\Paypal\Model\Billing\Agreement $agreementModel, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; @@ -77,6 +76,7 @@ public function __construct( /** * Disable filters and paging * + * @return void */ protected function _construct() { @@ -85,9 +85,7 @@ protected function _construct() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -95,9 +93,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -105,9 +101,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -116,15 +110,18 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { return false; } + /** + * Get grid url + * + * @return string + */ public function getGridUrl() { return $this->getUrl('paypal/billing_agreement/customerGrid', array('_current' => true)); @@ -143,7 +140,7 @@ public function getAfter() /** * Prepare collection for grid * - * @return \Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement + * @return $this */ protected function _prepareCollection() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php index 6ee56c7c4a5e2..afe7594ef5a2f 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Settlement; /** * Settlement reports transaction details @@ -31,13 +32,13 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Adminhtml\Settlement; - class Details extends \Magento\Backend\Block\Widget\Form\Container { /** * Block construction * Initialize titles, buttons + * + * @return void */ protected function _construct() { @@ -51,7 +52,8 @@ protected function _construct() /** * Initialize form - * @return \Magento\Paypal\Block\Adminhtml\Settlement\Details + * + * @return $this */ protected function _prepareLayout() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php index 96a1c88accd0c..7f350911fa911 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Settlement\Details; /** * Settlement reports transaction details */ -namespace Magento\Paypal\Block\Adminhtml\Settlement\Details; - class Form extends \Magento\Backend\Block\Widget\Form\Generic { /** @@ -38,14 +37,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Paypal\Model\Report\Settlement $settlement * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Paypal\Model\Report\Settlement $settlement, array $data = array() @@ -57,7 +56,7 @@ public function __construct( /** * Prepare read-only data and group it by fieldsets * - * @return \Magento\Paypal\Block\Adminhtml\Settlement\Details\Form + * @return $this */ protected function _prepareForm() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php index 542168d144df0..19903cb705b11 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\Settlement; /** * Adminhtml paypal settlement reports grid block @@ -31,12 +32,12 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Adminhtml\Settlement; - class Report extends \Magento\Backend\Block\Widget\Grid\Container { /** * Prepare grid container, add additional buttons + * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php index bceab1726f7d4..b2b3735a09e8e 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php @@ -23,16 +23,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\System\Config; /** * Custom renderer for PayPal API credentials wizard popup */ -namespace Magento\Paypal\Block\Adminhtml\System\Config; - class ApiWizard extends \Magento\Backend\Block\System\Config\Form\Field { /** * Set template to itself + * + * @return $this */ protected function _prepareLayout() { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php index e0b4eb1dcdab5..d7a0c3b4a5df6 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php @@ -23,12 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; + +use Magento\Data\Form\Element\AbstractElement; /** * Fieldset renderer which expanded by default */ -namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; - class Expanded extends \Magento\Backend\Block\System\Config\Form\Fieldset { @@ -50,8 +51,8 @@ public function __construct( /** * Return collapse state * - * @param \Magento\Data\Form\Element\AbstractElement $element - * @return bool + * @param AbstractElement $element + * @return string|true */ protected function _isCollapseState($element) { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php index 028de2201dfd6..1b2efae6b2b30 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php @@ -23,18 +23,19 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; /** * Renderer for PayPal banner in System Configuration * @author Magento Core Team */ -namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; - class Hint extends \Magento\Backend\Block\Template implements \Magento\Data\Form\Element\Renderer\RendererInterface { + /** + * @var string + */ protected $_template = 'Magento_Paypal::system/config/fieldset/hint.phtml'; /** diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php index b7aaecb80fdb1..e113b72110188 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; /** * Fieldset renderer for PayPal solution */ -namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; - class Payment extends \Magento\Backend\Block\System\Config\Form\Fieldset { @@ -147,7 +146,7 @@ protected function _getHeaderCommentHtml($element) * Get collapsed state on-load * * @param \Magento\Data\Form\Element\AbstractElement $element - * @return bool + * @return false */ protected function _isCollapseState($element) { diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php index 2e94c2a912301..a93bc8e3b1472 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php @@ -23,14 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; /** * Renderer for service JavaScript code that disables corresponding paypal methods on page load * @author Magento Core Team */ -namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; - class Store extends \Magento\Backend\Block\Template implements \Magento\Data\Form\Element\Renderer\RendererInterface diff --git a/app/code/Magento/Paypal/Block/Billing/Agreement/View.php b/app/code/Magento/Paypal/Block/Billing/Agreement/View.php index f20d35f33111f..411963879ea42 100644 --- a/app/code/Magento/Paypal/Block/Billing/Agreement/View.php +++ b/app/code/Magento/Paypal/Block/Billing/Agreement/View.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Billing\Agreement; /** * Customer account billing agreement view block */ -namespace Magento\Paypal\Block\Billing\Agreement; - class View extends \Magento\View\Element\Template { /** @@ -53,7 +52,7 @@ class View extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -84,7 +83,7 @@ class View extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\Order\Config $orderConfig @@ -94,7 +93,7 @@ class View extends \Magento\View\Element\Template */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig, @@ -176,7 +175,7 @@ public function getOrderItemValue(\Magento\Sales\Model\Order $order, $key) /** * Set pager * - * @return \Magento\View\Element\AbstractBlock + * @return $this */ protected function _prepareLayout() { diff --git a/app/code/Magento/Paypal/Block/Billing/Agreements.php b/app/code/Magento/Paypal/Block/Billing/Agreements.php index 6499e65e1dbe4..0219986c4e5a8 100644 --- a/app/code/Magento/Paypal/Block/Billing/Agreements.php +++ b/app/code/Magento/Paypal/Block/Billing/Agreements.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Billing; /** * Customer account billing agreements block */ -namespace Magento\Paypal\Block\Billing; - class Agreements extends \Magento\View\Element\Template { /** @@ -82,7 +81,7 @@ public function __construct( /** * Set Billing Agreement instance * - * @return \Magento\View\Element\AbstractBlock + * @return $this */ protected function _prepareLayout() { @@ -115,7 +114,7 @@ public function getBillingAgreements() * * @param \Magento\Object|\Magento\Paypal\Model\Billing\Agreement $item * @param string $key - * @return mixed + * @return string */ public function getItemValue(\Magento\Paypal\Model\Billing\Agreement $item, $key) { diff --git a/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php b/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php index 0ddb101ff7627..8d56313eed864 100644 --- a/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php +++ b/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Checkout\Onepage\Success; /** * Billing agreement information on Order success page */ -namespace Magento\Paypal\Block\Checkout\Onepage\Success; - class BillingAgreement extends \Magento\View\Element\Template { /** diff --git a/app/code/Magento/Paypal/Block/Express/Form.php b/app/code/Magento/Paypal/Block/Express/Form.php index b3c2244424326..1ae0f7cf99b91 100644 --- a/app/code/Magento/Paypal/Block/Express/Form.php +++ b/app/code/Magento/Paypal/Block/Express/Form.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Express; /** * PayPal Standard payment "form" */ -namespace Magento\Paypal\Block\Express; - class Form extends \Magento\Paypal\Block\Standard\Form { /** @@ -72,6 +71,8 @@ public function __construct( /** * Set template and redirect message + * + * @return null */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Express/Review.php b/app/code/Magento/Paypal/Block/Express/Review.php index 236a8ab7f1305..9e35187d13528 100644 --- a/app/code/Magento/Paypal/Block/Express/Review.php +++ b/app/code/Magento/Paypal/Block/Express/Review.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Express; /** * Paypal Express Onepage checkout block @@ -31,8 +32,6 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Express; - class Review extends \Magento\View\Element\Template { /** @@ -77,7 +76,7 @@ public function __construct( * Quote object setter * * @param \Magento\Sales\Model\Quote $quote - * @return \Magento\Paypal\Block\Express\Review + * @return $this */ public function setQuote(\Magento\Sales\Model\Quote $quote) { @@ -98,7 +97,7 @@ public function getBillingAddress() /** * Return quote shipping address * - * @return \Magento\Sales\Model\Quote\Address + * @return false|\Magento\Sales\Model\Quote\Address */ public function getShippingAddress() { @@ -188,6 +187,9 @@ public function getCurrentShippingRate() /** * Set controller path + * + * @param string $prefix + * @return void */ public function setControllerPath($prefix) { @@ -199,8 +201,7 @@ public function setControllerPath($prefix) * * @param float $price * @param bool $isInclTax - * - * @return bool + * @return string */ protected function _getShippingPrice($price, $isInclTax) { @@ -227,7 +228,7 @@ protected function _formatPrice($price) /** * Retrieve payment method and assign additional template values * - * @return \Magento\Paypal\Block\Express\Review + * @return $this */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Paypal/Block/Express/Review/Details.php b/app/code/Magento/Paypal/Block/Express/Review/Details.php index b5d6c84e9d680..b398c75f72257 100644 --- a/app/code/Magento/Paypal/Block/Express/Review/Details.php +++ b/app/code/Magento/Paypal/Block/Express/Review/Details.php @@ -23,6 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Express\Review; + +use Magento\Sales\Model\Order\Address; /** * Paypal Express Onepage checkout block @@ -31,16 +34,17 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Express\Review; - class Details extends \Magento\Checkout\Block\Cart\Totals { + /** + * @var Address + */ protected $_address; /** * Return review shipping address * - * @return \Magento\Sales\Model\Order\Address + * @return Address */ public function getAddress() { diff --git a/app/code/Magento/Paypal/Block/Express/Shortcut.php b/app/code/Magento/Paypal/Block/Express/Shortcut.php index 57070b764b611..b914787ad4fe3 100644 --- a/app/code/Magento/Paypal/Block/Express/Shortcut.php +++ b/app/code/Magento/Paypal/Block/Express/Shortcut.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Paypal express checkout shortcut link - */ namespace Magento\Paypal\Block\Express; use Magento\Catalog\Block as CatalogBlock; +/** + * Paypal express checkout shortcut link + */ class Shortcut extends \Magento\View\Element\Template implements CatalogBlock\ShortcutInterface { /** @@ -64,7 +63,7 @@ class Shortcut extends \Magento\View\Element\Template implements CatalogBlock\Sh /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -116,20 +115,20 @@ class Shortcut extends \Magento\View\Element\Template implements CatalogBlock\Sh * @param \Magento\View\Element\Template\Context $context * @param \Magento\Paypal\Helper\Data $paypalData * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Paypal\Model\ConfigFactory $paypalConfigFactory - * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory * @param \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig + * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Paypal\Helper\Data $paypalData, \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Paypal\Model\ConfigFactory $paypalConfigFactory, \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory, diff --git a/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php b/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php index dac39e3c92c1b..d462ae99e7bfb 100644 --- a/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php +++ b/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Hosted\Pro; /** * Hosted Pro link form @@ -31,9 +32,10 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Hosted\Pro; - class Form extends \Magento\Payment\Block\Form { + /** + * @var string + */ protected $_template = 'hss/info.phtml'; } diff --git a/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php b/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php index fce9ab8990635..7d0b48ead009b 100644 --- a/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php +++ b/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Hosted\Pro; /** * Hosted Pro iframe block @@ -31,14 +32,13 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Hosted\Pro; - class Iframe extends \Magento\Paypal\Block\Iframe { /** * Internal constructor * Set payment method code * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index 4dda948abb7c7..9ab18e413b2fe 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block; /** * HSS iframe block */ -namespace Magento\Paypal\Block; - class Iframe extends \Magento\Payment\Block\Form { /** @@ -102,6 +101,8 @@ public function __construct( /** * Internal constructor + * + * @return void */ protected function _construct() { @@ -128,7 +129,7 @@ protected function _construct() /** * Get current block instance * - * @return \Magento\Paypal\Block\Iframe + * @return \Magento\Payment\Block\Form * @throws \Magento\Core\Exception */ protected function _getBlock() diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php index fd8c82a3c1785..c8b009e7efa5a 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php +++ b/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payflow\Advanced; /** * Payflow Advanced iframe block @@ -31,10 +32,11 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Payflow\Advanced; - class Form extends \Magento\Paypal\Block\Payflow\Link\Form { + /** + * @var string + */ protected $_template = 'payflowadvanced/info.phtml'; /** diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php index 73d52d4b8e96f..297f8cfef5d0a 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php +++ b/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payflow\Advanced; /** * Payflow Advanced iframe block @@ -31,12 +32,12 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Payflow\Advanced; - class Iframe extends \Magento\Paypal\Block\Payflow\Link\Iframe { /** * Set payment method code + * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Form.php b/app/code/Magento/Paypal/Block/Payflow/Link/Form.php index 616347ae9fe34..4cbd4e011e40e 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Form.php +++ b/app/code/Magento/Paypal/Block/Payflow/Link/Form.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payflow\Link; /** * Payflow link iframe block @@ -31,10 +32,11 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Block\Payflow\Link; - class Form extends \Magento\Payment\Block\Form { + /** + * @var string + */ protected $_template = 'payflowlink/info.phtml'; /** diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php index a741cbc6c3598..7081200d646e4 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php +++ b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payflow\Link; /** * Payflow link iframe block */ -namespace Magento\Paypal\Block\Payflow\Link; - class Iframe extends \Magento\Paypal\Block\Iframe { /** @@ -60,6 +59,8 @@ public function __construct( /** * Set payment method code + * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Block/Payment/Form/Billing/Agreement.php b/app/code/Magento/Paypal/Block/Payment/Form/Billing/Agreement.php index ad2caa847ca9c..2e76715872319 100644 --- a/app/code/Magento/Paypal/Block/Payment/Form/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Block/Payment/Form/Billing/Agreement.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payment\Form\Billing; /** * Paypal Billing Agreement form block */ -namespace Magento\Paypal\Block\Payment\Form\Billing; - class Agreement extends \Magento\Payment\Block\Form { /** @@ -54,6 +53,9 @@ public function __construct( $this->_isScopePrivate = true; } + /** + * @return void + */ protected function _construct() { parent::_construct(); @@ -71,12 +73,13 @@ protected function _construct() public function getBillingAgreements() { $data = array(); + /** @var \Magento\Sales\Model\Quote $quote */ $quote = $this->getParentBlock()->getQuote(); - if (!$quote || !$quote->getCustomer()) { + if (!$quote || !$quote->getCustomerId()) { return $data; } $collection = $this->_agreementFactory->create()->getAvailableCustomerBillingAgreements( - $quote->getCustomer()->getId() + $quote->getCustomerId() ); foreach ($collection as $item) { diff --git a/app/code/Magento/Paypal/Block/Payment/Info.php b/app/code/Magento/Paypal/Block/Payment/Info.php index 888c0722e41c8..c1eaf7aa42355 100644 --- a/app/code/Magento/Paypal/Block/Payment/Info.php +++ b/app/code/Magento/Paypal/Block/Payment/Info.php @@ -23,13 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payment; /** * PayPal common payment info block * Uses default templates */ -namespace Magento\Paypal\Block\Payment; - class Info extends \Magento\Payment\Block\Info\Cc { /** @@ -68,7 +67,7 @@ public function getCcTypeName() /** * Prepare PayPal-specific payment information * - * @param \Magento\Object|array $transport + * @param \Magento\Object|array|null $transport * @return \Magento\Object */ protected function _prepareSpecificInformation($transport = null) diff --git a/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php b/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php index 3fb2538d7c449..1e7831893f234 100644 --- a/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Payment\Info\Billing; /** * Billing Agreement info block */ -namespace Magento\Paypal\Block\Payment\Info\Billing; - class Agreement extends \Magento\Payment\Block\Info { /** diff --git a/app/code/Magento/Paypal/Block/Standard/Form.php b/app/code/Magento/Paypal/Block/Standard/Form.php index 0305824b869a8..d40bf40ef345d 100644 --- a/app/code/Magento/Paypal/Block/Standard/Form.php +++ b/app/code/Magento/Paypal/Block/Standard/Form.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Block\Standard; /** * PayPal Standard payment "form" */ -namespace Magento\Paypal\Block\Standard; - class Form extends \Magento\Payment\Block\Form { /** @@ -65,6 +64,8 @@ public function __construct( /** * Set template and redirect message + * + * @return null */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php index 8ee9d36e99ab0..262896a1bd13a 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php @@ -21,28 +21,27 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller\Adminhtml\Billing; /** * Adminhtml billing agreement controller */ -namespace Magento\Paypal\Controller\Adminhtml\Billing; - class Agreement extends \Magento\Backend\App\Action { /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); @@ -51,6 +50,7 @@ public function __construct( /** * Billing agreements * + * @return void */ public function indexAction() { @@ -64,6 +64,7 @@ public function indexAction() /** * Ajax action for billing agreements * + * @return void */ public function gridAction() { @@ -74,6 +75,7 @@ public function gridAction() /** * View billing agreement action * + * @return void */ public function viewAction() { @@ -96,6 +98,7 @@ public function viewAction() /** * Related orders ajax action * + * @return void */ public function ordersGridAction() { @@ -107,6 +110,7 @@ public function ordersGridAction() /** * Customer billing agreements ajax action * + * @return void */ public function customerGridAction() { @@ -118,6 +122,7 @@ public function customerGridAction() /** * Cancel billing agreement action * + * @return void */ public function cancelAction() { @@ -142,6 +147,8 @@ public function cancelAction() /** * Delete billing agreement action + * + * @return void */ public function deleteAction() { @@ -167,7 +174,7 @@ public function deleteAction() /** * Initialize billing agreement by ID specified in request * - * @return \Magento\Paypal\Model\Billing\Agreement | false + * @return \Magento\Paypal\Model\Billing\Agreement|false */ protected function _initBillingAgreement() { @@ -186,7 +193,7 @@ protected function _initBillingAgreement() /** * Initialize customer by ID specified in request * - * @return \Magento\Paypal\Controller\Adminhtml\Billing\Agreement + * @return $this */ protected function _initCustomer() { diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php index 82366058aa377..194d556f0046b 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php @@ -23,18 +23,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller\Adminhtml\Paypal; /** * PayPal Settlement Reports Controller */ -namespace Magento\Paypal\Controller\Adminhtml\Paypal; - class Reports extends \Magento\Backend\App\Action { /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -55,14 +54,14 @@ class Reports extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Paypal\Model\Report\Settlement\RowFactory $rowFactory * @param \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory * @param \Magento\Logger $logger */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Paypal\Model\Report\Settlement\RowFactory $rowFactory, \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory, \Magento\Logger $logger @@ -76,6 +75,8 @@ public function __construct( /** * Grid action + * + * @return void */ public function indexAction() { @@ -85,6 +86,8 @@ public function indexAction() /** * Ajax callback for grid actions + * + * @return void */ public function gridAction() { @@ -94,6 +97,8 @@ public function gridAction() /** * View transaction details action + * + * @return void */ public function detailsAction() { @@ -116,6 +121,7 @@ public function detailsAction() /** * Forced fetch reports action * + * @return void * @throws \Magento\Core\Exception */ public function fetchAction() @@ -153,7 +159,8 @@ public function fetchAction() /** * Initialize titles, navigation - * @return \Magento\Paypal\Controller\Adminhtml\Paypal\Reports + * + * @return $this */ protected function _initAction() { @@ -168,6 +175,7 @@ protected function _initAction() /** * ACL check + * * @return bool */ protected function _isAllowed() diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement.php b/app/code/Magento/Paypal/Controller/Billing/Agreement.php index 3f5c76023cf26..56e8e275f3b94 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement.php @@ -21,20 +21,19 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Billing agreements controller - */ namespace Magento\Paypal\Controller\Billing; use Magento\App\RequestInterface; +/** + * Billing agreements controller + */ class Agreement extends \Magento\App\Action\Action { /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -45,12 +44,12 @@ class Agreement extends \Magento\App\Action\Action /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\Action\Title $title */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\Action\Title $title ) { $this->_coreRegistry = $coreRegistry; @@ -61,6 +60,7 @@ public function __construct( /** * View billing agreements * + * @return void */ public function indexAction() { @@ -90,6 +90,7 @@ public function dispatch(RequestInterface $request) /** * View billing agreement * + * @return void */ public function viewAction() { @@ -110,6 +111,7 @@ public function viewAction() /** * Wizard start action * + * @return \Zend_Controller_Response_Abstract */ public function startWizardAction() { @@ -139,6 +141,7 @@ public function startWizardAction() /** * Wizard return action * + * @return void */ public function returnWizardAction() { @@ -171,6 +174,7 @@ public function returnWizardAction() /** * Wizard cancel action * + * @return void */ public function cancelWizardAction() { @@ -181,6 +185,7 @@ public function cancelWizardAction() * Cancel action * Set billing agreement status to 'Canceled' * + * @return void */ public function cancelAction() { @@ -207,7 +212,7 @@ public function cancelAction() /** * Init billing agreement model from request * - * @return \Magento\Paypal\Model\Billing\Agreement|bool + * @return \Magento\Paypal\Model\Billing\Agreement|false */ protected function _initAgreement() { diff --git a/app/code/Magento/Paypal/Controller/Express.php b/app/code/Magento/Paypal/Controller/Express.php index 93b36b0b8c756..deffdffc937b7 100644 --- a/app/code/Magento/Paypal/Controller/Express.php +++ b/app/code/Magento/Paypal/Controller/Express.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller; /** * Express Checkout Controller */ -namespace Magento\Paypal\Controller; - class Express extends \Magento\Paypal\Controller\Express\AbstractExpress { /** @@ -100,6 +99,8 @@ public function __construct( /** * Redirect to login page + * + * @return void */ public function redirectLogin() { diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php index 1c72c05f8a38a..867ef9aa716f4 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Paypal\Controller\Express; /** @@ -135,6 +134,8 @@ public function __construct( /** * Start Express Checkout by requesting initial token and dispatching customer to PayPal + * + * @return void */ public function startAction() { @@ -188,6 +189,8 @@ public function startAction() /** * Return shipping options items for shipping address from request + * + * @return void */ public function shippingOptionsCallbackAction() { @@ -204,6 +207,8 @@ public function shippingOptionsCallbackAction() /** * Cancel Express Checkout + * + * @return void */ public function cancelAction() { @@ -236,6 +241,8 @@ public function cancelAction() /** * Return from PayPal and dispatch customer to order review page + * + * @return void */ public function returnAction() { @@ -255,6 +262,8 @@ public function returnAction() /** * Review order after returning from PayPal + * + * @return void */ public function reviewAction() { @@ -284,6 +293,8 @@ public function reviewAction() /** * Dispatch customer back to PayPal for editing payment information + * + * @return void */ public function editAction() { @@ -297,6 +308,8 @@ public function editAction() /** * Update shipping method (combined action for ajax and regular request) + * + * @return void */ public function saveShippingMethodAction() { @@ -327,6 +340,8 @@ public function saveShippingMethodAction() /** * Update Order (combined action for ajax and regular request) + * + * @return void */ public function updateShippingMethodsAction() { @@ -351,6 +366,8 @@ public function updateShippingMethodsAction() /** * Update Order (combined action for ajax and regular request) + * + * @return void */ public function updateOrderAction() { @@ -382,6 +399,7 @@ public function updateOrderAction() /** * Submit the order * + * @return void * @throws \Magento\Core\Exception */ public function placeOrderAction() @@ -414,15 +432,9 @@ public function placeOrderAction() ->setLastRealOrderId($order->getIncrementId()); } - // recurring profiles may be created along with the order or without it - $profiles = $this->_checkout->getRecurringPaymentProfiles(); - if ($profiles) { - $ids = array(); - foreach ($profiles as $profile) { - $ids[] = $profile->getId(); - } - $this->_getCheckoutSession()->setLastRecurringProfileIds($ids); - } + $this->_eventManager->dispatch('paypal_express_place_order_success', [ + 'order' => $order, 'quote' => $this->_getQuote() + ]); // redirect if PayPal specified some URL (for example, to Giropay bank) $url = $this->_checkout->getRedirectUrl(); @@ -445,6 +457,7 @@ public function placeOrderAction() /** * Instantiate quote and checkout * + * @return void * @throws \Magento\Core\Exception */ private function _initCheckout() @@ -471,7 +484,7 @@ private function _initCheckout() * Search for proper checkout token in request or session or (un)set specified one * Combined getter/setter * - * @param string $setToken + * @param string|null $setToken * @return \Magento\Paypal\Controller\Express|string * @throws \Magento\Core\Exception */ @@ -536,6 +549,7 @@ private function _getQuote() /** * Redirect to login page * + * @return void */ public function redirectLogin() { diff --git a/app/code/Magento/Paypal/Controller/Hostedpro.php b/app/code/Magento/Paypal/Controller/Hostedpro.php index e31a672da7ba1..b37bbb9b73a4b 100644 --- a/app/code/Magento/Paypal/Controller/Hostedpro.php +++ b/app/code/Magento/Paypal/Controller/Hostedpro.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller; /** * Hosted Pro Checkout Controller @@ -29,12 +30,12 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Controller; - class Hostedpro extends \Magento\App\Action\Action { /** * When a customer return to website from gateway. + * + * @return void */ public function returnAction() { @@ -47,6 +48,8 @@ public function returnAction() /** * When a customer cancel payment from gateway. + * + * @return void */ public function cancelAction() { @@ -62,7 +65,7 @@ public function cancelAction() * Cancel order, return quote to customer * * @param string $errorMsg - * @return mixed + * @return false|string */ protected function _cancelPayment($errorMsg = '') { diff --git a/app/code/Magento/Paypal/Controller/Ipn.php b/app/code/Magento/Paypal/Controller/Ipn.php index 3d7e98735b2d0..a1e97038ca369 100644 --- a/app/code/Magento/Paypal/Controller/Ipn.php +++ b/app/code/Magento/Paypal/Controller/Ipn.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller; /** * Unified IPN controller for all supported PayPal methods */ -namespace Magento\Paypal\Controller; - class Ipn extends \Magento\App\Action\Action { /** @@ -48,6 +47,7 @@ class Ipn extends \Magento\App\Action\Action * @param \Magento\App\Action\Context $context * @param \Magento\Paypal\Model\IpnFactory $ipnFactory * @param \Magento\HTTP\Adapter\CurlFactory $curlFactory + * @param \Magento\Logger $logger */ public function __construct( \Magento\App\Action\Context $context, @@ -63,6 +63,8 @@ public function __construct( /** * Instantiate IPN model and pass IPN request to it + * + * @return void */ public function indexAction() { diff --git a/app/code/Magento/Paypal/Controller/Payflow.php b/app/code/Magento/Paypal/Controller/Payflow.php index a2752e33ebda0..95fef0c34cf6a 100644 --- a/app/code/Magento/Paypal/Controller/Payflow.php +++ b/app/code/Magento/Paypal/Controller/Payflow.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller; /** * Payflow Checkout Controller */ -namespace Magento\Paypal\Controller; - class Payflow extends \Magento\App\Action\Action { /** @@ -60,6 +59,7 @@ class Payflow extends \Magento\App\Action\Action * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Paypal\Model\PayflowlinkFactory $payflowlinkFactory * @param \Magento\Paypal\Helper\Checkout $checkoutHelper + * @param \Magento\Logger $logger */ public function __construct( \Magento\App\Action\Context $context, @@ -79,6 +79,8 @@ public function __construct( /** * When a customer cancel payment from payflow gateway. + * + * @return void */ public function cancelPaymentAction() { @@ -91,6 +93,8 @@ public function cancelPaymentAction() /** * When a customer return to website from payflow gateway. + * + * @return void */ public function returnUrlAction() { @@ -121,6 +125,8 @@ public function returnUrlAction() /** * Submit transaction to Payflow getaway into iframe + * + * @return void */ public function formAction() { @@ -129,6 +135,8 @@ public function formAction() /** * Get response from PayPal by silent post method + * + * @return void */ public function silentPostAction() { @@ -148,7 +156,7 @@ public function silentPostAction() * Cancel order, return quote to customer * * @param string $errorMsg - * @return mixed + * @return false|string */ protected function _cancelPayment($errorMsg = '') { diff --git a/app/code/Magento/Paypal/Controller/Payflowadvanced.php b/app/code/Magento/Paypal/Controller/Payflowadvanced.php index 25efe7be68102..4bdc62a481df3 100644 --- a/app/code/Magento/Paypal/Controller/Payflowadvanced.php +++ b/app/code/Magento/Paypal/Controller/Payflowadvanced.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller; /** * Payflow Advanced Checkout Controller */ -namespace Magento\Paypal\Controller; - class Payflowadvanced extends \Magento\Paypal\Controller\Express\AbstractExpress { /** @@ -97,6 +96,8 @@ public function __construct( /** * When a customer cancel payment from payflow gateway. + * + * @return void */ public function cancelPaymentAction() { @@ -109,6 +110,8 @@ public function cancelPaymentAction() /** * When a customer return to website from payflow gateway. + * + * @return void */ public function returnUrlAction() { @@ -139,6 +142,8 @@ public function returnUrlAction() /** * Submit transaction to Payflow getaway into iframe + * + * @return void */ public function formAction() { @@ -149,6 +154,8 @@ public function formAction() /** * Get response from PayPal by silent post method + * + * @return void */ public function silentPostAction() { @@ -168,7 +175,7 @@ public function silentPostAction() * Cancel order, return quote to customer * * @param string $errorMsg - * @return bool|string + * @return false|string */ protected function _cancelPayment($errorMsg = '') { diff --git a/app/code/Magento/Paypal/Controller/Standard.php b/app/code/Magento/Paypal/Controller/Standard.php index aa9fe21e278a5..a7433d3684486 100644 --- a/app/code/Magento/Paypal/Controller/Standard.php +++ b/app/code/Magento/Paypal/Controller/Standard.php @@ -21,6 +21,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Controller; + +use Magento\Sales\Model\Order; /** * Paypal Standard Checkout Controller @@ -29,19 +32,19 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Controller; - class Standard extends \Magento\App\Action\Action { /** * Order instance + * + * @var Order */ protected $_order; /** - * Get order + * Get order * - * @return \Magento\Sales\Model\Order + * @return Order */ public function getOrder() { @@ -50,11 +53,13 @@ public function getOrder() /** * Send expire header to ajax response + * + * @return void */ protected function _expireAjax() { if (!$this->_objectManager->get('Magento\Checkout\Model\Session')->getQuote()->hasItems()) { - $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired'); + $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired'); exit; } } @@ -71,6 +76,8 @@ public function getStandard() /** * When a customer chooses Paypal on Checkout/Payment page + * + * @return void */ public function redirectAction() { @@ -83,6 +90,8 @@ public function redirectAction() /** * When a customer cancel payment from paypal. + * + * @return void */ public function cancelAction() { @@ -107,10 +116,12 @@ public function cancelAction() } /** - * when paypal returns + * When paypal returns * The order information at this point is in POST * variables. However, you don't want to "process" the order until you * get validation from the IPN. + * + * @return void */ public function successAction() { diff --git a/app/code/Magento/Paypal/Helper/Checkout.php b/app/code/Magento/Paypal/Helper/Checkout.php index 02b64f3ef987e..dea834f620ebc 100644 --- a/app/code/Magento/Paypal/Helper/Checkout.php +++ b/app/code/Magento/Paypal/Helper/Checkout.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Helper; /** * Checkout workflow helper */ -namespace Magento\Paypal\Helper; - class Checkout { /** diff --git a/app/code/Magento/Paypal/Helper/Data.php b/app/code/Magento/Paypal/Helper/Data.php index cbc29ce28e381..57404b969fdbf 100644 --- a/app/code/Magento/Paypal/Helper/Data.php +++ b/app/code/Magento/Paypal/Helper/Data.php @@ -21,12 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Helper; + +use Magento\Paypal\Model\Billing\Agreement\MethodInterface; /** * Paypal Data helper */ -namespace Magento\Paypal\Helper; - class Data extends \Magento\App\Helper\AbstractHelper { /** @@ -94,9 +95,9 @@ public function shouldAskToCreateBillingAgreement(\Magento\Paypal\Model\Config $ /** * Retrieve available billing agreement methods * - * @param mixed $store - * @param \Magento\Sales\Model\Quote $quote - * @return array + * @param null|string|bool|int|\Magento\Core\Model\Store $store + * @param \Magento\Sales\Model\Quote|null $quote + * @return MethodInterface[] */ public function getBillingAgreementMethods($store = null, $quote = null) { @@ -138,7 +139,7 @@ public function getAllBillingAgreementMethods() */ public function canManageBillingAgreements($methodInstance) { - return ($methodInstance instanceof \Magento\Paypal\Model\Billing\Agreement\MethodInterface); + return ($methodInstance instanceof MethodInterface); } /** diff --git a/app/code/Magento/Paypal/Helper/Hss.php b/app/code/Magento/Paypal/Helper/Hss.php index 841cb35d3117f..eee61a6b44372 100644 --- a/app/code/Magento/Paypal/Helper/Hss.php +++ b/app/code/Magento/Paypal/Helper/Hss.php @@ -21,18 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Helper; /** * Hosted Sole Solution helper */ -namespace Magento\Paypal\Helper; - class Hss extends \Magento\App\Helper\AbstractHelper { /** * Hosted Sole Solution methods * - * @var array + * @var string[] */ protected $_hssMethods = array( \Magento\Paypal\Model\Config::METHOD_HOSTEDPRO, @@ -93,7 +92,7 @@ public function getReviewButtonTemplate($name, $block) /** * Get methods * - * @return array + * @return string[] */ public function getHssMethods() { diff --git a/app/code/Magento/Paypal/Model/Api/AbstractApi.php b/app/code/Magento/Paypal/Model/Api/AbstractApi.php index 5202b400cdc19..3fe5c60b78777 100644 --- a/app/code/Magento/Paypal/Model/Api/AbstractApi.php +++ b/app/code/Magento/Paypal/Model/Api/AbstractApi.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Api; /** * Abstract class for Paypal API wrappers */ -namespace Magento\Paypal\Model\Api; - abstract class AbstractApi extends \Magento\Object { /** @@ -64,7 +63,15 @@ abstract class AbstractApi extends \Magento\Object * @var array */ protected $_lineItemExportItemsFormat = array(); + + /** + * @var array + */ protected $_lineItemExportItemsFilters = array(); + + /** + * @var array + */ protected $_lineItemTotalExportMap = array(); /** @@ -118,7 +125,7 @@ abstract class AbstractApi extends \Magento\Object protected $_regionFactory; /** - * @var \Magento\Core\Model\Log\AdapterFactory + * @var \Magento\Logger\AdapterFactory */ protected $_logAdapterFactory; @@ -132,7 +139,7 @@ abstract class AbstractApi extends \Magento\Object * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( @@ -140,7 +147,7 @@ public function __construct( \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, array $data = array() ) { $this->_customerAddress = $customerAddress; @@ -293,6 +300,8 @@ public function getPaymentAction() /** * PayPal merchant email getter + * + * @return string */ public function getBusinessAccount() { @@ -316,7 +325,7 @@ public function &import($to, array $publicMap = array()) * * @param array|\Magento\Object $from * @param array $publicMap - * @return \Magento\Paypal\Model\Api\AbstractApi + * @return $this */ public function export($from, array $publicMap = array()) { @@ -328,7 +337,7 @@ public function export($from, array $publicMap = array()) * Set PayPal cart instance * * @param \Magento\Paypal\Model\Cart $cart - * @return \Magento\Paypal\Model\Api\AbstractApi + * @return $this */ public function setPaypalCart(\Magento\Paypal\Model\Cart $cart) { @@ -340,7 +349,7 @@ public function setPaypalCart(\Magento\Paypal\Model\Cart $cart) * Config instance setter * * @param \Magento\Paypal\Model\Config $config - * @return \Magento\Paypal\Model\Api\AbstractApi + * @return $this */ public function setConfigObject(\Magento\Paypal\Model\Config $config) { @@ -360,6 +369,8 @@ public function getLocaleCode() /** * Always take into account + * + * @return int */ public function getFraudManagementFiltersEnabled() { @@ -370,7 +381,7 @@ public function getFraudManagementFiltersEnabled() * Set recurring profiles * * @param array $items - * @return \Magento\Paypal\Model\Api\AbstractApi + * @return $this */ public function addRecurringPaymentProfiles(array $items) { @@ -412,6 +423,7 @@ protected function &_exportToRequest(array $privateRequestMap, array $request = * * @param array $privateResponseMap * @param array $response + * @return void */ protected function _importFromResponse(array $privateResponseMap, array $response) { @@ -435,7 +447,7 @@ protected function _importFromResponse(array $privateResponseMap, array $respons * * @param array &$request * @param int $i - * @return true|bool + * @return true|null */ protected function _exportLineItems(array &$request, $i = 0) { @@ -509,6 +521,7 @@ protected function _exportShippingOptions(array &$request, $i = 0) /** * Filter amounts in API calls + * * @param float|string $value * @return string */ @@ -543,7 +556,7 @@ protected function _filterInt($value) * Unified getter that looks in data or falls back to config * * @param string $key - * @param mixed $default + * @param mixed|null $default * @return mixed */ protected function _getDataOrConfig($key, $default = null) @@ -554,7 +567,6 @@ protected function _getDataOrConfig($key, $default = null) return $this->_config->$key ? $this->_config->$key : $default; } - /** * region_id workaround: PayPal requires state code, try to find one in the address * diff --git a/app/code/Magento/Paypal/Model/Api/Nvp.php b/app/code/Magento/Paypal/Model/Api/Nvp.php index d9f8a7fd317b9..fc37bfa8a2924 100644 --- a/app/code/Magento/Paypal/Model/Api/Nvp.php +++ b/app/code/Magento/Paypal/Model/Api/Nvp.php @@ -23,15 +23,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Api; + +use Magento\Payment\Model\Cart; /** * NVP API wrappers model * @TODO: move some parts to abstract, don't hesitate to throw exceptions on api calls */ -namespace Magento\Paypal\Model\Api; - -use Magento\Payment\Model\Cart; - class Nvp extends \Magento\Paypal\Model\Api\AbstractApi { /** @@ -54,11 +53,17 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi const PENDING_TRANSACTION_DENY = 'Deny'; /** - * Capture types (make authorization close or remain open) + * Capture type (make authorization close or remain open) * * @var string */ protected $_captureTypeComplete = 'Complete'; + + /** + * Capture type (make authorization close or remain open) + * + * @var string + */ protected $_captureTypeNotcomplete = 'NotComplete'; /** @@ -193,7 +198,7 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi ); /** - * Filter callbacks for preparing internal amounts to NVP request + * Filter callback for preparing internal amounts to NVP request * * @var array */ @@ -205,7 +210,7 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi 'TAXAMT' => '_filterAmount', 'INITAMT' => '_filterAmount', 'CREDITCARDTYPE' => '_filterCcType', -// 'PROFILESTARTDATE' => '_filterToPaypalDate', + // 'PROFILESTARTDATE' => '_filterToPaypalDate', 'AUTOBILLAMT' => '_filterBillFailedLater', 'BILLINGPERIOD' => '_filterPeriodUnit', 'TRIALBILLINGPERIOD' => '_filterPeriodUnit', @@ -214,6 +219,11 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi 'NOSHIPPING' => '_filterInt', ); + /** + * Filter callback for preparing internal amounts to NVP request + * + * @var array + */ protected $_importFromRequestFilters = array( 'REDIRECTREQUIRED' => '_filterToBool', 'SUCCESSPAGEREDIRECTREQUESTED' => '_filterToBool', @@ -223,14 +233,14 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi /** * Request map for each API call * - * @var array + * @var string[] */ protected $_eachCallRequest = array('VERSION', 'USER', 'PWD', 'SIGNATURE', 'BUTTONSOURCE',); /** - * SetExpressCheckout request/response map + * SetExpressCheckout request map * - * @var array + * @var string[] */ protected $_setExpressCheckoutRequest = array( 'PAYMENTACTION', 'AMT', 'CURRENCYCODE', 'RETURNURL', 'CANCELURL', 'INVNUM', 'SOLUTIONTYPE', 'NOSHIPPING', @@ -238,31 +248,44 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi 'PAGESTYLE', 'HDRIMG', 'HDRBORDERCOLOR', 'HDRBACKCOLOR', 'PAYFLOWCOLOR', 'LOCALECODE', 'BILLINGTYPE', 'SUBJECT', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT', 'REQBILLINGADDRESS', ); + + /** + * SetExpressCheckout response map + * + * @var string[] + */ protected $_setExpressCheckoutResponse = array('TOKEN'); /** - * GetExpressCheckoutDetails request/response map - * @var array + * GetExpressCheckoutDetails request map + * + * @var string[] */ protected $_getExpressCheckoutDetailsRequest = array('TOKEN', 'SUBJECT',); /** - * DoExpressCheckoutPayment request/response map + * DoExpressCheckoutPayment request map * - * @var array + * @var string[] */ protected $_doExpressCheckoutPaymentRequest = array( 'TOKEN', 'PAYERID', 'PAYMENTACTION', 'AMT', 'CURRENCYCODE', 'IPADDRESS', 'BUTTONSOURCE', 'NOTIFYURL', 'RETURNFMFDETAILS', 'SUBJECT', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT', ); + + /** + * DoExpressCheckoutPayment response map + * + * @var string[] + */ protected $_doExpressCheckoutPaymentResponse = array( 'TRANSACTIONID', 'AMT', 'PAYMENTSTATUS', 'PENDINGREASON', 'REDIRECTREQUIRED' ); /** - * DoDirectPayment request/response map + * DoDirectPayment request map * - * @var array + * @var string[] */ protected $_doDirectPaymentRequest = array( 'PAYMENTACTION', 'IPADDRESS', 'RETURNFMFDETAILS', @@ -270,82 +293,124 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi 'CREDITCARDTYPE', 'ACCT', 'EXPDATE', 'CVV2', 'STARTDATE', 'ISSUENUMBER', 'AUTHSTATUS3DS', 'MPIVENDOR3DS', 'CAVV', 'ECI3DS', 'XID', ); + + /** + * DoDirectPayment response map + * + * @var string[] + */ protected $_doDirectPaymentResponse = array( 'TRANSACTIONID', 'AMT', 'AVSCODE', 'CVV2MATCH', 'VPAS', 'ECISUBMITTED3DS' ); /** - * DoReauthorization request/response map + * DoReauthorization request map * - * @var array + * @var string[] */ protected $_doReauthorizationRequest = array('AUTHORIZATIONID', 'AMT', 'CURRENCYCODE'); + + /** + * DoReauthorization response map + * + * @var string[] + */ protected $_doReauthorizationResponse = array( 'AUTHORIZATIONID', 'PAYMENTSTATUS', 'PENDINGREASON', 'PROTECTIONELIGIBILITY' ); /** - * DoCapture request/response map + * DoCapture request map * - * @var array + * @var string[] */ protected $_doCaptureRequest = array('AUTHORIZATIONID', 'COMPLETETYPE', 'AMT', 'CURRENCYCODE', 'NOTE', 'INVNUM',); + + /** + * DoCapture response map + * + * @var string[] + */ protected $_doCaptureResponse = array('TRANSACTIONID', 'CURRENCYCODE', 'AMT', 'PAYMENTSTATUS', 'PENDINGREASON',); /** - * DoAuthorization request/response map + * DoAuthorization request map * - * @var array + * @var string[] */ protected $_doAuthorizationRequest = array('TRANSACTIONID', 'AMT', 'CURRENCYCODE'); + + /** + * DoAuthorization response map + * + * @var string[] + */ protected $_doAuthorizationResponse = array('TRANSACTIONID', 'AMT'); /** * DoVoid request map * - * @var array + * @var string[] */ protected $_doVoidRequest = array('AUTHORIZATIONID', 'NOTE',); /** * GetTransactionDetailsRequest * - * @var array + * @var string[] */ protected $_getTransactionDetailsRequest = array('TRANSACTIONID'); + + /** + * GetTransactionDetailsResponse + * + * @var string[] + */ protected $_getTransactionDetailsResponse = array( 'PAYERID', 'FIRSTNAME', 'LASTNAME', 'TRANSACTIONID', 'PARENTTRANSACTIONID', 'CURRENCYCODE', 'AMT', 'PAYMENTSTATUS', 'PENDINGREASON', ); /** - * RefundTransaction request/response map + * RefundTransaction request map * - * @var array + * @var string[] */ protected $_refundTransactionRequest = array('TRANSACTIONID', 'REFUNDTYPE', 'CURRENCYCODE', 'NOTE',); + + /** + * RefundTransaction response map + * + * @var string[] + */ protected $_refundTransactionResponse = array('REFUNDTRANSACTIONID', 'GROSSREFUNDAMT',); /** - * ManagePendingTransactionStatus request/response map + * ManagePendingTransactionStatus request map * - * @var array + * @var string[] */ protected $_managePendingTransactionStatusRequest = array('TRANSACTIONID', 'ACTION'); + + /** + * ManagePendingTransactionStatus response map + * + * @var string[] + */ protected $_managePendingTransactionStatusResponse = array('TRANSACTIONID', 'STATUS'); /** * GetPalDetails response map * - * @var array + * @var string[] */ protected $_getPalDetailsResponse = array('PAL'); /** * CreateRecurringPaymentsProfile request map * - * @var array + * @var string[] */ protected $_createRecurringPaymentsProfileRequest = array( 'TOKEN', 'SUBSCRIBERNAME', 'PROFILESTARTDATE', 'PROFILEREFERENCE', 'DESC', 'MAXFAILEDPAYMENTS', 'AUTOBILLAMT', @@ -356,7 +421,7 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi /** * CreateRecurringPaymentsProfile response map * - * @var array + * @var string[] */ protected $_createRecurringPaymentsProfileResponse = array( 'PROFILEID', 'PROFILESTATUS' @@ -365,26 +430,27 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi /** * Request/response for ManageRecurringPaymentsProfileStatus map * - * @var array + * @var string[] */ protected $_manageRecurringPaymentsProfileStatusRequest = array('PROFILEID', 'ACTION'); /** * Request for GetRecurringPaymentsProfileDetails * - * @var array + * @var string[] */ protected $_getRecurringPaymentsProfileDetailsRequest = array('PROFILEID'); /** * Response for GetRecurringPaymentsProfileDetails * - * @var array + * @var string[] */ protected $_getRecurringPaymentsProfileDetailsResponse = array('STATUS', /* TODO: lot of other stuff */); /** * Map for billing address import/export + * * @var array */ protected $_billingAddressMap = array ( @@ -444,7 +510,7 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi /** * Payment information response specifically to be collected after some requests - * @var array + * @var string[] */ protected $_paymentInformationResponse = array( 'PAYERID', 'PAYERSTATUS', 'CORRELATIONID', 'ADDRESSID', 'ADDRESSSTATUS', @@ -460,6 +526,11 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi Cart::AMOUNT_TAX => 'TAXAMT', Cart::AMOUNT_SHIPPING => 'SHIPPINGAMT', ); + + /** + * Line items export mapping settings + * @var array + */ protected $_lineItemExportItemsFormat = array( 'id' => 'L_NUMBER%d', 'name' => 'L_NAME%d', @@ -480,54 +551,87 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi ); /** - * init Billing Agreement request/response map - * @var array + * init Billing Agreement request map + * + * @var string[] */ protected $_customerBillingAgreementRequest = array('RETURNURL', 'CANCELURL', 'BILLINGTYPE'); + + /** + * init Billing Agreement response map + * + * @var string[] + */ protected $_customerBillingAgreementResponse = array('TOKEN'); /** - * Billing Agreement details request/response map - * @var array + * Billing Agreement details request map + * + * @var string[] */ protected $_billingAgreementCustomerDetailsRequest = array('TOKEN'); + + /** + * Billing Agreement details response map + * + * @var string[] + */ protected $_billingAgreementCustomerDetailsResponse = array('EMAIL', 'PAYERID', 'PAYERSTATUS', 'SHIPTOCOUNTRYCODE', 'PAYERBUSINESS' ); /** - * Create Billing Agreement request/response map - * @var array + * Create Billing Agreement request map + * + * @var string[] */ protected $_createBillingAgreementRequest = array('TOKEN'); + + /** + * Create Billing Agreement response map + * + * @var string[] + */ protected $_createBillingAgreementResponse = array('BILLINGAGREEMENTID'); /** - * Update Billing Agreement request/response map + * Update Billing Agreement request map * - * @var array + * @var string[] */ protected $_updateBillingAgreementRequest = array( 'REFERENCEID', 'BILLINGAGREEMENTDESCRIPTION', 'BILLINGAGREEMENTSTATUS', 'BILLINGAGREEMENTCUSTOM' ); + + /** + * Update Billing Agreement response map + * + * @var string[] + */ protected $_updateBillingAgreementResponse = array( 'REFERENCEID', 'BILLINGAGREEMENTDESCRIPTION', 'BILLINGAGREEMENTSTATUS', 'BILLINGAGREEMENTCUSTOM' ); /** - * Do Reference Transaction request/response map + * Do Reference Transaction request map * - * @var array + * @var string[] */ protected $_doReferenceTransactionRequest = array('REFERENCEID', 'PAYMENTACTION', 'AMT', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT', 'INVNUM', 'NOTIFYURL', 'CURRENCYCODE' ); + + /** + * Do Reference Transaction response map + * + * @var string[] + */ protected $_doReferenceTransactionResponse = array('BILLINGAGREEMENTID', 'TRANSACTIONID'); /** * Fields that should be replaced in debug with '***' * - * @var array + * @var string[] */ protected $_debugReplacePrivateDataKeys = array( 'ACCT', 'EXPDATE', 'CVV2', 'CARDISSUE', 'CARDSTART', 'CREDITCARDTYPE', 'USER', 'PWD', 'SIGNATURE' @@ -581,7 +685,7 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param array $data */ @@ -590,7 +694,7 @@ public function __construct( \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Directory\Model\CountryFactory $countryFactory, array $data = array() ) { @@ -633,8 +737,11 @@ public function getBillingAgreementType() /** * SetExpressCheckout call - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout + * * TODO: put together style and giropay settings + * + * @return void + * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout */ public function callSetExpressCheckout() { @@ -668,6 +775,8 @@ public function callSetExpressCheckout() /** * GetExpressCheckoutDetails call + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetExpressCheckoutDetails */ function callGetExpressCheckoutDetails() @@ -681,6 +790,8 @@ function callGetExpressCheckoutDetails() /** * DoExpressCheckout call + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoExpressCheckoutPayment */ public function callDoExpressCheckoutPayment() @@ -702,6 +813,8 @@ public function callDoExpressCheckoutPayment() /** * Process a credit card payment + * + * @return void */ public function callDoDirectPayment() { @@ -716,6 +829,8 @@ public function callDoDirectPayment() /** * Do Reference Transaction call + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoReferenceTransaction */ public function callDoReferenceTransaction() @@ -738,6 +853,8 @@ public function getIsFraudDetected() /** * Made additional request to paypal to get autharization id + * + * @return void */ public function callDoReauthorization() { @@ -748,6 +865,8 @@ public function callDoReauthorization() /** * DoCapture call + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoCapture */ public function callDoCapture() @@ -762,8 +881,8 @@ public function callDoCapture() /** * DoAuthorization call * + * @return $this * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoAuthorization - * @return \Magento\Paypal\Model\Api\Nvp */ public function callDoAuthorization() { @@ -778,6 +897,8 @@ public function callDoAuthorization() /** * DoVoid call + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoVoid */ public function callDoVoid() @@ -788,6 +909,8 @@ public function callDoVoid() /** * GetTransactionDetails + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails */ public function callGetTransactionDetails() @@ -799,6 +922,8 @@ public function callGetTransactionDetails() /** * RefundTransaction call + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_RefundTransaction */ public function callRefundTransaction() @@ -813,6 +938,8 @@ public function callRefundTransaction() /** * ManagePendingTransactionStatus + * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_ManagePendingTransactionStatus */ public function callManagePendingTransactionStatus() @@ -826,7 +953,9 @@ public function callManagePendingTransactionStatus() } /** - * getPalDetails call + * GetPalDetails call + * + * @return void * @link https://www.x.com/docs/DOC-1300 * @link https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECButtonIntegration */ @@ -839,6 +968,7 @@ public function callGetPalDetails() /** * Set Customer BillingA greement call * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetCustomerBillingAgreement */ public function callSetCustomerBillingAgreement() @@ -851,6 +981,7 @@ public function callSetCustomerBillingAgreement() /** * Get Billing Agreement Customer Details call * + * @return void * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetBillingAgreementCustomerDetails */ public function callGetBillingAgreementCustomerDetails() @@ -863,6 +994,7 @@ public function callGetBillingAgreementCustomerDetails() /** * Create Billing Agreement call * + * @return void */ public function callCreateBillingAgreement() { @@ -874,6 +1006,7 @@ public function callCreateBillingAgreement() /** * Billing Agreement Update call * + * @return void */ public function callUpdateBillingAgreement() { @@ -891,6 +1024,8 @@ public function callUpdateBillingAgreement() /** * CreateRecurringPaymentsProfile call + * + * @return void */ public function callCreateRecurringPaymentsProfile() { @@ -903,6 +1038,7 @@ public function callCreateRecurringPaymentsProfile() /** * ManageRecurringPaymentsProfileStatus call * + * @return void * @throws \Magento\Core\Exception */ public function callManageRecurringPaymentsProfileStatus() @@ -928,6 +1064,9 @@ public function callManageRecurringPaymentsProfileStatus() /** * GetRecurringPaymentsProfileDetails call + * + * @param \Magento\Object $result + * @return void */ public function callGetRecurringPaymentsProfileDetails(\Magento\Object $result) { @@ -994,7 +1133,6 @@ protected function _getHeaderListForRequest() * Additional response processing. * * @param array $response - * * @return array */ protected function _postProcessResponse($response) @@ -1087,7 +1225,7 @@ public function call($methodName, array $request) * Setter for 'raw response needed' flag * * @param bool $flag - * @return \Magento\Paypal\Model\Api\Nvp + * @return $this */ public function setRawResponseNeeded($flag) { @@ -1099,6 +1237,7 @@ public function setRawResponseNeeded($flag) * Handle logical errors * * @param array $response + * @return void * @throws \Magento\Core\Exception */ protected function _handleCallErrors($response) @@ -1130,7 +1269,7 @@ protected function _handleCallErrors($response) /** * Catch success calls and collect warnings * - * @param array + * @param array $response * @return bool success flag */ protected function _isCallSuccessful($response) @@ -1196,7 +1335,7 @@ protected function _deformatNVP($nvpstr) //decoding the respose $nvpArray[urldecode($keyval)] = urldecode( $valval); $nvpstr = substr($nvpstr, $valuepos + 1, strlen($nvpstr)); - } + } return $nvpArray; } @@ -1218,7 +1357,9 @@ protected function _exportLineItems(array &$request, $i = 0) /** * Create billing and shipping addresses basing on response data + * * @param array $data + * @return void */ protected function _exportAddressses($data) { @@ -1253,7 +1394,8 @@ protected function _exportAddressses($data) /** * Adopt specified address object to be compatible with Magento * - * @param \Magento\Object $address + * @param \Magento\Object + * @return void */ protected function _applyStreetAndRegionWorkarounds(\Magento\Object $address) { @@ -1281,6 +1423,7 @@ protected function _applyStreetAndRegionWorkarounds(\Magento\Object $address) * Puerto Rico should be as state of USA and not as a country * * @param array $request + * @return void */ protected function _applyCountryWorkarounds(&$request) { @@ -1342,7 +1485,7 @@ protected function _filterCcType($value) * Filter for true/false values (converts to boolean) * * @param mixed $value - * @return mixed + * @return bool|mixed */ protected function _filterToBool($value) { @@ -1501,6 +1644,7 @@ protected function _filterRecurringProfileActionToNvp($value) * * @param string $value * @param \Magento\Object $result + * @return void */ protected function _analyzeRecurringProfileStatus($value, \Magento\Object $result) { @@ -1562,6 +1706,7 @@ protected function _prepareEachCallRequest($methodName) * Check the EC request against unilateral payments mode and remove the SUBJECT if needed * * @param &array $requestFields + * @return void */ protected function _prepareExpressCheckoutCallRequest(&$requestFields) { diff --git a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php index 739fbf0d42c3c..a7de05470d218 100644 --- a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php +++ b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php @@ -21,14 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * NVP API wrappers model - */ namespace Magento\Paypal\Model\Api; use Magento\Payment\Model\Cart; +/** + * NVP API wrappers model + */ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp { /**#@+ @@ -63,12 +62,19 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp const RESPONSE_CODE_FRAUD = 126; /**#@-*/ - /**#@+ - * Capture types (make authorization close or remain open) + /** + * Capture type (make authorization close or remain open) + * + * @var string */ protected $_captureTypeComplete = 'Y'; + + /** + * Capture type (make authorization close or remain open) + * + * @var string + */ protected $_captureTypeNotcomplete = 'N'; - /**#@-*/ /** * Global public interface map @@ -142,17 +148,17 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp /** * Fields that should be replaced in debug with '***' * - * @var array + * @var string[] */ protected $_debugReplacePrivateDataKeys = array( 'ACCT', 'EXPDATE', 'CVV2', 'PARTNER', 'USER', 'VENDOR', 'PWD', ); - /**#@+ - * DoDirectPayment request/response map + /** + * DoDirectPayment request map * - * @var array + * @var string[] */ protected $_doDirectPaymentRequest = array( 'ACCT', 'EXPDATE', 'CVV2', 'CURRENCY', 'EMAIL', 'TENDER', 'NOTIFYURL', @@ -161,87 +167,117 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp 'AUTHSTATUS3DS', 'MPIVENDOR3DS', 'CAVV', 'ECI', 'XID',//cardinal centinel params 'TAXAMT', 'FREIGHTAMT' ); + + /** + * DoDirectPayment response map + * + * @var string[] + */ protected $_doDirectPaymentResponse = array( 'PNREF', 'PAYMENTINFO_0_TRANSACTIONID', 'CORRELATIONID', 'CVV2MATCH', 'AVSADDR', 'AVSZIP', 'PENDINGREASON' ); - /**#@-*/ - /**#@+ - * DoCapture request/response map + /** + * DoCapture request map * - * @var array + * @var string[] */ protected $_doCaptureRequest = array('ORIGID', 'CAPTURECOMPLETE', 'AMT', 'TENDER', 'NOTE', 'INVNUM'); + + /** + * DoCapture response map + * + * @var string[] + */ protected $_doCaptureResponse = array('PNREF', 'TRANSACTIONID'); - /**#@-*/ /** * DoVoid request map * - * @var array + * @var string[] */ protected $_doVoidRequest = array('ORIGID', 'NOTE', 'TENDER'); /** * Request map for each API call * - * @var array + * @var string[] */ protected $_eachCallRequest = array('PARTNER', 'USER', 'VENDOR', 'PWD', 'BUTTONSOURCE'); - /**#@+ - * RefundTransaction request/response map + /** + * RefundTransaction request map * - * @var array + * @var string[] */ protected $_refundTransactionRequest = array('ORIGID', 'TENDER'); + + /** + * RefundTransaction response map + * + * @var string[] + */ protected $_refundTransactionResponse = array('PNREF', 'REFUNDTRANSACTIONID'); - /**#@-*/ - /**#@+ - * SetExpressCheckout request/response map + /** + * SetExpressCheckout request map * - * @var array + * @var string[] */ protected $_setExpressCheckoutRequest = array( 'TENDER', 'AMT', 'CURRENCY', 'RETURNURL', 'CANCELURL', 'INVNUM', 'PAGESTYLE', 'HDRIMG', 'HDRBORDERCOLOR', 'HDRBACKCOLOR', 'PAYFLOWCOLOR', 'LOCALECODE', ); + + /** + * SetExpressCheckout response map + * + * @var string[] + */ protected $_setExpressCheckoutResponse = array('REPMSG', 'TOKEN'); - /**#@-*/ /** * GetExpressCheckoutDetails request/response map * - * @var array + * @var string[] */ protected $_getExpressCheckoutDetailsRequest = array('TENDER', 'TOKEN'); - /**#@+ - * DoExpressCheckoutPayment request/response map + /** + * DoExpressCheckoutPayment request map * - * @var array + * @var string[] */ protected $_doExpressCheckoutPaymentRequest = array( 'TENDER', 'TOKEN', 'PAYERID', 'AMT', 'CURRENCY', 'CUSTIP', 'BUTTONSOURCE', 'NOTIFYURL', ); + + /** + * DoExpressCheckoutPayment response map + * + * @var string[] + */ protected $_doExpressCheckoutPaymentResponse = array( 'PNREF', 'PAYMENTINFO_0_TRANSACTIONID', 'REPMSG', 'AMT', 'PENDINGREASON', 'CVV2MATCH', 'AVSADDR', 'AVSZIP', 'CORRELATIONID' ); - /**#@-*/ - /**#@+ + /** * GetTransactionDetailsRequest * - * @var array + * @var string[] */ protected $_getTransactionDetailsRequest = array('ORIGID', 'TENDER'); + + /** + * GetTransactionDetailsResponse + * + * @var string[] + */ protected $_getTransactionDetailsResponse = array( 'PAYERID', 'FIRSTNAME', 'LASTNAME', 'TRANSACTIONID', 'PARENTTRANSACTIONID', 'CURRENCYCODE', 'AMT', 'PAYMENTSTATUS' ); - /**#@-*/ /** * Map for shipping address import/export (extends billing address mapper) @@ -291,7 +327,7 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp 'country_id' => 'COUNTRY', ); - /**#@+ + /** * Line items export mapping settings * * @var array @@ -301,23 +337,32 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp Cart::AMOUNT_SHIPPING => 'FREIGHTAMT', ); + /** + * Line items export request totals format + * + * @var array + */ protected $_lineItemsExportRequestTotalsFormat = array( 'amount' => 'PAYMENTREQUEST_%d_ITEMAMT', Cart::AMOUNT_TAX => 'TAXAMT', Cart::AMOUNT_SHIPPING => 'FREIGHTAMT', ); + /** + * Line items export items format + * + * @var array + */ protected $_lineItemExportItemsFormat = array( 'name' => 'L_PAYMENTREQUEST_%d_NAME%d', 'qty' => 'L_PAYMENTREQUEST_%d_QTY%d', 'amount' => 'L_PAYMENTREQUEST_%d_AMT%d', ); - /**#@-*/ /** * Payment information response specifically to be collected after some requests * - * @var array + * @var string[] */ protected $_paymentInformationResponse = array( 'PAYERID', 'CORRELATIONID', 'ADDRESSID', 'ADDRESSSTATUS', @@ -343,7 +388,7 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Math\Random $mathRandom * @param array $data @@ -353,7 +398,7 @@ public function __construct( \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Math\Random $mathRandom, array $data = array() @@ -465,8 +510,8 @@ protected function _addMethodToRequest($methodName, $request) /** * Return Payflow Edition * - * @param string - * @return string | null + * @param string $methodName + * @return string|null */ protected function _getPayflowActionName($methodName) { @@ -509,7 +554,7 @@ protected function _mapPaypalMethodName($methodName) /** * Catch success calls and collect warnings * - * @param array + * @param array $response * @return bool success flag */ protected function _isCallSuccessful($response) @@ -529,6 +574,7 @@ protected function _isCallSuccessful($response) * Handle logical errors * * @param array $response + * @return void * @throws \Magento\Core\Exception */ protected function _handleCallErrors($response) @@ -567,7 +613,9 @@ protected function getRequestId() } /** - * "GetTransactionDetails" method does not exists in Payflow + * GetTransactionDetails method does not exists in Payflow + * + * @return void */ public function callGetTransactionDetails() { @@ -578,6 +626,7 @@ public function callGetTransactionDetails() * * @param array $from * @param array $collectedWarnings + * @return void */ protected function _importFraudFiltersResult(array $from, array $collectedWarnings) { @@ -592,7 +641,7 @@ protected function _importFraudFiltersResult(array $from, array $collectedWarnin * (PayFlow edition doesn't support Unilateral payments) * * @param string $methodName Current method name - * @return array + * @return string[] */ protected function _prepareEachCallRequest($methodName) { @@ -616,6 +665,7 @@ protected function _prepareExpressCheckoutCallRequest(&$requestFields) * Puerto Rico should be as state of USA and not as a country * * @param array $request + * @return void */ protected function _applyCountryWorkarounds(&$request) { @@ -629,7 +679,7 @@ protected function _applyCountryWorkarounds(&$request) * Retrieve headers for request. * This is a hack to make Payflow work with negative values for items like discount has. * - * @return array + * @return string[] */ protected function _getHeaderListForRequest() { @@ -641,7 +691,6 @@ protected function _getHeaderListForRequest() * Hack to cut off length from API type response params. * * @param array $response - * * @return array */ protected function _postProcessResponse($response) @@ -670,7 +719,6 @@ protected function _postProcessResponse($response) * * @param array &$request * @param int $i - * * @return bool|null */ protected function _exportLineItems(array &$request, $i = 0) @@ -682,13 +730,11 @@ protected function _exportLineItems(array &$request, $i = 0) * NVP doesn't support passing discount total as a separate amount - add it as a line item. * This is a hack for proper line items display for order at PP EC side using Payflow through API. * - * @link https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout - * * @param array &$request * @param int $requestNum * @param int $itemNum - * * @return bool|null + * @link https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout */ protected function _preparePaymentRequestLineItems(array &$request, $requestNum = 0, $itemNum = 0) { diff --git a/app/code/Magento/Paypal/Model/Api/Standard.php b/app/code/Magento/Paypal/Model/Api/Standard.php index 4e7cea4487e44..cbb73fec70958 100644 --- a/app/code/Magento/Paypal/Model/Api/Standard.php +++ b/app/code/Magento/Paypal/Model/Api/Standard.php @@ -23,18 +23,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * PayPal Standard checkout request API - */ namespace Magento\Paypal\Model\Api; use Magento\Payment\Model\Cart; +/** + * PayPal Standard checkout request API + */ class Standard extends \Magento\Paypal\Model\Api\AbstractApi { /** - * Global interface map and export filters + * Global interface map + * * @var array */ protected $_globalMap = array( @@ -60,9 +60,15 @@ class Standard extends \Magento\Paypal\Model\Api\AbstractApi 'cpp_headerback_color' => 'hdrbackcolor', 'cpp_headerborder_color' => 'hdrbordercolor', 'cpp_payflow_color' => 'payflowcolor', -// 'cs' => '', // TODO + // 'cs' => '', // TODO 'lc' => 'locale', ); + + /** + * Export filters + * + * @var array + */ protected $_exportToRequestFilters = array( 'amount' => '_filterAmount', 'shipping' => '_filterAmount', @@ -72,7 +78,8 @@ class Standard extends \Magento\Paypal\Model\Api\AbstractApi /** * Interface for common and "aggregated order" specific fields - * @var array + * + * @var string[] */ protected $_commonRequestFields = array( 'business', 'invoice', 'currency_code', 'paymentaction', 'return', 'cancel_return', 'notify_url', 'bn', @@ -83,7 +90,7 @@ class Standard extends \Magento\Paypal\Model\Api\AbstractApi /** * Fields that should be replaced in debug with '***' * - * @var array + * @var string[] */ protected $_debugReplacePrivateDataKeys = array('business'); @@ -118,6 +125,7 @@ class Standard extends \Magento\Paypal\Model\Api\AbstractApi /** * Address export to request map + * * @var array */ protected $_addressMap = array( @@ -136,6 +144,8 @@ class Standard extends \Magento\Paypal\Model\Api\AbstractApi * Generate PayPal Standard checkout request fields * Depending on whether there are cart line items set, will aggregate everything or display items specifically * Shipping amount in cart line items is implemented as a separate "fake" line item + * + * @return array */ public function getStandardCheckoutRequest() { @@ -169,6 +179,7 @@ public function getStandardCheckoutRequest() /** * Merchant account email getter + * * @return string */ public function getBusinessAccount() @@ -178,6 +189,7 @@ public function getBusinessAccount() /** * Payment action getter + * * @return string */ public function getPaymentAction() @@ -209,6 +221,7 @@ protected function _exportLineItems(array &$request, $i = 1) * Import address object, if set, to the request * * @param array $request + * @return void */ protected function _importAddress(&$request) { @@ -245,6 +258,7 @@ protected function _importAddress(&$request) * Puerto Rico should be as state of USA and not as a country * * @param array $request + * @return void */ protected function _applyCountryWorkarounds(&$request) { diff --git a/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php index ad8f0d1433600..06afe734e673b 100644 --- a/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php +++ b/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Billing; /** * Billing Agreement abstaract class */ -namespace Magento\Paypal\Model\Billing; - abstract class AbstractAgreement extends \Magento\Core\Model\AbstractModel { /** @@ -45,25 +44,21 @@ abstract class AbstractAgreement extends \Magento\Core\Model\AbstractModel /** * Init billing agreement - * */ abstract public function initToken(); /** * Verify billing agreement details - * */ abstract public function verifyToken(); /** * Create billing agreement - * */ abstract public function place(); /** * Cancel billing agreement - * */ abstract public function cancel(); @@ -75,16 +70,16 @@ abstract public function cancel(); protected $_paymentData = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Paypal/Model/Billing/Agreement.php b/app/code/Magento/Paypal/Model/Billing/Agreement.php index e8c1ef949ff83..8940d7bd247f9 100644 --- a/app/code/Magento/Paypal/Model/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Model/Billing/Agreement.php @@ -21,9 +21,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Paypal\Model\Billing; +use Magento\Sales\Model\Order\Payment; + /** * Billing Agreement abstract model * @@ -69,8 +70,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\AbstractAgreement protected $_dateFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Paypal\Model\Resource\Billing\Agreement\CollectionFactory $billingAgreementFactory * @param \Magento\Core\Model\DateFactory $dateFactory @@ -79,8 +80,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\AbstractAgreement * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentData, \Magento\Paypal\Model\Resource\Billing\Agreement\CollectionFactory $billingAgreementFactory, \Magento\Core\Model\DateFactory $dateFactory, @@ -95,6 +96,8 @@ public function __construct( /** * Init model + * + * @return void */ protected function _construct() { @@ -163,7 +166,7 @@ public function initToken() * Get billing agreement details * Data from response is inside this object * - * @return \Magento\Paypal\Model\Billing\Agreement + * @return $this */ public function verifyToken() { @@ -175,7 +178,7 @@ public function verifyToken() /** * Create billing agreement * - * @return \Magento\Paypal\Model\Billing\Agreement + * @return $this */ public function place() { @@ -196,7 +199,7 @@ public function place() /** * Cancel billing agreement * - * @return \Magento\Paypal\Model\Billing\Agreement + * @return $this */ public function cancel() { @@ -252,10 +255,10 @@ public function isValid() * [billing_agreement_id] => string * [method_code] => string * - * @param \Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Billing\Agreement + * @param Payment $payment + * @return $this */ - public function importOrderPayment(\Magento\Sales\Model\Order\Payment $payment) + public function importOrderPayment(Payment $payment) { $baData = $payment->getBillingAgreementData(); @@ -302,7 +305,7 @@ public function needToCreateForCustomer($customerId) * Add order relation to current billing agreement * * @param int|\Magento\Sales\Model\Order $orderId - * @return \Magento\Paypal\Model\Billing\Agreement + * @return $this */ public function addOrderRelation($orderId) { @@ -312,6 +315,8 @@ public function addOrderRelation($orderId) /** * Save related orders + * + * @return void */ protected function _saveOrderRelations() { diff --git a/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php b/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php index 496ad405c1cfe..78203707c4230 100644 --- a/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php +++ b/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Billing\Agreement; /** * Interface for payment methods that support billing agreements management */ -namespace Magento\Paypal\Model\Billing\Agreement; - interface MethodInterface { /** diff --git a/app/code/Magento/Paypal/Model/Billing/Agreement/OrdersUpdater.php b/app/code/Magento/Paypal/Model/Billing/Agreement/OrdersUpdater.php index 05777db75dc78..b31a6ba523d8b 100644 --- a/app/code/Magento/Paypal/Model/Billing/Agreement/OrdersUpdater.php +++ b/app/code/Magento/Paypal/Model/Billing/Agreement/OrdersUpdater.php @@ -21,16 +21,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Billing\Agreement; /** * Orders grid massaction items updater */ -namespace Magento\Paypal\Model\Billing\Agreement; - class OrdersUpdater implements \Magento\View\Layout\Argument\UpdaterInterface { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registryManager; @@ -40,21 +39,21 @@ class OrdersUpdater implements \Magento\View\Layout\Argument\UpdaterInterface protected $_agreementResource; /** - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Paypal\Model\Resource\Billing\Agreement $agreementResource * @param array $data * @throws \InvalidArgumentException */ public function __construct( - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Paypal\Model\Resource\Billing\Agreement $agreementResource, array $data = array() ) { $this->_registryManager = isset($data['registry']) ? $data['registry'] : $coreRegistry; $this->_agreementResource = $agreementResource; - if (false === ($this->_registryManager instanceof \Magento\Core\Model\Registry)) { - throw new \InvalidArgumentException('registry object has to be an instance of \Magento\Core\Model\Registry'); + if (false === ($this->_registryManager instanceof \Magento\Registry)) { + throw new \InvalidArgumentException('registry object has to be an instance of \Magento\Registry'); } } @@ -62,7 +61,6 @@ public function __construct( * Add billing agreement filter * * @param mixed $argument - * @throws \DomainException * @return mixed * @throws \DomainException */ diff --git a/app/code/Magento/Paypal/Model/Cart.php b/app/code/Magento/Paypal/Model/Cart.php index fd7cae4ad446f..098e6c475b9a3 100644 --- a/app/code/Magento/Paypal/Model/Cart.php +++ b/app/code/Magento/Paypal/Model/Cart.php @@ -23,13 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * PayPal-specific model for shopping cart items and totals * The main idea is to accommodate all possible totals into PayPal-compatible 4 totals and line items */ -namespace Magento\Paypal\Model; - class Cart extends \Magento\Payment\Model\Cart { /** @@ -67,6 +66,8 @@ public function getAmounts() /** * Calculate subtotal from custom items + * + * @return void */ protected function _calculateCustomItemsSubtotal() { @@ -78,6 +79,8 @@ protected function _calculateCustomItemsSubtotal() /** * Check the line items and totals according to PayPal business logic limitations + * + * @return void */ protected function _validate() { @@ -124,6 +127,8 @@ protected function _validate() /** * Import items from sales model with workarounds for PayPal + * + * @return void */ protected function _importItemsFromSalesModel() { @@ -184,6 +189,7 @@ protected function _importItemsFromSalesModel() * - go to PayPal * * @param \Magento\Payment\Model\Cart\SalesModel\SalesModelInterface $salesEntity + * @return void */ protected function _applyHiddenTaxWorkaround(\Magento\Payment\Model\Cart\SalesModel\SalesModelInterface $salesEntity) { diff --git a/app/code/Magento/Paypal/Model/Cert.php b/app/code/Magento/Paypal/Model/Cert.php index af12fbe703f99..ab4edd8acc5a3 100644 --- a/app/code/Magento/Paypal/Model/Cert.php +++ b/app/code/Magento/Paypal/Model/Cert.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * PayPal specific model for certificate based authentication - */ namespace Magento\Paypal\Model; use Magento\Filesystem\Directory\WriteInterface; +/** + * PayPal specific model for certificate based authentication + */ class Cert extends \Magento\Core\Model\AbstractModel { /** @@ -49,8 +48,8 @@ class Cert extends \Magento\Core\Model\AbstractModel protected $encryptor; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\App\Filesystem $filesystem * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -58,8 +57,8 @@ class Cert extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\App\Filesystem $filesystem, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Core\Model\Resource\AbstractResource $resource = null, @@ -73,6 +72,8 @@ public function __construct( /** * Initialize resource model + * + * @return void */ protected function _construct() { @@ -84,7 +85,7 @@ protected function _construct() * * @param int $websiteId * @param bool $strictLoad - * @return \Magento\Paypal\Model\Cert + * @return $this */ public function loadByWebsite($websiteId, $strictLoad = true) { @@ -118,6 +119,7 @@ public function getCertPath() * Create physical certificate file based on DB data * * @param string $file + * @return void */ protected function _createCertFile($file) { @@ -144,7 +146,7 @@ protected function _removeOutdatedCertFile() /** * Delete assigned certificate file after delete object * - * @return \Magento\Paypal\Model\Cert + * @return $this */ protected function _afterDelete() { diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php index dacf58046d6ee..3947d8af57f2b 100644 --- a/app/code/Magento/Paypal/Model/Config.php +++ b/app/code/Magento/Paypal/Model/Config.php @@ -23,13 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * Config model that is aware of all \Magento\Paypal payment methods * Works with PayPal-specific system configuration */ -namespace Magento\Paypal\Model; - class Config { /** @@ -197,7 +196,7 @@ class Config /** * Currency codes supported by PayPal methods * - * @var array + * @var string[] */ protected $_supportedCurrencyCodes = array('AUD', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'JPY', 'MXN', 'NOK', 'NZD', 'PLN', 'GBP', 'SGD', 'SEK', 'CHF', 'USD', 'TWD', 'THB'); @@ -205,7 +204,7 @@ class Config /** * Merchant country supported by PayPal * - * @var array + * @var string[] */ protected $_supportedCountryCodes = array( 'AE','AR','AT','AU','BE','BG','BR','CA','CH','CL','CR','CY','CZ','DE','DK','DO','EC','EE','ES','FI','FR','GB', @@ -215,7 +214,7 @@ class Config /** * Buyer country supported by PayPal * - * @var array + * @var string[] */ protected $_supportedBuyerCountryCodes = array( 'AF ', 'AX ', 'AL ', 'DZ ', 'AS ', 'AD ', 'AO ', 'AI ', 'AQ ', 'AG ', 'AR ', 'AM ', 'AW ', 'AU ', 'AT ', 'AZ ', @@ -239,7 +238,7 @@ class Config /** * Locale codes supported by misc images (marks, shortcuts etc) * - * @var array + * @var string[] * @link https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECButtonIntegration#id089QD0O0TX4__id08AH904I0YK */ protected $_supportedImageLocales = array('de_DE', 'en_AU', 'en_GB', 'en_US', 'es_ES', 'es_XC', 'fr_FR', @@ -310,7 +309,7 @@ public function __construct( * Method code setter * * @param string|\Magento\Payment\Model\Method\AbstractMethod $method - * @return \Magento\Paypal\Model\Config + * @return $this */ public function setMethod($method) { @@ -336,7 +335,7 @@ public function getMethodCode() * Store ID setter * * @param int $storeId - * @return \Magento\Paypal\Model\Config + * @return $this */ public function setStoreId($storeId) { @@ -455,8 +454,7 @@ protected function _prepareValue($key, $value) if ($key == 'payment_action' && $value != self::PAYMENT_ACTION_SALE && $this->_methodCode == self::METHOD_WPP_EXPRESS - && $this->shouldUseUnilateralPayments()) - { + && $this->shouldUseUnilateralPayments()) { return self::PAYMENT_ACTION_SALE; } return $value; @@ -465,7 +463,7 @@ protected function _prepareValue($key, $value) /** * Return merchant country codes supported by PayPal * - * @return array + * @return string[] */ public function getSupportedMerchantCountryCodes() { @@ -475,7 +473,7 @@ public function getSupportedMerchantCountryCodes() /** * Return buyer country codes supported by PayPal * - * @return array + * @return string[] */ public function getSupportedBuyerCountryCodes() { @@ -518,7 +516,7 @@ public function isMethodSupportedForCountry($method = null, $countryCode = null) /** * Return list of allowed methods for specified country iso code * - * @param string $countryCode 2-letters iso code + * @param string|null $countryCode 2-letters iso code * @return array */ public function getCountryMethods($countryCode = null) @@ -664,7 +662,7 @@ public function getStartBillingAgreementUrl($token) )); } - /** + /** * PayPal web URL generic getter * * @param array $params @@ -693,8 +691,8 @@ public function areButtonsDynamic() * PayPal will ignore "pal", if there is no total amount specified * * @param string $localeCode - * @param float $orderTotal - * @param string $pal encrypted summary about merchant + * @param float|null $orderTotal + * @param string|null $pal encrypted summary about merchant * @return string * @see Paypal_Model_Api_Nvp::callGetPalDetails() */ @@ -716,9 +714,9 @@ public function getExpressCheckoutShortcutImageUrl($localeCode, $orderTotal = nu * $staticSize is applicable for static images only * * @param string $localeCode - * @param float $orderTotal - * @param string $pal - * @param string $staticSize + * @param float|null $orderTotal + * @param string|null $pal + * @param string|null $staticSize * @return string */ public function getPaymentMarkImageUrl($localeCode, $orderTotal = null, $pal = null, $staticSize = null) @@ -747,7 +745,7 @@ public function getPaymentMarkImageUrl($localeCode, $orderTotal = null, $pal = n * Get "What Is PayPal" localized URL * Supposed to be used with "mark" as popup window * - * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Core\Model\LocaleInterface|null $locale * @return string */ public function getPaymentMarkWhatIsPaypalUrl(\Magento\Core\Model\LocaleInterface $locale = null) @@ -871,7 +869,7 @@ public function getAdditionalOptionsLogoUrl($localeCode, $type = false) /** * BN code getter * - * @param string $countryCode ISO 3166-1 + * @param string|null $countryCode ISO 3166-1 * @return string */ public function getBuildNotationCode($countryCode = null) @@ -1127,6 +1125,7 @@ public function isCurrencyCodeSupported($code) * Export page style current settings to specified object * * @param \Magento\Object $to + * @return void */ public function exportExpressCheckoutStyleSettings(\Magento\Object $to) { @@ -1168,7 +1167,7 @@ protected function _getDynamicImageUrl($type, $localeCode, $orderTotal, $pal) /** * Check whether specified locale code is supported. Fallback to en_US * - * @param string $localeCode + * @param string|null $localeCode * @return string */ protected function _getSupportedLocaleCode($localeCode = null) @@ -1235,7 +1234,7 @@ protected function _getSpecificConfigPath($fieldName) /** * Check wheter specified country code is supported by build notation codes for specific countries * - * @param $code + * @param string $code * @return string|null */ private function _matchBnCountryCode($code) diff --git a/app/code/Magento/Paypal/Model/Config/Factory.php b/app/code/Magento/Paypal/Model/Config/Factory.php index db957e6e58241..77968a84d280f 100644 --- a/app/code/Magento/Paypal/Model/Config/Factory.php +++ b/app/code/Magento/Paypal/Model/Config/Factory.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Config; /** * Factory class for payment config */ -namespace Magento\Paypal\Model\Config; - class Factory { /** diff --git a/app/code/Magento/Paypal/Model/Direct.php b/app/code/Magento/Paypal/Model/Direct.php index 1871b9e74a17f..865ab76d76e9b 100644 --- a/app/code/Magento/Paypal/Model/Direct.php +++ b/app/code/Magento/Paypal/Model/Direct.php @@ -23,12 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; + +use Magento\Sales\Model\Order\Payment; /** * PayPal Direct Module */ -namespace Magento\Paypal\Model; - class Direct extends \Magento\Payment\Model\Method\Cc { /** @@ -41,22 +42,87 @@ class Direct extends \Magento\Payment\Model\Method\Cc */ protected $_infoBlockType = 'Magento\Paypal\Block\Payment\Info'; - /**#@+ - * Availability options + /** + * Availability option + * + * @var bool */ protected $_isGateway = true; + + /** + * Availability option + * + * @var bool + */ protected $_canAuthorize = true; + + /** + * Availability option + * + * @var bool + */ protected $_canCapture = true; + + /** + * Availability option + * + * @var bool + */ protected $_canCapturePartial = true; + + /** + * Availability option + * + * @var bool + */ protected $_canRefund = true; + + /** + * Availability option + * + * @var bool + */ protected $_canRefundInvoicePartial = true; + + /** + * Availability option + * + * @var bool + */ protected $_canVoid = true; + + /** + * Availability option + * + * @var bool + */ protected $_canUseInternal = true; + + /** + * Availability option + * + * @var bool + */ protected $_canUseCheckout = true; + + /** + * Availability option + * + * @var bool + */ protected $_canSaveCc = false; + + /** + * @var bool + */ protected $_canFetchTransactionInfo = true; + + /** + * Availability option + * + * @var bool + */ protected $_canReviewPayment = true; - /**#@-*/ /** * Website Payments Pro instance @@ -101,7 +167,7 @@ class Direct extends \Magento\Payment\Model\Method\Cc * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -112,14 +178,14 @@ class Direct extends \Magento\Payment\Model\Method\Cc * @param \Magento\App\RequestInterface $requestHttp * @param \Magento\Paypal\Model\CartFactory $cartFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, @@ -216,7 +282,8 @@ public function getAllowedCcTypes() /** * Check whether payment method can be used - * @param \Magento\Sales\Model\Quote + * + * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) @@ -231,8 +298,8 @@ public function isAvailable($quote = null) * Custom getter for payment configuration * * @param string $field - * @param int $storeId - * @return mixed + * @param int|null $storeId + * @return null|string */ public function getConfigData($field, $storeId = null) { @@ -251,9 +318,9 @@ public function getConfigData($field, $storeId = null) /** * Authorize payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Direct + * @return $this */ public function authorize(\Magento\Object $payment, $amount) { @@ -263,8 +330,8 @@ public function authorize(\Magento\Object $payment, $amount) /** * Void payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Direct + * @param \Magento\Object|Payment $payment + * @return $this */ public function void(\Magento\Object $payment) { @@ -275,9 +342,9 @@ public function void(\Magento\Object $payment) /** * Capture payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Direct + * @return $this */ public function capture(\Magento\Object $payment, $amount) { @@ -290,9 +357,9 @@ public function capture(\Magento\Object $payment, $amount) /** * Refund capture * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Direct + * @return $this */ public function refund(\Magento\Object $payment, $amount) { @@ -303,8 +370,8 @@ public function refund(\Magento\Object $payment, $amount) /** * Cancel payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Direct + * @param \Magento\Object|Payment $payment + * @return $this */ public function cancel(\Magento\Object $payment) { @@ -316,7 +383,7 @@ public function cancel(\Magento\Object $payment) /** * Whether payment can be reviewed * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Payment\Model\Info|Payment $payment * @return bool */ public function canReviewPayment(\Magento\Payment\Model\Info $payment) @@ -327,7 +394,7 @@ public function canReviewPayment(\Magento\Payment\Model\Info $payment) /** * Attempt to accept a pending payment * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Payment\Model\Info|Payment $payment * @return bool */ public function acceptPayment(\Magento\Payment\Model\Info $payment) @@ -339,7 +406,7 @@ public function acceptPayment(\Magento\Payment\Model\Info $payment) /** * Attempt to deny a pending payment * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Payment\Model\Info|Payment $payment * @return bool */ public function denyPayment(\Magento\Payment\Model\Info $payment) @@ -377,11 +444,11 @@ public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $tran /** * Place an order with authorization or capture action * - * @param \Magento\Sales\Model\Order\Payment $payment + * @param Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Direct + * @return $this */ - protected function _placeOrder(\Magento\Sales\Model\Order\Payment $payment, $amount) + protected function _placeOrder(Payment $payment, $amount) { $order = $payment->getOrder(); $api = $this->_pro->getApi() @@ -454,8 +521,9 @@ protected function _getFormattedCcExpirationDate($month, $year) /** * Import direct payment results to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param Payment $payment + * @return void */ protected function _importResultToPayment($api, $payment) { @@ -466,8 +534,8 @@ protected function _importResultToPayment($api, $payment) /** * Check void availability * - * @param \Magento\Object $payment - * @return bool + * @param \Magento\Object $payment + * @return bool */ public function canVoid(\Magento\Object $payment) { diff --git a/app/code/Magento/Paypal/Model/Express.php b/app/code/Magento/Paypal/Model/Express.php index 10f460e45bfc7..f4ca80fd5e147 100644 --- a/app/code/Magento/Paypal/Model/Express.php +++ b/app/code/Magento/Paypal/Model/Express.php @@ -23,12 +23,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; + +use Magento\Paypal\Model\Api\Nvp; +use Magento\RecurringProfile\Model\RecurringProfile; +use Magento\Sales\Model\Order\Payment; +use Magento\Sales\Model\Order\Payment\Transaction; +use Magento\Sales\Model\Quote; /** * PayPal Express Module */ -namespace Magento\Paypal\Model; - class Express extends \Magento\Payment\Model\Method\AbstractMethod implements \Magento\Payment\Model\Recurring\Profile\MethodInterface { @@ -55,19 +60,87 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod protected $_proType = 'Magento\Paypal\Model\Pro'; /** - * Availability options + * Availability option + * + * @var bool */ protected $_isGateway = false; + + /** + * Availability option + * + * @var bool + */ protected $_canOrder = true; + + /** + * Availability option + * + * @var bool + */ protected $_canAuthorize = true; + + /** + * Availability option + * + * @var bool + */ protected $_canCapture = true; + + /** + * Availability option + * + * @var bool + */ protected $_canCapturePartial = true; + + /** + * Availability option + * + * @var bool + */ protected $_canRefund = true; + + /** + * Availability option + * + * @var bool + */ protected $_canRefundInvoicePartial = true; + + /** + * Availability option + * + * @var bool + */ protected $_canVoid = true; + + /** + * Availability option + * + * @var bool + */ protected $_canUseInternal = false; + + /** + * Availability option + * + * @var bool + */ protected $_canUseCheckout = true; + + /** + * Availability option + * + * @var bool + */ protected $_canFetchTransactionInfo = true; + + /** + * Availability option + * + * @var bool + */ protected $_canReviewPayment = true; /** @@ -79,6 +152,7 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod /** * Payment additional information key for payment action + * * @var string */ protected $_isOrderPaymentActionKey = 'is_order_action'; @@ -114,7 +188,7 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\UrlInterface $urlBuilder @@ -125,7 +199,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\UrlInterface $urlBuilder, @@ -170,20 +244,20 @@ public function setStore($store) return $this; } - /** - * Can be used in regular checkout - * - * @return bool - */ - public function canUseCheckout() - { - if ($this->_coreStoreConfig->getConfigFlag('payment/hosted_pro/active') - && !$this->_coreStoreConfig->getConfigFlag('payment/hosted_pro/display_ec') - ) { - return false; - } - return parent::canUseCheckout(); - } + /** + * Can be used in regular checkout + * + * @return bool + */ + public function canUseCheckout() + { + if ($this->_coreStoreConfig->getConfigFlag('payment/hosted_pro/active') + && !$this->_coreStoreConfig->getConfigFlag('payment/hosted_pro/display_ec') + ) { + return false; + } + return parent::canUseCheckout(); + } /** * Whether method is available for specified currency @@ -209,7 +283,7 @@ public function getConfigPaymentAction() /** * Check whether payment method can be used - * @param \Magento\Sales\Model\Quote + * @param Quote|null $quote * @return bool */ public function isAvailable($quote = null) @@ -224,7 +298,7 @@ public function isAvailable($quote = null) * Custom getter for payment configuration * * @param string $field - * @param int $storeId + * @param int|null $storeId * @return mixed */ public function getConfigData($field, $storeId = null) @@ -235,9 +309,9 @@ public function getConfigData($field, $storeId = null) /** * Order payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Express + * @return $this */ public function order(\Magento\Object $payment, $amount) { @@ -265,7 +339,7 @@ public function order(\Magento\Object $payment, $amount) $message = __('Ordered amount of %1', $formattedPrice); } - $payment->addTransaction(\Magento\Sales\Model\Order\Payment\Transaction::TYPE_ORDER, null, false, $message); + $payment->addTransaction(Transaction::TYPE_ORDER, null, false, $message); $this->_pro->importPaymentInfo($api, $payment); @@ -287,7 +361,7 @@ public function order(\Magento\Object $payment, $amount) $payment->setTransactionId($api->getTransactionId()); $payment->setParentTransactionId($orderTransactionId); - $payment->addTransaction(\Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH, null, false, + $payment->addTransaction(Transaction::TYPE_AUTH, null, false, $message ); @@ -300,9 +374,9 @@ public function order(\Magento\Object $payment, $amount) /** * Authorize payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Express + * @return $this */ public function authorize(\Magento\Object $payment, $amount) { @@ -312,8 +386,8 @@ public function authorize(\Magento\Object $payment, $amount) /** * Void payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Express + * @param \Magento\Object|Payment $payment + * @return $this */ public function void(\Magento\Object $payment) { @@ -322,7 +396,7 @@ public function void(\Magento\Object $payment) && !$payment->getVoidOnlyAuthorization() ) { $orderTransaction = $payment->lookupTransaction( - false, \Magento\Sales\Model\Order\Payment\Transaction::TYPE_ORDER + false, Transaction::TYPE_ORDER ); if ($orderTransaction) { $payment->setParentTransactionId($orderTransaction->getTxnId()); @@ -336,10 +410,10 @@ public function void(\Magento\Object $payment) /** * Capture payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount * @throws \Magento\Core\Exception - * @return \Magento\Paypal\Model\Express + * @return $this */ public function capture(\Magento\Object $payment, $amount) { @@ -397,7 +471,7 @@ public function capture(\Magento\Object $payment, $amount) } $transaction = $payment->addTransaction( - \Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH, + Transaction::TYPE_AUTH, null, true, $message @@ -409,7 +483,7 @@ public function capture(\Magento\Object $payment, $amount) //close order transaction if needed if ($payment->getShouldCloseParentTransaction()) { $orderTransaction = $payment->lookupTransaction( - false, \Magento\Sales\Model\Order\Payment\Transaction::TYPE_ORDER + false, Transaction::TYPE_ORDER ); if ($orderTransaction) { @@ -433,9 +507,9 @@ public function capture(\Magento\Object $payment, $amount) /** * Refund capture * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Express + * @return $this */ public function refund(\Magento\Object $payment, $amount) { @@ -446,8 +520,8 @@ public function refund(\Magento\Object $payment, $amount) /** * Cancel payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Express + * @param \Magento\Object|Payment $payment + * @return $this */ public function cancel(\Magento\Object $payment) { @@ -459,7 +533,7 @@ public function cancel(\Magento\Object $payment) /** * Whether payment can be reviewed * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Payment\Model\Info|Payment $payment * @return bool */ public function canReviewPayment(\Magento\Payment\Model\Info $payment) @@ -470,7 +544,7 @@ public function canReviewPayment(\Magento\Payment\Model\Info $payment) /** * Attempt to accept a pending payment * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Payment\Model\Info|Payment $payment * @return bool */ public function acceptPayment(\Magento\Payment\Model\Info $payment) @@ -482,7 +556,7 @@ public function acceptPayment(\Magento\Payment\Model\Info $payment) /** * Attempt to deny a pending payment * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Payment\Model\Info|Payment $payment * @return bool */ public function denyPayment(\Magento\Payment\Model\Info $payment) @@ -495,7 +569,7 @@ public function denyPayment(\Magento\Payment\Model\Info $payment) * Checkout redirect URL getter for onepage checkout (hardcode) * * @see \Magento\Checkout\Controller\Onepage::savePaymentAction() - * @see \Magento\Sales\Model\Quote\Payment::getCheckoutRedirectUrl() + * @see Quote\Payment::getCheckoutRedirectUrl() * @return string */ public function getCheckoutRedirectUrl() @@ -518,9 +592,10 @@ public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $tran /** * Validate RP data * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile + * @return null */ - public function validateRecurringProfile(\Magento\RecurringProfile\Model\RecurringProfile $profile) + public function validateRecurringProfile(RecurringProfile $profile) { return $this->_pro->validateRecurringProfile($profile); } @@ -528,10 +603,11 @@ public function validateRecurringProfile(\Magento\RecurringProfile\Model\Recurri /** * Submit RP to the gateway * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile * @param \Magento\Payment\Model\Info $paymentInfo + * @return void */ - public function submitRecurringProfile(\Magento\RecurringProfile\Model\RecurringProfile $profile, + public function submitRecurringProfile(RecurringProfile $profile, \Magento\Payment\Model\Info $paymentInfo ) { $token = $paymentInfo->getAdditionalInformation( @@ -546,6 +622,7 @@ public function submitRecurringProfile(\Magento\RecurringProfile\Model\Recurring * * @param string $referenceId * @param \Magento\Object $result + * @return null */ public function getRecurringProfileDetails($referenceId, \Magento\Object $result) { @@ -554,6 +631,8 @@ public function getRecurringProfileDetails($referenceId, \Magento\Object $result /** * Whether can get recurring profile details + * + * @return true */ public function canGetRecurringProfileDetails() { @@ -563,9 +642,10 @@ public function canGetRecurringProfileDetails() /** * Update RP data * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile + * @return null */ - public function updateRecurringProfile(\Magento\RecurringProfile\Model\RecurringProfile $profile) + public function updateRecurringProfile(RecurringProfile $profile) { return $this->_pro->updateRecurringProfile($profile); } @@ -573,9 +653,10 @@ public function updateRecurringProfile(\Magento\RecurringProfile\Model\Recurring /** * Manage status * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile + * @return null */ - public function updateRecurringProfileStatus(\Magento\RecurringProfile\Model\RecurringProfile $profile) + public function updateRecurringProfileStatus(RecurringProfile $profile) { return $this->_pro->updateRecurringProfileStatus($profile); } @@ -583,8 +664,8 @@ public function updateRecurringProfileStatus(\Magento\RecurringProfile\Model\Rec /** * Assign data to info model instance * - * @param mixed $data - * @return \Magento\Payment\Model\Info + * @param array|\Magento\Object $data + * @return \Magento\Payment\Model\Info */ public function assignData($data) { @@ -592,8 +673,7 @@ public function assignData($data) $key = \Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT; if (is_array($data)) { $this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null); - } - elseif ($data instanceof \Magento\Object) { + } elseif ($data instanceof \Magento\Object) { $this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key)); } return $result; @@ -602,11 +682,11 @@ public function assignData($data) /** * Place an order with authorization or capture action * - * @param \Magento\Sales\Model\Order\Payment $payment + * @param Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Express + * @return $this */ - protected function _placeOrder(\Magento\Sales\Model\Order\Payment $payment, $amount) + protected function _placeOrder(Payment $payment, $amount) { $order = $payment->getOrder(); @@ -643,8 +723,9 @@ protected function _placeOrder(\Magento\Sales\Model\Order\Payment $payment, $amo /** * Import payment info to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param Nvp $api + * @param Payment $payment + * @return void */ protected function _importToPayment($api, $payment) { @@ -665,8 +746,8 @@ protected function _importToPayment($api, $payment) /** * Check void availability * - * @param \Magento\Object $payment - * @return bool + * @param \Magento\Object $payment + * @return bool */ public function canVoid(\Magento\Object $payment) { @@ -678,7 +759,7 @@ public function canVoid(\Magento\Object $payment) $info = $this->getInfoInstance(); if ($info->getAdditionalInformation($this->_isOrderPaymentActionKey)) { $orderTransaction = $info->lookupTransaction( - false, \Magento\Sales\Model\Order\Payment\Transaction::TYPE_ORDER); + false, Transaction::TYPE_ORDER); if ($orderTransaction) { $info->setParentTransactionId($orderTransaction->getTxnId()); } @@ -699,7 +780,7 @@ public function canCapture() if ($payment->getAdditionalInformation($this->_isOrderPaymentActionKey)) { $orderTransaction = $payment->lookupTransaction(false, - \Magento\Sales\Model\Order\Payment\Transaction::TYPE_ORDER); + Transaction::TYPE_ORDER); if ($orderTransaction->getIsClosed()) { return false; } @@ -742,11 +823,11 @@ protected function _callDoAuthorize($amount, $payment, $parentTransactionId) /** * Check transaction for expiration in PST * - * @param \Magento\Sales\Model\Order\Payment\Transaction $transaction + * @param Transaction $transaction * @param int $period - * @return boolean + * @return bool */ - protected function _isTransactionExpired(\Magento\Sales\Model\Order\Payment\Transaction $transaction, $period) + protected function _isTransactionExpired(Transaction $transaction, $period) { $period = intval($period); if (0 == $period) { diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 485d103380f45..6f4090499c3c2 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -23,13 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Express; + +use Magento\Sales\Model\Quote\Address; +use Magento\Customer\Model\Customer; /** * Wrapper that performs Paypal Express and Checkout communication * Use current Paypal Express method instance */ -namespace Magento\Paypal\Model\Express; - class Checkout { /** @@ -83,12 +85,24 @@ class Checkout protected $_methodType = \Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS; /** - * State helper variables + * State helper variable * * @var string */ protected $_redirectUrl = ''; + + /** + * State helper variable + * + * @var string + */ protected $_pendingPaymentMessage = ''; + + /** + * State helper variable + * + * @var string + */ protected $_checkoutRedirectUrl = ''; /** @@ -195,7 +209,7 @@ class Checkout protected $_cartFactory; /** - * @var \Magento\Core\Model\Log\AdapterFactory + * @var \Magento\Logger\AdapterFactory */ protected $_logFactory; @@ -229,6 +243,11 @@ class Checkout */ protected $_checkoutSession; + /** + * @var \Magento\RecurringProfile\Model\Quote + */ + protected $_quoteImporter; + /** * Set config, session and quote instances * @@ -243,13 +262,14 @@ class Checkout * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\UrlInterface $coreUrl * @param \Magento\Paypal\Model\CartFactory $cartFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logFactory + * @param \Magento\Logger\AdapterFactory $logFactory * @param \Magento\Checkout\Model\Type\OnepageFactory $onepageFactory * @param \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Paypal\Model\Api\Type\Factory $apiTypeFactory * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\RecurringProfile\Model\QuoteImporter $quoteImporter * @param array $params * @throws \Exception */ @@ -265,13 +285,14 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\UrlInterface $coreUrl, \Magento\Paypal\Model\CartFactory $cartFactory, - \Magento\Core\Model\Log\AdapterFactory $logFactory, + \Magento\Logger\AdapterFactory $logFactory, \Magento\Checkout\Model\Type\OnepageFactory $onepageFactory, \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Paypal\Model\Api\Type\Factory $apiTypeFactory, \Magento\Object\Copy $objectCopyService, \Magento\Checkout\Model\Session $checkoutSession, + \Magento\RecurringProfile\Model\QuoteImporter $quoteImporter, $params = array() ) { $this->_customerData = $customerData; @@ -292,6 +313,7 @@ public function __construct( $this->_apiTypeFactory = $apiTypeFactory; $this->_objectCopyService = $objectCopyService; $this->_checkoutSession = $checkoutSession; + $this->_quoteImporter = $quoteImporter; if (isset($params['config']) && $params['config'] instanceof \Magento\Paypal\Model\Config) { $this->_config = $params['config']; @@ -330,7 +352,7 @@ public function getCheckoutShortcutImageUrl() $this->_configCacheType->save($pal, $cacheId); } catch (\Exception $e) { $this->_configCacheType->save(self::PAL_CACHE_ID, $cacheId); - $this->_logger->logException($e); + $this->_logger->logException($e); } } } @@ -348,7 +370,7 @@ public function getCheckoutShortcutImageUrl() * @param string $successUrl - payment success result * @param string $cancelUrl - payment cancellation result * @param string $pendingUrl - pending payment result - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ public function prepareGiropayUrls($successUrl, $cancelUrl, $pendingUrl) { @@ -360,7 +382,7 @@ public function prepareGiropayUrls($successUrl, $cancelUrl, $pendingUrl) * Set create billing agreement flag * * @param bool $flag - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ public function setIsBillingAgreementRequested($flag) { @@ -371,8 +393,8 @@ public function setIsBillingAgreementRequested($flag) /** * Setter for customer * - * @param \Magento\Customer\Model\Customer $customer - * @return \Magento\Paypal\Model\Express\Checkout + * @param Customer $customer + * @return $this */ public function setCustomer($customer) { @@ -384,10 +406,10 @@ public function setCustomer($customer) /** * Setter for customer with billing and shipping address changing ability * - * @param \Magento\Customer\Model\Customer $customer - * @param \Magento\Sales\Model\Quote\Address $billingAddress - * @param \Magento\Sales\Model\Quote\Address $shippingAddress - * @return \Magento\Paypal\Model\Express\Checkout + * @param Customer $customer + * @param Address|null $billingAddress + * @param Address|null $shippingAddress + * @return $this */ public function setCustomerWithAddressChange($customer, $billingAddress = null, $shippingAddress = null) { @@ -480,7 +502,7 @@ public function start($returnUrl, $cancelUrl) } // add recurring payment profiles information - $profiles = $this->_quote->prepareRecurringPaymentProfiles(); + $profiles = $this->_quoteImporter->prepareRecurringPaymentProfiles($this->_quote); if ($profiles) { foreach ($profiles as $profile) { $profile->setMethodCode(\Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS); @@ -510,6 +532,7 @@ public function start($returnUrl, $cancelUrl) * export shipping address in case address absence * * @param string $token + * @return void */ public function returnFromPaypal($token) { @@ -571,7 +594,8 @@ public function returnFromPaypal($token) /** * Check whether order review has enough data to initialize * - * @param $token + * @param string|null $token + * @return void * @throws \Magento\Core\Exception */ public function prepareOrderReview($token = null) @@ -632,7 +656,9 @@ public function getShippingOptionsCallbackResponse(array $request) /** * Set shipping method to quote, if needed + * * @param string $methodCode + * @return void */ public function updateShippingMethod($methodCode) { @@ -649,6 +675,7 @@ public function updateShippingMethod($methodCode) * Update order data * * @param array $data + * @return void */ public function updateOrder($data) { @@ -677,11 +704,12 @@ public function updateOrder($data) } /** - * Place the order and recurring payment profiles when customer returned from paypal + * Place the order when customer returned from paypal * Until this moment all quote data must be valid * * @param string $token - * @param string $shippingMethodCode + * @param string|null $shippingMethodCode + * @return void */ public function place($token, $shippingMethodCode = null) { @@ -718,9 +746,6 @@ public function place($token, $shippingMethodCode = null) } } - $this->_recurringPaymentProfiles = $service->getRecurringPaymentProfiles(); - // TODO: send recurring profile emails - $order = $service->getOrder(); if (!$order) { return; @@ -752,6 +777,8 @@ public function place($token, $shippingMethodCode = null) /** * Make sure addresses will be saved without validation errors + * + * @return void */ private function _ignoreAddressValidation() { @@ -774,16 +801,6 @@ public function getRedirectUrl() return $this->_redirectUrl; } - /** - * Return recurring payment profiles - * - * @return array - */ - public function getRecurringPaymentProfiles() - { - return $this->_recurringPaymentProfiles; - } - /** * Get created billing agreement * @@ -827,8 +844,9 @@ public function getCheckoutMethod() /** * Sets address data from exported address * - * @param \Magento\Sales\Model\Quote\Address $address + * @param Address $address * @param array $exportedAddress + * @return void */ protected function _setExportedAddressData($address, $exportedAddress) { @@ -836,8 +854,8 @@ protected function _setExportedAddressData($address, $exportedAddress) $oldData = $address->getDataUsingMethod($key); $isEmpty = null; if (is_array($oldData)) { - foreach($oldData as $val) { - if(!empty($val)) { + foreach ($oldData as $val) { + if (!empty($val)) { $isEmpty = false; break; } @@ -853,7 +871,7 @@ protected function _setExportedAddressData($address, $exportedAddress) /** * Set create billing agreement flag to api call * - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ protected function _setBillingAgreementRequest() { @@ -893,13 +911,13 @@ protected function _getApi() * Returns empty array if it was impossible to obtain any shipping rate * If there are shipping rates obtained, the method must return one of them as default. * - * @param \Magento\Sales\Model\Quote\Address $address + * @param Address $address * @param bool $mayReturnEmpty * @param bool $calculateTax * @return array|false */ protected function _prepareShippingOptions( - \Magento\Sales\Model\Quote\Address $address, + Address $address, $mayReturnEmpty = false, $calculateTax = false ) { $options = array(); $i = 0; $iMin = false; $min = false; @@ -973,7 +991,7 @@ protected function _prepareShippingOptions( * * @param \Magento\Object $option1 * @param \Magento\Object $option2 - * @return integer + * @return int */ protected static function cmpShippingOptions(\Magento\Object $option1, \Magento\Object $option2) { @@ -989,11 +1007,11 @@ protected static function cmpShippingOptions(\Magento\Object $option1, \Magento\ * If in future the issue is fixed, we don't need to attempt to match it. It would be enough to set the method code * before collecting shipping rates * - * @param \Magento\Sales\Model\Quote\Address $address + * @param Address $address * @param string $selectedCode * @return string */ - protected function _matchShippingMethodCode(\Magento\Sales\Model\Quote\Address $address, $selectedCode) + protected function _matchShippingMethodCode(Address $address, $selectedCode) { $options = $this->_prepareShippingOptions($address, false); foreach ($options as $option) { @@ -1011,7 +1029,7 @@ protected function _matchShippingMethodCode(\Magento\Sales\Model\Quote\Address $ /** * Prepare quote for guest checkout order submit * - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ protected function _prepareGuestQuote() { @@ -1027,7 +1045,7 @@ protected function _prepareGuestQuote() * Prepare quote for customer registration and customer order submit * and restore magento customer data from quote * - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ protected function _prepareNewCustomerQuote() { @@ -1036,7 +1054,7 @@ protected function _prepareNewCustomerQuote() $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress(); $customer = $quote->getCustomer(); - /** @var $customer \Magento\Customer\Model\Customer */ + /** @var $customer Customer */ $customerBilling = $billing->exportCustomerAddress(); $customer->addAddress($customerBilling); $billing->setCustomerAddress($customerBilling); @@ -1082,7 +1100,7 @@ protected function _prepareNewCustomerQuote() /** * Prepare quote for customer order submit * - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ protected function _prepareCustomerQuote() { @@ -1119,7 +1137,7 @@ protected function _prepareCustomerQuote() /** * Involve new customer to system * - * @return \Magento\Paypal\Model\Express\Checkout + * @return $this */ protected function _involveNewCustomer() { diff --git a/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php b/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php index f25aed95b5c12..53d746e0d39b5 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Express\Checkout; /** * Factory class for \Magento\Paypal\Model\Express\Checkout */ -namespace Magento\Paypal\Model\Express\Checkout; - class Factory { /** diff --git a/app/code/Magento/Paypal/Model/Hostedpro.php b/app/code/Magento/Paypal/Model/Hostedpro.php index ba34e09d5e66d..3b80c9d6c089e 100644 --- a/app/code/Magento/Paypal/Model/Hostedpro.php +++ b/app/code/Magento/Paypal/Model/Hostedpro.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * Website Payments Pro Hosted Solution payment gateway model */ -namespace Magento\Paypal\Model; - class Hostedpro extends \Magento\Paypal\Model\Direct { /** @@ -63,13 +62,26 @@ class Hostedpro extends \Magento\Paypal\Model\Direct */ protected $_infoBlockType = 'Magento\Paypal\Block\Hosted\Pro\Info'; - /**#@+ - * Availability options + /** + * Availability option + * + * @var bool */ protected $_canUseInternal = false; + + /** + * Availability option + * + * @var bool + */ protected $_canSaveCc = false; + + /** + * Availability option + * + * @var bool + */ protected $_isInitializeNeeded = true; - /**#@-*/ /** * @var \Magento\Paypal\Model\Hostedpro\RequestFactory @@ -80,7 +92,7 @@ class Hostedpro extends \Magento\Paypal\Model\Direct * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -92,14 +104,14 @@ class Hostedpro extends \Magento\Paypal\Model\Direct * @param \Magento\Paypal\Model\CartFactory $cartFactory * @param \Magento\Paypal\Model\Hostedpro\RequestFactory $hostedproRequestFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, @@ -135,7 +147,7 @@ public function __construct( * Return available CC types for gateway based on merchant country. * We do not have to check the availability of card types. * - * @return bool + * @return true */ public function getAllowedCcTypes() { @@ -156,7 +168,7 @@ public function getMerchantCountry() /** * Do not validate payment form using server methods * - * @return bool + * @return true */ public function validate() { @@ -168,7 +180,7 @@ public function validate() * * @param string $paymentAction * @param \Magento\Object $stateObject - * @return \Magento\Payment\Model\Method\AbstractMethod|void + * @return void */ public function initialize($paymentAction, $stateObject) { @@ -196,6 +208,7 @@ public function initialize($paymentAction, $stateObject) * Sends API request to PayPal to get form URL, then sets this URL to $payment object. * * @param \Magento\Payment\Model\Info $payment + * @return void * @throws \Magento\Core\Exception */ protected function _setPaymentFormUrl(\Magento\Payment\Model\Info $payment) @@ -228,7 +241,7 @@ protected function _buildFormUrlRequest(\Magento\Payment\Model\Info $payment) * Returns form URL from request to PayPal. * * @param \Magento\Paypal\Model\Hostedpro\Request $request - * @return string | false + * @return string|false */ protected function _sendFormUrlRequest(\Magento\Paypal\Model\Hostedpro\Request $request) { @@ -259,7 +272,7 @@ protected function _buildBasicRequest() /** * Get return URL * - * @param int $storeId + * @param int|null $storeId * @return string */ public function getReturnUrl($storeId = null) @@ -270,7 +283,7 @@ public function getReturnUrl($storeId = null) /** * Get notify (IPN) URL * - * @param int $storeId + * @param int|null $storeId * @return string */ public function getNotifyUrl($storeId = null) @@ -281,7 +294,7 @@ public function getNotifyUrl($storeId = null) /** * Get cancel URL * - * @param int $storeId + * @param int|null $storeId * @return string */ public function getCancelUrl($storeId = null) @@ -294,7 +307,7 @@ public function getCancelUrl($storeId = null) * * @param string $path * @param int $storeId - * @param bool $secure + * @param bool|null $secure * @return string */ protected function _getUrl($path, $storeId, $secure = null) diff --git a/app/code/Magento/Paypal/Model/Hostedpro/Request.php b/app/code/Magento/Paypal/Model/Hostedpro/Request.php index 17535f1c1ebee..d7cc75f5d98b4 100644 --- a/app/code/Magento/Paypal/Model/Hostedpro/Request.php +++ b/app/code/Magento/Paypal/Model/Hostedpro/Request.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Hostedpro; /** * Website Payments Pro Hosted Solution request model to get token. @@ -31,9 +32,6 @@ * @package Magento_Paypal * @author Magento Core Team */ - -namespace Magento\Paypal\Model\Hostedpro; - class Request extends \Magento\Object { /** @@ -60,7 +58,7 @@ class Request extends \Magento\Object /** * Request Parameters which dont have to wrap as button vars * - * @var array + * @var string[] */ protected $_notButtonVars = array ( 'METHOD', 'BUTTONCODE', 'BUTTONTYPE'); @@ -116,7 +114,7 @@ public function getRequestData() * Append payment data to request * * @param \Magento\Paypal\Model\Hostedpro $paymentMethod - * @return \Magento\Paypal\Model\Hostedpro\Request + * @return $this */ public function setPaymentMethod($paymentMethod) { @@ -131,7 +129,7 @@ public function setPaymentMethod($paymentMethod) * Append order data to request * * @param \Magento\Sales\Model\Order $order - * @return \Magento\Paypal\Model\Hostedpro\Request + * @return $this */ public function setOrder($order) { @@ -263,7 +261,7 @@ protected function _getBillingAddress(\Magento\Object $address) * Format price string * * @param mixed $string - * @return mixed + * @return string */ protected function _formatPrice($string) { diff --git a/app/code/Magento/Paypal/Model/Info.php b/app/code/Magento/Paypal/Model/Info.php index 9bce1462a6fcd..155462d3c1478 100644 --- a/app/code/Magento/Paypal/Model/Info.php +++ b/app/code/Magento/Paypal/Model/Info.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * PayPal payment information model @@ -31,8 +32,6 @@ * Collects and provides access to PayPal-specific payment data * Provides business logic information about payment flow */ -namespace Magento\Paypal\Model; - class Info { /** @@ -147,7 +146,7 @@ class Info /** * Map of payment information available to customer * - * @var array + * @var string[] */ protected $_paymentPublicMap = array( 'paypal_payer_email', @@ -203,6 +202,7 @@ public function getPublicPaymentInfo(\Magento\Payment\Model\Info $payment, $labe * * @param array|\Magento\Object|callback $from * @param \Magento\Payment\Model\Info $payment + * @return void */ public function importToPayment($from, \Magento\Payment\Model\Info $payment) { @@ -218,7 +218,7 @@ public function importToPayment($from, \Magento\Payment\Model\Info $payment) * * @param \Magento\Payment\Model\Info $payment * @param array|\Magento\Object|callback $to - * @param array $map + * @param array|null $map * @return array|\Magento\Object */ public function &exportFromPayment(\Magento\Payment\Model\Info $payment, $to, array $map = null) @@ -347,7 +347,7 @@ public static function explainPendingReason($code) /** * Explain the refund or chargeback reason code * - * @param $code + * @param string $code * @return string * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails @@ -411,6 +411,7 @@ public static function isReversalDisputable($code) * @param array $keys * @param \Magento\Payment\Model\Info $payment * @param bool $labelValuesOnly + * @return array */ protected function _getFullInfo(array $keys, \Magento\Payment\Model\Info $payment, $labelValuesOnly) { @@ -444,6 +445,7 @@ protected function _getFullInfo(array $keys, \Magento\Payment\Model\Info $paymen * Render info item labels * * @param string $key + * @return string */ protected function _getLabel($key) { @@ -532,9 +534,9 @@ protected function _getValue($value, $key) /** * Attempt to convert AVS check result code into label * - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_AVSResponseCodes * @param string $value * @return string + * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_AVSResponseCodes */ protected function _getAvsLabel($value) { @@ -596,9 +598,9 @@ protected function _getAvsLabel($value) /** * Attempt to convert CVV2 check result code into label * - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_AVSResponseCodes * @param string $value * @return string + * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_AVSResponseCodes */ protected function _getCvv2Label($value) { @@ -635,9 +637,9 @@ protected function _getCvv2Label($value) /** * Attempt to convert centinel VPAS result into label * - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoDirectPayment * @param string $value * @return string + * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoDirectPayment */ private function _getCentinelVpasLabel($value) { @@ -669,9 +671,9 @@ private function _getCentinelVpasLabel($value) /** * Attempt to convert centinel ECI result into label * - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoDirectPayment * @param string $value * @return string + * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoDirectPayment */ private function _getCentinelEciLabel($value) { diff --git a/app/code/Magento/Paypal/Model/Ipn.php b/app/code/Magento/Paypal/Model/Ipn.php index 7b9e8ca4660a0..0879260a4f4d9 100644 --- a/app/code/Magento/Paypal/Model/Ipn.php +++ b/app/code/Magento/Paypal/Model/Ipn.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * PayPal Instant Payment Notification processor model */ -namespace Magento\Paypal\Model; - class Ipn { /** @@ -37,7 +36,9 @@ class Ipn const DEFAULT_LOG_FILE = 'paypal_unknown_ipn.log'; /** - * @param \Magento\Sales\Model\Order + * Sales order + * + * @var \Magento\Sales\Model\Order */ protected $_order; @@ -100,7 +101,7 @@ class Ipn * @param \Magento\Paypal\Model\ConfigFactory $configFactory * @param \Magento\RecurringProfile\Model\ProfileFactory $recurringProfileFactory * @param \Magento\Paypal\Model\Info $paypalInfo - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory */ public function __construct( \Magento\Sales\Model\OrderFactory $orderFactory, @@ -108,7 +109,7 @@ public function __construct( \Magento\Paypal\Model\ConfigFactory $configFactory, \Magento\RecurringProfile\Model\ProfileFactory $recurringProfileFactory, \Magento\Paypal\Model\Info $paypalInfo, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + \Magento\Logger\AdapterFactory $logAdapterFactory ) { $this->_orderFactory = $orderFactory; $this->_responseHttp = $responseHttp; @@ -121,7 +122,7 @@ public function __construct( /** * IPN request data getter * - * @param string $key + * @param string|null $key * @return array|string */ public function getRequestData($key = null) @@ -136,7 +137,8 @@ public function getRequestData($key = null) * Get ipn data, send verification to PayPal, run corresponding handler * * @param array $request - * @param \Zend_Http_Client_Adapter_Interface $httpAdapter + * @param \Zend_Http_Client_Adapter_Interface|null $httpAdapter + * @return void * @throws \Exception */ public function processIpnRequest(array $request, \Zend_Http_Client_Adapter_Interface $httpAdapter = null) @@ -171,6 +173,7 @@ public function processIpnRequest(array $request, \Zend_Http_Client_Adapter_Inte * Post back to PayPal to check whether this request is a valid one * * @param \Zend_Http_Client_Adapter_Interface $httpAdapter + * @return void * @throws \Exception */ protected function _postBack(\Zend_Http_Client_Adapter_Interface $httpAdapter) @@ -200,7 +203,6 @@ protected function _postBack(\Zend_Http_Client_Adapter_Interface $httpAdapter) /** * Load and validate order, instantiate proper configuration * - * * @return \Magento\Sales\Model\Order * @throws \Exception */ @@ -262,6 +264,7 @@ protected function _getRecurringProfile() * Validate incoming request data, as PayPal recommends * * @throws \Exception + * @return void * @link https://cms.paypal.com/cgi-bin/marketingweb?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro */ protected function _verifyOrder() @@ -287,6 +290,8 @@ protected function _verifyOrder() * IPN workflow implementation * Everything should be added to order comments. In positive processing cases customer will get email notifications. * Admin will be notified on errors. + * + * @return void */ protected function _processOrder() { @@ -320,6 +325,8 @@ protected function _processOrder() /** * Process adjustment notification + * + * @return void */ protected function _registerAdjustment() { @@ -342,6 +349,8 @@ protected function _registerAdjustment() /** * Process dispute notification + * + * @return void */ protected function _registerDispute() { @@ -367,6 +376,8 @@ protected function _registerDispute() /** * Process payment reversal and cancelled reversal notification + * + * @return void */ protected function _registerPaymentReversal() { @@ -402,6 +413,8 @@ protected function _registerPaymentReversal() /** * Process regular IPN notifications + * + * @return void */ protected function _registerTransaction() { @@ -460,6 +473,8 @@ protected function _registerTransaction() /** * Process notification from recurring profile payments + * + * @return void */ protected function _processRecurringProfile() { @@ -516,6 +531,8 @@ protected function _processRecurringProfile() /** * Process completed payment (either full or partial) + * + * @return void */ protected function _registerPaymentCapture() { @@ -545,6 +562,8 @@ protected function _registerPaymentCapture() /** * Process denied payment notification + * + * @return void */ protected function _registerPaymentDenial() { @@ -559,6 +578,8 @@ protected function _registerPaymentDenial() /** * Treat failed payment as order cancellation + * + * @return void */ protected function _registerPaymentFailure() { @@ -570,6 +591,8 @@ protected function _registerPaymentFailure() /** * Process a refund + * + * @return void */ protected function _registerPaymentRefund() { @@ -598,6 +621,7 @@ protected function _registerPaymentRefund() /** * Process payment pending notification * + * @return void * @throws \Exception */ public function _registerPaymentPending() @@ -629,6 +653,8 @@ public function _registerPaymentPending() /** * Register authorized payment + * + * @return void */ protected function _registerPaymentAuthorization() { @@ -653,6 +679,8 @@ protected function _registerPaymentAuthorization() /** * Process voided authorization + * + * @return void */ protected function _registerPaymentVoid() { @@ -671,6 +699,8 @@ protected function _registerPaymentVoid() /** * The status "Processed" is used when all Masspayments are successful + * + * @return void */ protected function _registerMasspaymentsSuccess() { @@ -787,14 +817,16 @@ protected function _filterPaymentStatus($ipnPaymentStatus) case 'Voided': return \Magento\Paypal\Model\Info::PAYMENTSTATUS_VOIDED; } return ''; -// documented in NVP, but not documented in IPN: -//Magento_Paypal_Model_Info::PAYMENTSTATUS_NONE -//Magento_Paypal_Model_Info::PAYMENTSTATUS_INPROGRESS -//Magento_Paypal_Model_Info::PAYMENTSTATUS_REFUNDEDPART + // documented in NVP, but not documented in IPN: + //Magento_Paypal_Model_Info::PAYMENTSTATUS_NONE + //Magento_Paypal_Model_Info::PAYMENTSTATUS_INPROGRESS + //Magento_Paypal_Model_Info::PAYMENTSTATUS_REFUNDEDPART } /** * Log debug data to file + * + * @return void */ protected function _debug() { diff --git a/app/code/Magento/Paypal/Model/Method/Agreement.php b/app/code/Magento/Paypal/Model/Method/Agreement.php index efb05fde88117..6deaf7ea65f05 100644 --- a/app/code/Magento/Paypal/Model/Method/Agreement.php +++ b/app/code/Magento/Paypal/Model/Method/Agreement.php @@ -23,12 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Method; + +use Magento\Core\Model\Store; +use Magento\Payment\Model\Info; +use Magento\Sales\Model\Order\Payment; /** * Paypal Billing Agreement method */ -namespace Magento\Paypal\Model\Method; - class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement implements \Magento\Paypal\Model\Billing\Agreement\MethodInterface { @@ -40,17 +43,73 @@ class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgr protected $_code = \Magento\Paypal\Model\Config::METHOD_BILLING_AGREEMENT; /** - * Method instance settings + * Method instance setting + * + * @var bool */ protected $_canAuthorize = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canCapture = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canCapturePartial = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canRefund = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canRefundInvoicePartial = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canVoid = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canUseCheckout = false; + + /** + * Method instance setting + * + * @var bool + */ protected $_canUseInternal = false; + + /** + * Method instance setting + * + * @var bool + */ protected $_canFetchTransactionInfo = true; + + /** + * Method instance setting + * + * @var bool + */ protected $_canReviewPayment = true; /** @@ -79,10 +138,10 @@ class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgr * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory - * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\UrlInterface $urlBuilder * @param \Magento\Paypal\Model\CartFactory $cartFactory * @param array $data @@ -93,7 +152,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, @@ -125,8 +184,7 @@ public function __construct( * Store setter * Also updates store ID in config object * - * @param \Magento\Core\Model\Store|int $store - * @return $this + * @param Store|int $store * @return $this */ public function setStore($store) @@ -143,7 +201,7 @@ public function setStore($store) * Init billing agreement * * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this */ public function initBillingAgreementToken(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) { @@ -184,7 +242,7 @@ public function getBillingAgreementTokenInfo(\Magento\Paypal\Model\Billing\Abstr * Create billing agreement by token specified in request * * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this */ public function placeBillingAgreement(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) { @@ -199,7 +257,7 @@ public function placeBillingAgreement(\Magento\Paypal\Model\Billing\AbstractAgre * Update billing agreement status * * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this * @throws \Exception|\Magento\Core\Exception */ public function updateBillingAgreementStatus(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) @@ -225,7 +283,7 @@ public function updateBillingAgreementStatus(\Magento\Paypal\Model\Billing\Abstr * * @param \Magento\Object $payment * @param float $amount - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this */ public function authorize(\Magento\Object $payment, $amount) { @@ -235,8 +293,8 @@ public function authorize(\Magento\Object $payment, $amount) /** * Void payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Method\Agreement + * @param \Magento\Object|Payment $payment + * @return $this */ public function void(\Magento\Object $payment) { @@ -247,9 +305,9 @@ public function void(\Magento\Object $payment) /** * Capture payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this */ public function capture(\Magento\Object $payment, $amount) { @@ -262,9 +320,9 @@ public function capture(\Magento\Object $payment, $amount) /** * Refund capture * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this */ public function refund(\Magento\Object $payment, $amount) { @@ -275,8 +333,8 @@ public function refund(\Magento\Object $payment, $amount) /** * Cancel payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Method\Agreement + * @param \Magento\Object|Payment $payment + * @return $this */ public function cancel(\Magento\Object $payment) { @@ -287,10 +345,10 @@ public function cancel(\Magento\Object $payment) /** * Whether payment can be reviewed * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param Info|Payment $payment * @return bool */ - public function canReviewPayment(\Magento\Payment\Model\Info $payment) + public function canReviewPayment(Info $payment) { return parent::canReviewPayment($payment) && $this->_pro->canReviewPayment($payment); } @@ -298,10 +356,10 @@ public function canReviewPayment(\Magento\Payment\Model\Info $payment) /** * Attempt to accept a pending payment * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param Info|Payment $payment * @return bool */ - public function acceptPayment(\Magento\Payment\Model\Info $payment) + public function acceptPayment(Info $payment) { parent::acceptPayment($payment); return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_ACCEPT); @@ -310,10 +368,10 @@ public function acceptPayment(\Magento\Payment\Model\Info $payment) /** * Attempt to deny a pending payment * - * @param \Magento\Payment\Model\Info|\Magento\Sales\Model\Order\Payment $payment + * @param Info|Payment $payment * @return bool */ - public function denyPayment(\Magento\Payment\Model\Info $payment) + public function denyPayment(Info $payment) { parent::denyPayment($payment); return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_DENY); @@ -322,11 +380,11 @@ public function denyPayment(\Magento\Payment\Model\Info $payment) /** * Fetch transaction details info * - * @param \Magento\Payment\Model\Info $payment + * @param Info $payment * @param string $transactionId * @return array */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) + public function fetchTransactionInfo(Info $payment, $transactionId) { return $this->_pro->fetchTransactionInfo($payment, $transactionId); } @@ -334,11 +392,11 @@ public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $tran /** * Place an order with authorization or capture action * - * @param \Magento\Sales\Model\Order\Payment $payment + * @param Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Method\Agreement + * @return $this */ - protected function _placeOrder(\Magento\Sales\Model\Order\Payment $payment, $amount) + protected function _placeOrder(Payment $payment, $amount) { $order = $payment->getOrder(); /** @var \Magento\Paypal\Model\Billing\Agreement $billingAgreement */ @@ -398,5 +456,4 @@ public function getConfigPaymentAction() { return $this->_pro->getConfig()->getPaymentAction(); } - } diff --git a/app/code/Magento/Paypal/Model/Method/ProTypeFactory.php b/app/code/Magento/Paypal/Model/Method/ProTypeFactory.php index 49f96479b3019..16621ed818588 100644 --- a/app/code/Magento/Paypal/Model/Method/ProTypeFactory.php +++ b/app/code/Magento/Paypal/Model/Method/ProTypeFactory.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Method; /** * Factory class for payment method model */ -namespace Magento\Paypal\Model\Method; - class ProTypeFactory { /** @@ -53,7 +52,7 @@ public function __construct(\Magento\ObjectManager $objectManager) * * @param string $className * @param array $data - * @return object + * @return \Magento\Object */ public function create($className, array $data = array()) { diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php index 260db1eb83189..f26149c76ae33 100644 --- a/app/code/Magento/Paypal/Model/Observer.php +++ b/app/code/Magento/Paypal/Model/Observer.php @@ -23,18 +23,19 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; + +use Magento\Event\Observer as EventObserver; /** * PayPal module observer */ -namespace Magento\Paypal\Model; - class Observer { /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -85,7 +86,7 @@ class Observer /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Paypal\Helper\Hss $paypalHss - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param Report\SettlementFactory $settlementFactory * @param \Magento\App\ViewInterface $view @@ -96,7 +97,7 @@ class Observer public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Paypal\Helper\Hss $paypalHss, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory, \Magento\App\ViewInterface $view, @@ -117,7 +118,8 @@ public function __construct( /** * Goes to reports.paypal.com and fetches Settlement reports. - * @return \Magento\Paypal\Model\Observer + * + * @return void */ public function fetchReports() { @@ -142,7 +144,7 @@ public function fetchReports() * Clean unfinished transaction * * @deprecated since 1.6.2.0 - * @return \Magento\Paypal\Model\Observer + * @return $this */ public function cleanTransactions() { @@ -152,10 +154,10 @@ public function cleanTransactions() /** * Save order into registry to use it in the overloaded controller. * - * @param \Magento\Event\Observer $observer - * @return \Magento\Paypal\Model\Observer + * @param EventObserver $observer + * @return $this */ - public function saveOrderAfterSubmit(\Magento\Event\Observer $observer) + public function saveOrderAfterSubmit(EventObserver $observer) { /* @var $order \Magento\Sales\Model\Order */ $order = $observer->getEvent()->getData('order'); @@ -167,10 +169,10 @@ public function saveOrderAfterSubmit(\Magento\Event\Observer $observer) /** * Set data for response of frontend saveOrder action * - * @param \Magento\Event\Observer $observer - * @return \Magento\Paypal\Model\Observer + * @param EventObserver $observer + * @return $this */ - public function setResponseAfterSaveOrder(\Magento\Event\Observer $observer) + public function setResponseAfterSaveOrder(EventObserver $observer) { /* @var $order \Magento\Sales\Model\Order */ $order = $this->_coreRegistry->registry('hss_order'); @@ -203,7 +205,8 @@ public function setResponseAfterSaveOrder(\Magento\Event\Observer $observer) /** * Block admin ability to use customer billing agreements * - * @param \Magento\Event\Observer $observer + * @param EventObserver $observer + * @return void */ public function restrictAdminBillingAgreementUsage($observer) { @@ -217,9 +220,10 @@ public function restrictAdminBillingAgreementUsage($observer) } /** - * @param \Magento\Event\Observer $observer + * @param EventObserver $observer + * @return void */ - public function addBillingAgreementToSession(\Magento\Event\Observer $observer) + public function addBillingAgreementToSession(EventObserver $observer) { /** @var \Magento\Sales\Model\Order\Payment $orderPayment */ $orderPayment = $observer->getEvent()->getPayment(); @@ -247,9 +251,10 @@ public function addBillingAgreementToSession(\Magento\Event\Observer $observer) /** * Add PayPal shortcut buttons * - * @param \Magento\Event\Observer $observer + * @param EventObserver $observer + * @return void */ - public function addPaypalShortcuts(\Magento\Event\Observer $observer) + public function addPaypalShortcuts(EventObserver $observer) { /** @var \Magento\Catalog\Block\ShortcutButtons $shortcutButtons */ $shortcutButtons = $observer->getEvent()->getContainer(); diff --git a/app/code/Magento/Paypal/Model/Payflow/Pro.php b/app/code/Magento/Paypal/Model/Payflow/Pro.php index ae336bb38c21c..1fc90a3d07920 100644 --- a/app/code/Magento/Paypal/Model/Payflow/Pro.php +++ b/app/code/Magento/Paypal/Model/Payflow/Pro.php @@ -21,14 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Payflow; /** * PayPal Website Payments Pro (Payflow Edition) implementation for payment method instances * This model was created because right now PayPal Direct and PayPal Express payment * (Payflow Edition) methods cannot have same abstract */ -namespace Magento\Paypal\Model\Payflow; - class Pro extends \Magento\Paypal\Model\Pro { /** @@ -55,6 +54,7 @@ class Pro extends \Magento\Paypal\Model\Pro * * @param \Magento\Object $payment * @param float $amount + * @return void */ public function refund(\Magento\Object $payment, $amount) { @@ -94,8 +94,9 @@ protected function _getParentTransactionId(\Magento\Object $payment) /** * Import capture results to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param \Magento\Sales\Model\Order\Payment $payment + * @return void */ protected function _importCaptureResultToPayment($api, $payment) { @@ -125,9 +126,10 @@ public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $tran /** * Import refund results to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param \Magento\Sales\Model\Order\Payment $payment * @param bool $canRefundMore + * @return void */ protected function _importRefundResultToPayment($api, $payment, $canRefundMore) { diff --git a/app/code/Magento/Paypal/Model/Payflow/Request.php b/app/code/Magento/Paypal/Model/Payflow/Request.php index 8f4f7a3db7f0f..123db1f505543 100644 --- a/app/code/Magento/Paypal/Model/Payflow/Request.php +++ b/app/code/Magento/Paypal/Model/Payflow/Request.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Payflow; /** * Payflow Link request model @@ -31,22 +32,20 @@ * @package Magento_Paypal * @author Magento Core Team */ - -namespace Magento\Paypal\Model\Payflow; - class Request extends \Magento\Object { /** * Set/Get attribute wrapper * Also add length path if key contains = or & * - * @param string $method - * @param array $args - * @return mixed + * @param string $method + * @param array $args + * @return mixed + * @throws \Magento\Exception */ public function __call($method, $args) { - $key = $this->_underscore(substr($method,3)); + $key = $this->_underscore(substr($method, 3)); if (isset($args[0]) && (strstr($args[0], '=') || strstr($args[0], '&'))) { $key .= '[' . strlen($args[0]) . ']'; } @@ -74,6 +73,6 @@ public function __call($method, $args) //\Magento\Profiler::stop('HAS: '.get_class($this).'::'.$method); return isset($this->_data[$key]); } - throw new \Magento\Exception("Invalid method ".get_class($this)."::".$method."(".print_r($args,1).")"); + throw new \Magento\Exception("Invalid method ".get_class($this)."::".$method."(".print_r($args, 1).")"); } } diff --git a/app/code/Magento/Paypal/Model/PayflowDirect.php b/app/code/Magento/Paypal/Model/PayflowDirect.php index 1c30e094b202e..d8f3d961ebce5 100644 --- a/app/code/Magento/Paypal/Model/PayflowDirect.php +++ b/app/code/Magento/Paypal/Model/PayflowDirect.php @@ -21,11 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Paypal\Model; class PayflowDirect extends \Magento\Paypal\Model\Direct { + /** + * @var string + */ protected $_code = \Magento\Paypal\Model\Config::METHOD_WPP_PE_DIRECT; /** @@ -65,8 +67,9 @@ public function getIsCentinelValidationEnabled() /** * Import direct payment results to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param \Magento\Sales\Model\Order\Payment $payment + * @return void */ protected function _importResultToPayment($api, $payment) { diff --git a/app/code/Magento/Paypal/Model/PayflowExpress.php b/app/code/Magento/Paypal/Model/PayflowExpress.php index b1aadf58dea12..f74d9c89f247f 100644 --- a/app/code/Magento/Paypal/Model/PayflowExpress.php +++ b/app/code/Magento/Paypal/Model/PayflowExpress.php @@ -21,13 +21,23 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Paypal\Model; class PayflowExpress extends \Magento\Paypal\Model\Express { + /** + * @var string + */ protected $_code = \Magento\Paypal\Model\Config::METHOD_WPP_PE_EXPRESS; + + /** + * @var string + */ protected $_formBlockType = 'Magento\Paypal\Block\PayflowExpress\Form'; + + /** + * @var bool + */ protected $_canManageRecurringProfiles = false; /** @@ -53,7 +63,7 @@ class PayflowExpress extends \Magento\Paypal\Model\Express * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\UrlInterface $urlBuilder @@ -65,7 +75,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\UrlInterface $urlBuilder, @@ -90,7 +100,7 @@ public function __construct( /** * EC PE won't be available if the EC is available * - * @param \Magento\Sales\Model\Quote $quote + * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) @@ -111,8 +121,9 @@ public function isAvailable($quote = null) /** * Import payment info to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param \Magento\Sales\Model\Order\Payment $payment + * @return void */ protected function _importToPayment($api, $payment) { diff --git a/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php b/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php index 5b7f1ae5877a4..23eb14c7e8793 100644 --- a/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php +++ b/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php @@ -21,13 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\PayflowExpress; /** * Wrapper that performs Paypal Express and Checkout communication * Use current Paypal Express method instance */ -namespace Magento\Paypal\Model\PayflowExpress; - class Checkout extends \Magento\Paypal\Model\Express\Checkout { /** @@ -46,7 +45,9 @@ class Checkout extends \Magento\Paypal\Model\Express\Checkout /** * Set shipping method to quote, if needed + * * @param string $methodCode + * @return void */ public function updateShippingMethod($methodCode) { diff --git a/app/code/Magento/Paypal/Model/Payflowlink.php b/app/code/Magento/Paypal/Model/Payflowlink.php index 513ebc7a402ec..42f1ddeb44294 100644 --- a/app/code/Magento/Paypal/Model/Payflowlink.php +++ b/app/code/Magento/Paypal/Model/Payflowlink.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * Payflow Link payment gateway model */ -namespace Magento\Paypal\Model; - class Payflowlink extends \Magento\Paypal\Model\Payflowpro { /** @@ -74,6 +73,8 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro /** * Payment method code + * + * @var string */ protected $_code = \Magento\Paypal\Model\Config::METHOD_PAYFLOWLINK; @@ -87,12 +88,19 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro */ protected $_infoBlockType = 'Magento\Paypal\Block\Payflow\Link\Info'; - /**#@+ - * Availability options + /** + * Availability option + * + * @var bool */ protected $_canUseInternal = false; + + /** + * Availability option + * + * @var bool + */ protected $_isInitializeNeeded = true; - /**#@-*/ /** * Request & response model @@ -142,7 +150,7 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -156,14 +164,14 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro * @param \Magento\App\RequestInterface $requestHttp * @param \Magento\Core\Model\WebsiteFactory $websiteFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, @@ -202,7 +210,7 @@ public function __construct( /** * Do not validate payment form using server methods * - * @return bool + * @return true */ public function validate() { @@ -212,7 +220,7 @@ public function validate() /** * Check whether payment method can be used * - * @param \Magento\Sales\Model\Quote + * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) @@ -233,6 +241,7 @@ public function isAvailable($quote = null) * * @param string $paymentAction * @param \Magento\Object $stateObject + * @return void */ public function initialize($paymentAction, $stateObject) { @@ -279,7 +288,7 @@ public function getResponse() * Fill response with data. * * @param array $postData - * @return \Magento\Paypal\Model\Payflowlink + * @return $this */ public function setResponseData(array $postData) { @@ -311,7 +320,8 @@ public function setResponseData(array $postData) * Operate with order using data from $_POST which came from Silent Post Url. * * @param array $responseData - * @throws \Magento\Core\Exception in case of validation error or order creation error + * @return void + * @throws \Magento\Core\Exception In case of validation error or order creation error */ public function process($responseData) { @@ -331,6 +341,7 @@ public function process($responseData) * Operate with order using information from silent post * * @param \Magento\Sales\Model\Order $order + * @return void * @throws \Magento\Core\Exception */ protected function _processOrder(\Magento\Sales\Model\Order $order) @@ -387,7 +398,7 @@ protected function _processOrder(\Magento\Sales\Model\Order $order) /** * Get fraud message from response * - * @return string|bool + * @return string|false */ protected function _getFraudMessage() { @@ -403,8 +414,8 @@ protected function _getFraudMessage() /** * Check response from Payflow gateway. * - * @return \Magento\Sales\Model\Order in case of validation passed - * @throws \Magento\Core\Exception in other cases + * @return false|\Magento\Sales\Model\Order in case of validation passed + * @throws \Magento\Core\Exception In other cases */ protected function _getOrderFromResponse() { @@ -580,7 +591,7 @@ protected function _generateSecureTokenId() * * @param mixed $format * @param mixed $string - * @return mixed + * @return string */ protected function _formatStr($format, $string) { @@ -593,6 +604,7 @@ protected function _formatStr($format, $string) * * @param \Magento\Object $response * @param \Magento\Sales\Model\Order\Payment $payment + * @return void * @throws \Magento\Core\Exception */ protected function _processTokenErrors($response, $payment) @@ -638,6 +650,7 @@ protected function _generateSecureSilentPostHash($payment) * @deprecated since 1.6.2.0 * @param \Magento\Object $payment * @param string $txnId + * @return void */ protected function _addTransaction($payment, $txnId) { @@ -648,8 +661,8 @@ protected function _addTransaction($payment, $txnId) * * @deprecated since 1.6.2.0 * @param \Magento\Object $payment - * @param $amount - * @return \Magento\Paypal\Model\Payflowlink + * @param mixed $amount + * @return $this */ protected function _initialize(\Magento\Object $payment, $amount) { @@ -660,7 +673,8 @@ protected function _initialize(\Magento\Object $payment, $amount) * Check whether order review has enough data to initialize * * @deprecated since 1.6.2.0 - * @param $token + * @param mixed|null $token + * @return void * @throws \Magento\Core\Exception */ public function prepareOrderReview($token = null) @@ -675,7 +689,7 @@ public function prepareOrderReview($token = null) * @param mixed $amount * @param \Magento\Paypal\Model\Payment\Transaction $transaction * @param string $txnId - * @return \Magento\Paypal\Model\Payflowlink + * @return $this */ protected function _authorize(\Magento\Object $payment, $amount, $transaction, $txnId) { @@ -687,6 +701,7 @@ protected function _authorize(\Magento\Object $payment, $amount, $transaction, $ * * @deprecated since 1.6.2.0 * @param \Magento\Object $document + * @return void */ protected function _process(\Magento\Object $document) { @@ -698,7 +713,7 @@ protected function _process(\Magento\Object $document) * @deprecated since 1.6.2.0 * @param \Magento\Paypal\Model\Payment\Transaction $transaction * @param mixed $amount - * @return \Magento\Paypal\Model\Payflowlink + * @return $this */ protected function _checkTransaction($transaction, $amount) { @@ -710,7 +725,7 @@ protected function _checkTransaction($transaction, $amount) * * @deprecated since 1.6.2.0 * @return \Magento\Sales\Model\AbstractModel in case of validation passed - * @throws \Magento\Core\Exception in other cases + * @throws \Magento\Core\Exception In other cases */ protected function _getDocumentFromResponse() { diff --git a/app/code/Magento/Paypal/Model/Payflowpro.php b/app/code/Magento/Paypal/Model/Payflowpro.php index 801b8f7cbabba..8d4105934fe45 100644 --- a/app/code/Magento/Paypal/Model/Payflowpro.php +++ b/app/code/Magento/Paypal/Model/Payflowpro.php @@ -23,13 +23,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; + +use Magento\Sales\Model\Order\Payment; /** * Payflow Pro payment gateway model */ -namespace Magento\Paypal\Model; - -class Payflowpro extends \Magento\Payment\Model\Method\Cc +class Payflowpro extends \Magento\Payment\Model\Method\Cc { /** * Transaction action codes @@ -68,42 +69,113 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc /** * Payment method code + * + * @var string */ protected $_code = \Magento\Paypal\Model\Config::METHOD_PAYFLOWPRO; - /**#@+ + /** * Availability option + * + * @var bool */ protected $_isGateway = true; + + /** + * Availability option + * + * @var bool + */ protected $_canAuthorize = true; + + /** + * Availability option + * + * @var bool + */ protected $_canCapture = true; + + /** + * Availability option + * + * @var bool + */ protected $_canCapturePartial = true; + + /** + * Availability option + * + * @var bool + */ protected $_canRefund = true; + + /** + * Availability option + * + * @var bool + */ protected $_canRefundInvoicePartial = true; + + /** + * Availability option + * + * @var bool + */ protected $_canVoid = true; + + /** + * Availability option + * + * @var bool + */ protected $_canUseInternal = true; + + /** + * Availability option + * + * @var bool + */ protected $_canUseCheckout = true; + + /** + * Availability option + * + * @var bool + */ protected $_canSaveCc = false; + + /** + * Availability option + * + * @var bool + */ protected $_isProxy = false; + + /** + * Availability option + * + * @var bool + */ protected $_canFetchTransactionInfo = true; - /**#@-*/ /** * Gateway request timeout + * + * @var int */ protected $_clientTimeout = 45; /** * Fields that should be replaced in debug with '***' * - * @var array + * @var string[] */ protected $_debugReplacePrivateDataKeys = array('user', 'pwd', 'acct', 'expdate', 'cvv2'); /** * Centinel cardinal fields map * - * @var string + * @var string[] */ protected $_centinelFieldMap = array( 'centinel_mpivendor' => 'MPIVENDOR3DS', @@ -112,6 +184,7 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc 'centinel_eci' => 'ECI', 'centinel_xid' => 'XID', ); + /** * @var \Magento\Core\Model\StoreManagerInterface */ @@ -131,7 +204,7 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale @@ -140,14 +213,14 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc * @param \Magento\Paypal\Model\ConfigFactory $configFactory * @param \Magento\Math\Random $mathRandom * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, @@ -176,7 +249,7 @@ public function __construct( /** * Check whether payment method can be used * - * @param \Magento\Sales\Model\Quote + * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) @@ -211,9 +284,9 @@ public function getConfigPaymentAction() /** * Authorize payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Payflowpro + * @return $this */ public function authorize(\Magento\Object $payment, $amount) { @@ -255,9 +328,9 @@ protected function _getCaptureAmount($amount) /** * Capture payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Payflowpro + * @return $this */ public function capture(\Magento\Object $payment, $amount) { @@ -300,8 +373,8 @@ public function capture(\Magento\Object $payment, $amount) /** * Void payment * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Paypal\Model\Payflowpro + * @param \Magento\Object|Payment $payment + * @return $this */ public function void(\Magento\Object $payment) { @@ -311,7 +384,7 @@ public function void(\Magento\Object $payment) $response = $this->_postRequest($request); $this->_processErrors($response); - if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED){ + if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED) { $payment->setTransactionId($response->getPnref()) ->setIsTransactionClosed(1) ->setShouldCloseParentTransaction(1); @@ -344,7 +417,7 @@ public function canVoid(\Magento\Object $payment) * Attempt to void the authorization on cancelling * * @param \Magento\Object $payment - * @return \Magento\Paypal\Model\Payflowpro + * @return $this */ public function cancel(\Magento\Object $payment) { @@ -358,9 +431,9 @@ public function cancel(\Magento\Object $payment) /** * Refund capture * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount - * @return \Magento\Paypal\Model\Payflowpro + * @return $this */ public function refund(\Magento\Object $payment, $amount) { @@ -371,7 +444,7 @@ public function refund(\Magento\Object $payment, $amount) $response = $this->_postRequest($request); $this->_processErrors($response); - if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED){ + if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED) { $payment->setTransactionId($response->getPnref()) ->setIsTransactionClosed(1); $payment->setShouldCloseParentTransaction(!$payment->getCreditmemo()->getInvoice()->canRefund()); @@ -426,7 +499,7 @@ protected static function _isTransactionUnderReview($status) /** * Getter for URL to perform Payflow requests, based on test mode by default * - * @param bool $testMode Ability to specify test mode using + * @param bool|null $testMode Ability to specify test mode using * @return string */ protected function _getTransactionUrl($testMode = null) @@ -459,7 +532,7 @@ protected function _postRequest(\Magento\Object $request) ); $_isProxy = $this->getConfigData('use_proxy', false); - if ($_isProxy){ + if ($_isProxy) { $_config['proxy'] = $this->getConfigData('proxy_host') . ':' . $this->getConfigData('proxy_port');//http://proxy.shr.secureserver.net:3128', @@ -513,7 +586,7 @@ protected function _postRequest(\Magento\Object $request) /** * Return request object with information for 'authorization' or 'sale' action * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @param float $amount * @return \Magento\Object */ @@ -525,7 +598,7 @@ protected function _buildPlaceRequest(\Magento\Object $payment, $amount) $request->setExpdate(sprintf('%02d', $payment->getCcExpMonth()) . substr($payment->getCcExpYear(), -2, 2)); $request->setCvv2($payment->getCcCid()); - if ($this->getIsCentinelValidationEnabled()){ + if ($this->getIsCentinelValidationEnabled()) { $params = array(); $params = $this->getCentinelValidator()->exportCmpiData($params); $request = \Magento\Object\Mapper::accumulateByMap($params, $request, $this->_centinelFieldMap); @@ -568,7 +641,7 @@ protected function _buildPlaceRequest(\Magento\Object $payment, $amount) /** * Return request object with basic information for gateway request * - * @param \Magento\Object|\Magento\Sales\Model\Order\Payment $payment + * @param \Magento\Object|Payment $payment * @return \Magento\Object */ protected function _buildBasicRequest(\Magento\Object $payment) @@ -598,6 +671,8 @@ protected function _generateRequestId() /** * If response is failed throw exception * + * @param \Magento\Object $response + * @return void * @throws \Magento\Core\Exception */ protected function _processErrors(\Magento\Object $response) @@ -616,6 +691,7 @@ protected function _processErrors(\Magento\Object $response) * Puerto Rico should be as state of USA and not as a country * * @param \Magento\Object $address + * @return void */ protected function _applyCountryWorkarounds(\Magento\Object $address) { @@ -630,7 +706,7 @@ protected function _applyCountryWorkarounds(\Magento\Object $address) * * @param \Magento\Object $payment * @param \Magento\Object $request - * @return \Magento\Paypal\Model\Payflowpro + * @return $this */ protected function _setReferenceTransaction(\Magento\Object $payment, $request) { diff --git a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php index e45d90e9fdeb6..65af15c0100fa 100644 --- a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php +++ b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php @@ -21,12 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Payment\Method\Billing; /** * Billing Agreement Payment Method Abstract model */ -namespace Magento\Paypal\Model\Payment\Method\Billing; - abstract class AbstractAgreement extends \Magento\Payment\Model\Method\AbstractMethod { @@ -36,7 +35,14 @@ abstract class AbstractAgreement const TRANSPORT_BILLING_AGREEMENT_ID = 'ba_agreement_id'; const PAYMENT_INFO_REFERENCE_ID = 'ba_reference_id'; + /** + * @var string + */ protected $_infoBlockType = 'Magento\Paypal\Block\Payment\Info\Billing\Agreement'; + + /** + * @var string + */ protected $_formBlockType = 'Magento\Paypal\Block\Payment\Form\Billing\Agreement'; /** @@ -55,7 +61,7 @@ abstract class AbstractAgreement * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param array $data */ @@ -63,7 +69,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, array $data = array() ) { @@ -74,15 +80,15 @@ public function __construct( /** * Check whether method is available * - * @param \Magento\Paypal\Model\Quote $quote + * @param \Magento\Paypal\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) { if (is_null($this->_isAvailable)) { - if (is_object($quote) && $quote->getCustomer()) { + if (is_object($quote) && $quote->getCustomerId()) { $availableBA = $this->_agreementFactory->create()->getAvailableCustomerBillingAgreements( - $quote->getCustomer()->getId() + $quote->getCustomerId() ); $isAvailableBA = count($availableBA) > 0; $this->_canUseCheckout = $this->_canUseInternal = $isAvailableBA; @@ -97,8 +103,8 @@ public function isAvailable($quote = null) /** * Assign data to info model instance * - * @param mixed $data - * @return \Magento\Payment\Model\Info + * @param mixed $data + * @return \Magento\Payment\Model\Info */ public function assignData($data) { @@ -114,7 +120,7 @@ public function assignData($data) if ($id) { $info = $this->getInfoInstance(); $ba = $this->_agreementFactory->create()->load($id); - if ($ba->getId() && $ba->getCustomerId() == $info->getQuote()->getCustomer()->getId()) { + if ($ba->getId() && $ba->getCustomerId() == $info->getQuote()->getCustomerId()) { $info->setAdditionalInformation($key, $id) ->setAdditionalInformation(self::PAYMENT_INFO_REFERENCE_ID, $ba->getReferenceId()); } @@ -124,6 +130,7 @@ public function assignData($data) /** * @param object $quote + * @return void */ abstract protected function _isAvailable($quote); } diff --git a/app/code/Magento/Paypal/Model/Payment/Transaction.php b/app/code/Magento/Paypal/Model/Payment/Transaction.php index 4bae6d8163b02..e68cadca69358 100644 --- a/app/code/Magento/Paypal/Model/Payment/Transaction.php +++ b/app/code/Magento/Paypal/Model/Payment/Transaction.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Payment; /** * Payment transaction model @@ -32,8 +33,6 @@ * @method string getCreatedAt() * @method \Magento\Paypal\Model\Payment\Transaction setCreatedAt(string $value) */ -namespace Magento\Paypal\Model\Payment; - class Transaction extends \Magento\Core\Model\AbstractModel { /** @@ -46,16 +45,16 @@ class Transaction extends \Magento\Core\Model\AbstractModel /** * Event object prefix * - * @see \Magento\Core\Model\Absctract::$_eventPrefix * @var string + * @see \Magento\Core\Model\Absctract::$_eventPrefix */ protected $_eventPrefix = 'paypal_payment_transaction'; /** * Event object prefix * - * @see \Magento\Core\Model\Absctract::$_eventObject * @var string + * @see \Magento\Core\Model\Absctract::$_eventObject */ protected $_eventObject = 'paypal_payment_transaction'; @@ -72,16 +71,16 @@ class Transaction extends \Magento\Core\Model\AbstractModel protected $_dateFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\DateFactory $dateFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\DateFactory $dateFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -93,6 +92,8 @@ public function __construct( /** * Initialize resource model + * + * @return null */ protected function _construct() { @@ -102,8 +103,9 @@ protected function _construct() /** * Transaction ID setter + * * @param string $txnId - * @return \Magento\Paypal\Model\Payment\Transaction + * @return $this */ public function setTxnId($txnId) { @@ -114,8 +116,8 @@ public function setTxnId($txnId) /** * Check object before loading by by specified transaction ID * - * @param $txnId - * @return \Magento\Paypal\Model\Payment\Transaction + * @param string $txnId + * @return $this */ protected function _beforeLoadByTxnId($txnId) { @@ -130,7 +132,7 @@ protected function _beforeLoadByTxnId($txnId) * Load self by specified transaction ID. Requires the valid payment object to be set * * @param string $txnId - * @return \Magento\Paypal\Model\Payment\Transaction + * @return $this */ public function loadByTxnId($txnId) { @@ -145,7 +147,7 @@ public function loadByTxnId($txnId) /** * Check object after loading by by specified transaction ID * - * @return \Magento\Paypal\Model\Payment\Transaction + * @return $this */ protected function _afterLoadByTxnId() { @@ -161,7 +163,7 @@ protected function _afterLoadByTxnId() * * @param string $key * @param mixed $value - * @return \Magento\Paypal\Model\Payment\Transaction + * @return $this * @throws \Magento\Core\Exception */ public function setAdditionalInformation($key, $value) @@ -179,7 +181,8 @@ public function setAdditionalInformation($key, $value) /** * Getter for entire additional_information value or one of its element by key - * @param string $key + * + * @param string|null $key * @return array|null|mixed */ public function getAdditionalInformation($key = null) @@ -197,8 +200,8 @@ public function getAdditionalInformation($key = null) /** * Unsetter for entire additional_information value or one of its element by key * - * @param string $key - * @return \Magento\Paypal\Model\Payment\Transaction + * @param string|null $key + * @return $this */ public function unsAdditionalInformation($key = null) { @@ -231,7 +234,7 @@ public function isFailsafe($setFailsafe = null) /** * Verify data required for saving * - * @return \Magento\Paypal\Model\Payment\Transaction + * @return $this * @throws \Magento\Core\Exception */ protected function _beforeSave() @@ -246,6 +249,7 @@ protected function _beforeSave() * Check whether specified transaction ID is valid * * @param string $txnId + * @return void * @throws \Magento\Core\Exception */ protected function _verifyTxnId($txnId) @@ -259,6 +263,8 @@ protected function _verifyTxnId($txnId) * Make sure this object is a valid transaction * * TODO for more restriction we can check for data consistency + * + * @return void * @throws \Magento\Core\Exception */ protected function _verifyThisTransactionExists() diff --git a/app/code/Magento/Paypal/Model/Pro.php b/app/code/Magento/Paypal/Model/Pro.php index 59cff81612fd1..2657d217aa813 100644 --- a/app/code/Magento/Paypal/Model/Pro.php +++ b/app/code/Magento/Paypal/Model/Pro.php @@ -23,13 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; + +use Magento\RecurringProfile\Model\RecurringProfile; +use Magento\Paypal\Model\Api\AbstractApi; /** * PayPal Website Payments Pro implementation for payment method instances * This model was created because right now PayPal Direct and PayPal Express payment methods cannot have same abstract */ -namespace Magento\Paypal\Model; - class Pro { /** @@ -131,7 +133,7 @@ public function setMethod($code, $storeId = null) * Config instance setter * * @param \Magento\Paypal\Model\Config $instace - * @param int $storeId + * @param int|null $storeId * @return $this */ public function setConfig(\Magento\Paypal\Model\Config $instace, $storeId = null) @@ -171,7 +173,7 @@ public function getApi() /** * Destroy existing NVP Api object * - * @return \Magento\Paypal\Model\Pro + * @return $this */ public function resetApi() { @@ -196,9 +198,9 @@ public function getInfo() /** * Transfer transaction/payment information from API instance to order payment * - * @param \Magento\Object|\Magento\Paypal\Model\Api\AbstractApi $from + * @param \Magento\Object|AbstractApi $from * @param \Magento\Payment\Model\Info $to - * @return \Magento\Paypal\Model\Pro + * @return $this */ public function importPaymentInfo(\Magento\Object $from, \Magento\Payment\Model\Info $to) { @@ -230,6 +232,7 @@ public function importPaymentInfo(\Magento\Object $from, \Magento\Payment\Model\ * Void transaction * * @param \Magento\Object $payment + * @return void * @throws \Magento\Core\Exception */ public function void(\Magento\Object $payment) @@ -275,6 +278,7 @@ public function capture(\Magento\Object $payment, $amount) * * @param \Magento\Object $payment * @param float $amount + * @return void * @throws \Magento\Core\Exception */ public function refund(\Magento\Object $payment, $amount) @@ -304,6 +308,7 @@ public function refund(\Magento\Object $payment, $amount) * Cancel payment * * @param \Magento\Object $payment + * @return void */ public function cancel(\Magento\Object $payment) { @@ -382,10 +387,11 @@ public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $tran /** * Validate RP data * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile + * @return void * @throws \Magento\Core\Exception */ - public function validateRecurringProfile(\Magento\RecurringProfile\Model\RecurringProfile $profile) + public function validateRecurringProfile(RecurringProfile $profile) { $errors = array(); if (strlen($profile->getSubscriberName()) > 32) { // up to 32 single-byte chars @@ -407,11 +413,12 @@ public function validateRecurringProfile(\Magento\RecurringProfile\Model\Recurri /** * Submit RP to the gateway * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile * @param \Magento\Payment\Model\Info $paymentInfo + * @return void * @throws \Magento\Core\Exception */ - public function submitRecurringProfile(\Magento\RecurringProfile\Model\RecurringProfile $profile, + public function submitRecurringProfile(RecurringProfile $profile, \Magento\Payment\Model\Info $paymentInfo ) { $api = $this->getApi(); @@ -438,6 +445,7 @@ public function submitRecurringProfile(\Magento\RecurringProfile\Model\Recurring * * @param string $referenceId * @param \Magento\Object $result + * @return void */ public function getRecurringProfileDetails($referenceId, \Magento\Object $result) { @@ -450,9 +458,10 @@ public function getRecurringProfileDetails($referenceId, \Magento\Object $result /** * Update RP data * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile + * @return void */ - public function updateRecurringProfile(\Magento\RecurringProfile\Model\RecurringProfile $profile) + public function updateRecurringProfile(RecurringProfile $profile) { } @@ -460,9 +469,10 @@ public function updateRecurringProfile(\Magento\RecurringProfile\Model\Recurring /** * Manage status * - * @param \Magento\RecurringProfile\Model\RecurringProfile $profile + * @param RecurringProfile $profile + * @return void */ - public function updateRecurringProfileStatus(\Magento\RecurringProfile\Model\RecurringProfile $profile) + public function updateRecurringProfileStatus(RecurringProfile $profile) { $api = $this->getApi(); $action = null; @@ -484,8 +494,9 @@ public function updateRecurringProfileStatus(\Magento\RecurringProfile\Model\Rec /** * Import capture results to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param \Magento\Sales\Model\Order\Payment $payment + * @return void */ protected function _importCaptureResultToPayment($api, $payment) { @@ -496,9 +507,10 @@ protected function _importCaptureResultToPayment($api, $payment) /** * Import refund results to payment * - * @param \Magento\Paypal\Model\Api\Nvp - * @param \Magento\Sales\Model\Order\Payment + * @param \Magento\Paypal\Model\Api\Nvp $api + * @param \Magento\Sales\Model\Order\Payment $payment * @param bool $canRefundMore + * @return void */ protected function _importRefundResultToPayment($api, $payment, $canRefundMore) { diff --git a/app/code/Magento/Paypal/Model/Report/Settlement.php b/app/code/Magento/Paypal/Model/Report/Settlement.php index 9ea857983fdf4..23c45f5d5bfa7 100644 --- a/app/code/Magento/Paypal/Model/Report/Settlement.php +++ b/app/code/Magento/Paypal/Model/Report/Settlement.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Report; /** * Paypal Settlement Report model @@ -41,8 +42,6 @@ * @method string getLastModified() * @method \Magento\Paypal\Model\Report\Settlement setLastModified(string $value) */ -namespace Magento\Paypal\Model\Report; - class Settlement extends \Magento\Core\Model\AbstractModel { /** @@ -72,6 +71,7 @@ class Settlement extends \Magento\Core\Model\AbstractModel /** * Reports rows storage + * * @var array */ protected $_rows = array(); @@ -169,8 +169,8 @@ class Settlement extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\App\Filesystem $filesystem * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -178,8 +178,8 @@ class Settlement extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\App\Filesystem $filesystem, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, @@ -193,6 +193,8 @@ public function __construct( /** * Initialize resource model + * + * @return void */ protected function _construct() { @@ -300,7 +302,7 @@ public static function createConnection(array $config) * * @param string $localCsv Path to CSV file * @param string $format CSV format(column names) - * @return \Magento\Paypal\Model\Report\Settlement + * @return $this */ public function parseCsv($localCsv, $format = 'new') { @@ -361,7 +363,7 @@ public function parseCsv($localCsv, $format = 'new') /** * Load report by unique key (accoutn + report date) * - * @return \Magento\Paypal\Model\Report\Settlement + * @return $this */ public function loadByAccountAndDate() { diff --git a/app/code/Magento/Paypal/Model/Report/Settlement/Row.php b/app/code/Magento/Paypal/Model/Report/Settlement/Row.php index 4db5042baa3a6..f81a008b70096 100644 --- a/app/code/Magento/Paypal/Model/Report/Settlement/Row.php +++ b/app/code/Magento/Paypal/Model/Report/Settlement/Row.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Report\Settlement; /* * Model for report rows @@ -67,8 +68,6 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Model\Report\Settlement; - class Row extends \Magento\Core\Model\AbstractModel { /** @@ -87,6 +86,8 @@ class Row extends \Magento\Core\Model\AbstractModel /** * Initialize resource model + * + * @return void */ protected function _construct() { @@ -97,7 +98,7 @@ protected function _construct() * Return description of Reference ID Type * If no code specified, return full list of codes with their description * - * @param string code + * @param string|null $code * @return string|array */ public function getReferenceType($code = null) @@ -121,7 +122,7 @@ public function getReferenceType($code = null) /** * Get native description for transaction code * - * @param string code + * @param string $code * @return string */ public function getTransactionEvent($code) @@ -148,7 +149,7 @@ public function &getTransactionEvents() * Return description of "Debit or Credit" value * If no code specified, return full list of codes with their description * - * @param string code + * @param string|null $code * @return string|array */ public function getDebitCreditText($code = null) @@ -169,8 +170,8 @@ public function getDebitCreditText($code = null) /** * Invoke casting some amounts * - * @param mixed $key - * @param mixed $index + * @param string $key + * @param string|int|null $index * @return mixed */ public function getData($key = '', $index = null) @@ -188,6 +189,7 @@ public function getData($key = '', $index = null) * * @param string $key * @param string $creditKey + * @return void */ public function _castAmount($key, $creditKey) { @@ -207,6 +209,8 @@ public function _castAmount($key, $creditKey) /** * Fill/translate and sort all event codes/labels + * + * @return void */ protected function _generateEventLabels() { diff --git a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php index e12df7c2fa51a..1cb031214873f 100644 --- a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php @@ -21,18 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Paypal\Model\Resource\Billing; /** * Billing agreement resource model */ -namespace Magento\Paypal\Model\Resource\Billing; - class Agreement extends \Magento\Core\Model\Resource\Db\AbstractDb { /** * Resource initialization * + * @return void */ protected function _construct() { @@ -44,7 +43,7 @@ protected function _construct() * * @param int $agreementId * @param int $orderId - * @return \Magento\Paypal\Model\Resource\Billing\Agreement + * @return $this */ public function addOrderRelation($agreementId, $orderId) { diff --git a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php index 6d1dfa0836873..9ebedd5d6561f 100644 --- a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php +++ b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php @@ -21,12 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Resource\Billing\Agreement; + +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; /** * Billing agreements resource collection */ -namespace Magento\Paypal\Model\Resource\Billing\Agreement; - class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { @@ -48,12 +49,18 @@ class Collection */ protected $_customerResource; + /** + * @var \Magento\Eav\Helper\Data + */ + protected $_eavHelper; + /** * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\Resource\Customer $customerResource + * @param \Magento\Eav\Helper\Data $eavHelper * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ @@ -63,15 +70,19 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Customer\Model\Resource\Customer $customerResource, + \Magento\Eav\Helper\Data $eavHelper, $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); + $this->_eavHelper = $eavHelper; $this->_customerResource = $customerResource; } /** * Collection initialization + * + * @return void */ protected function _construct() { @@ -81,7 +92,7 @@ protected function _construct() /** * Add customer details(email, firstname, lastname) to select * - * @return \Magento\Paypal\Model\Resource\Billing\Agreement\Collection + * @return $this */ public function addCustomerDetails() { @@ -92,24 +103,30 @@ public function addCustomerDetails() ); $adapter = $this->getConnection(); - $attr = $this->_customerResource->getAttribute('firstname'); + $firstNameMetadata = $this->_eavHelper->getAttributeMetadata( + CustomerMetadataServiceInterface::ENTITY_TYPE_CUSTOMER, + 'firstname' + ); $joinExpr = 'firstname.entity_id = main_table.customer_id AND ' - . $adapter->quoteInto('firstname.entity_type_id = ?', $this->_customerResource->getTypeId()) . ' AND ' - . $adapter->quoteInto('firstname.attribute_id = ?', $attr->getAttributeId()); + . $adapter->quoteInto('firstname.entity_type_id = ?', $firstNameMetadata['entity_type_id']) . ' AND ' + . $adapter->quoteInto('firstname.attribute_id = ?', $firstNameMetadata['attribute_id']); $select->joinLeft( - array('firstname' => $attr->getBackend()->getTable()), + array('firstname' => $firstNameMetadata['attribute_table']), $joinExpr, array('customer_firstname' => 'value') ); - $attr = $this->_customerResource->getAttribute('lastname'); + $lastNameMetadata = $this->_eavHelper->getAttributeMetadata( + CustomerMetadataServiceInterface::ENTITY_TYPE_CUSTOMER, + 'lastname' + ); $joinExpr = 'lastname.entity_id = main_table.customer_id AND ' - . $adapter->quoteInto('lastname.entity_type_id = ?', $this->_customerResource->getTypeId()) . ' AND ' - . $adapter->quoteInto('lastname.attribute_id = ?', $attr->getAttributeId()); + . $adapter->quoteInto('lastname.entity_type_id = ?', $lastNameMetadata['entity_type_id']) . ' AND ' + . $adapter->quoteInto('lastname.attribute_id = ?', $lastNameMetadata['attribute_id']); $select->joinLeft( - array('lastname' => $attr->getBackend()->getTable()), + array('lastname' => $lastNameMetadata['attribute_table']), $joinExpr, array('customer_lastname' => 'value') ); diff --git a/app/code/Magento/Paypal/Model/Resource/Cert.php b/app/code/Magento/Paypal/Model/Resource/Cert.php index 6d1ff86efa3be..6d2537c6e7ca0 100644 --- a/app/code/Magento/Paypal/Model/Resource/Cert.php +++ b/app/code/Magento/Paypal/Model/Resource/Cert.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Resource; /** * PayPal resource model for certificate based authentication */ -namespace Magento\Paypal\Model\Resource; - class Cert extends \Magento\Core\Model\Resource\Db\AbstractDb { /** @@ -58,6 +57,8 @@ public function __construct( /** * Initialize connection + * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Model/Resource/Payment/Transaction.php b/app/code/Magento/Paypal/Model/Resource/Payment/Transaction.php index 2107aa5167ec0..c4b4b31390053 100644 --- a/app/code/Magento/Paypal/Model/Resource/Payment/Transaction.php +++ b/app/code/Magento/Paypal/Model/Resource/Payment/Transaction.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Resource\Payment; /** * Paypal transaction resource model @@ -32,8 +33,6 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Model\Resource\Payment; - class Transaction extends \Magento\Core\Model\Resource\Db\AbstractDb { /** @@ -48,6 +47,7 @@ class Transaction extends \Magento\Core\Model\Resource\Db\AbstractDb /** * Initialize main table and the primary key field name * + * @return void */ protected function _construct() { @@ -59,6 +59,7 @@ protected function _construct() * * @param \Magento\Paypal\Model\Payment\Transaction $transaction * @param string $txnId + * @return void */ public function loadObjectByTxnId(\Magento\Paypal\Model\Payment\Transaction $transaction, $txnId) { @@ -72,10 +73,9 @@ public function loadObjectByTxnId(\Magento\Paypal\Model\Payment\Transaction $tra /** * Serialize additional information, if any * - * @throws \Magento\Core\Exception - * * @param \Magento\Core\Model\AbstractModel $transaction - * @return \Magento\Paypal\Model\Resource\Payment\Transaction + * @return $this + * @throws \Magento\Core\Exception */ protected function _beforeSave(\Magento\Core\Model\AbstractModel $transaction) { @@ -97,9 +97,9 @@ protected function _beforeSave(\Magento\Core\Model\AbstractModel $transaction) * Load cell/row by specified unique key parts * * @param string $txnId - * @param mixed (array|string|object) $columns + * @param array|string|object $columns * @param bool $isRow - * @return mixed (array|string) + * @return array|string */ private function _lookupByTxnId($txnId, $columns, $isRow = false) { diff --git a/app/code/Magento/Paypal/Model/Resource/Payment/Transaction/Collection.php b/app/code/Magento/Paypal/Model/Resource/Payment/Transaction/Collection.php index 7bfd6f74094cf..b20ce32259746 100644 --- a/app/code/Magento/Paypal/Model/Resource/Payment/Transaction/Collection.php +++ b/app/code/Magento/Paypal/Model/Resource/Payment/Transaction/Collection.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Resource\Payment\Transaction; /** * Payment transactions collection @@ -32,8 +33,6 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Model\Resource\Payment\Transaction; - class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { @@ -45,6 +44,8 @@ class Collection protected $_createdBefore = ""; /** * Initialize collection items factory class + * + * @return void */ protected function _construct() { @@ -56,7 +57,7 @@ protected function _construct() * CreatedAt filter setter * * @param string $date - * @return \Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection + * @return $this */ public function addCreatedBeforeFilter($date) { @@ -67,7 +68,7 @@ public function addCreatedBeforeFilter($date) /** * Prepare filters * - * @return \Magento\Paypal\Model\Resource\Payment\Transaction\Collection + * @return $this */ protected function _beforeLoad() { @@ -87,7 +88,7 @@ protected function _beforeLoad() /** * Unserialize additional_information in each item * - * @return \Magento\Paypal\Model\Resource\Payment\Transaction\Collection + * @return $this */ protected function _afterLoad() { diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php index 558399f2d36b4..c7e25320d766a 100644 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php +++ b/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Resource\Report; /** * Report settlement resource model */ -namespace Magento\Paypal\Model\Resource\Report; - class Settlement extends \Magento\Core\Model\Resource\Db\AbstractDb { /** @@ -55,6 +54,8 @@ public function __construct(\Magento\App\Resource $resource, \Magento\Core\Model /** * Init main table + * + * @return void */ protected function _construct() { @@ -66,7 +67,7 @@ protected function _construct() * Save report rows collected in settlement model * * @param \Magento\Core\Model\AbstractModel|\Magento\Paypal\Model\Report\Settlement $object - * @return \Magento\Paypal\Model\Resource\Report\Settlement + * @return $this */ protected function _afterSave(\Magento\Core\Model\AbstractModel $object) { @@ -117,7 +118,7 @@ protected function _afterSave(\Magento\Core\Model\AbstractModel $object) * @param \Magento\Paypal\Model\Report\Settlement $report * @param string $accountId * @param string $reportDate - * @return \Magento\Paypal\Model\Resource\Report\Settlement + * @return $this */ public function loadByAccountAndDate(\Magento\Paypal\Model\Report\Settlement $report, $accountId, $reportDate) { diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php index e62a8c2425ddb..7359f5142952a 100644 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php +++ b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\Resource\Report\Settlement\Options; /** * Transaction Events Types Options @@ -31,10 +32,8 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Model\Resource\Report\Settlement\Options; - class TransactionEvents - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\Report\Settlement\Row @@ -50,9 +49,7 @@ public function __construct(\Magento\Paypal\Model\Report\Settlement\Row $model) } /** - * Get full list of codes with their description - * - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php index 81d245cd965d5..73de8f5017e29 100644 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php +++ b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php @@ -23,22 +23,22 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Paypal\Model\Resource\Report\Settlement; /** - *Report settlement row resource model + * Report settlement row resource model * * @category Magento * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Model\Resource\Report\Settlement; - class Row extends \Magento\Core\Model\Resource\Db\AbstractDb { /** * Resource model initialization. * Set main entity table name and primary key field name. + * + * @return void */ protected function _construct() { diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php index 30fdafd71003f..3d4833834d684 100644 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php +++ b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php @@ -40,6 +40,7 @@ class Collection /** * Resource initializing * + * @return void */ protected function _construct() { @@ -49,7 +50,7 @@ protected function _construct() /** * Join reports info table * - * @return \Magento\Paypal\Model\Resource\Report\Settlement\Row\Collection + * @return $this */ protected function _initSelect() { @@ -67,7 +68,7 @@ protected function _initSelect() * Filter items collection by account ID * * @param string $accountId - * @return \Magento\Paypal\Model\Resource\Report\Settlement\Row\Collection + * @return $this */ public function addAccountFilter($accountId) { diff --git a/app/code/Magento/Paypal/Model/Standard.php b/app/code/Magento/Paypal/Model/Standard.php index 0734dd826d715..98854280f0b7e 100644 --- a/app/code/Magento/Paypal/Model/Standard.php +++ b/app/code/Magento/Paypal/Model/Standard.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model; /** * PayPal Standard Checkout Module */ -namespace Magento\Paypal\Model; - class Standard extends \Magento\Payment\Model\Method\AbstractMethod { /** @@ -46,7 +45,14 @@ class Standard extends \Magento\Payment\Model\Method\AbstractMethod */ protected $_infoBlockType = 'Magento\Paypal\Block\Payment\Info'; + /** + * @var bool + */ protected $_isInitializeNeeded = true; + + /** + * @var bool + */ protected $_canUseInternal = false; /** @@ -100,7 +106,7 @@ class Standard extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Session\Generic $paypalSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\UrlInterface $urlBuilder @@ -117,7 +123,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Session\Generic $paypalSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\UrlInterface $urlBuilder, @@ -183,6 +189,8 @@ public function getQuote() /** * Create main block for standard form * + * @param string $name + * @return \Magento\View\Element\AbstractBlock */ public function createFormBlock($name) { @@ -201,7 +209,7 @@ public function createFormBlock($name) */ public function getOrderPlaceRedirectUrl() { - return $this->_urlBuilder->getUrl('paypal/standard/redirect', array('_secure' => true)); + return $this->_urlBuilder->getUrl('paypal/standard/redirect', array('_secure' => true)); } /** @@ -247,7 +255,7 @@ public function getStandardCheckoutFormFields() * * @param string $paymentAction * @param object $stateObject - * @return \Magento\Payment\Model\Method\AbstractMethod|void + * @return void */ public function initialize($paymentAction, $stateObject) { @@ -276,7 +284,7 @@ public function getConfig() /** * Check whether payment method can be used - * @param \Magento\Sales\Model\Quote + * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) @@ -291,7 +299,7 @@ public function isAvailable($quote = null) * Custom getter for payment configuration * * @param string $field - * @param int $storeId + * @param int|null $storeId * @return mixed */ public function getConfigData($field, $storeId = null) diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php b/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php index 65a5e8e16b14f..fa7f05464e4a6 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Backend; /** * Backend model for saving certificate file in case of using certificate based authentication */ -namespace Magento\Paypal\Model\System\Config\Backend; - class Cert extends \Magento\Core\Model\Config\Value { /** @@ -47,8 +46,8 @@ class Cert extends \Magento\Core\Model\Config\Value protected $_tmpDirectory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Paypal\Model\CertFactory $certFactory @@ -59,8 +58,8 @@ class Cert extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Paypal\Model\CertFactory $certFactory, @@ -79,7 +78,7 @@ public function __construct( /** * Process additional data before save config * - * @return \Magento\Paypal\Model\System\Config\Backend\Cert + * @return $this * @throws \Magento\Core\Exception */ protected function _beforeSave() @@ -112,7 +111,7 @@ protected function _beforeSave() /** * Process object after delete data * - * @return \Magento\Paypal\Model\System\Config\Backend\Cert + * @return $this */ protected function _afterDelete() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php b/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php index b6063a3dd38ac..a9dca446c2f7d 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php @@ -23,7 +23,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Paypal\Model\System\Config\Backend; class Cron extends \Magento\Core\Model\Config\Value @@ -37,8 +36,8 @@ class Cron extends \Magento\Core\Model\Config\Value protected $_configValueFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory @@ -47,8 +46,8 @@ class Cron extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, @@ -64,6 +63,8 @@ public function __construct( /** * Cron settings after save + * + * @return $this */ protected function _afterSave() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php index 326b780a9e3ec..f3671a984d538 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php @@ -23,12 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Backend; /** * Backend model for merchant country. Default country used instead of empty value. */ -namespace Magento\Paypal\Model\System\Config\Backend; - class MerchantCountry extends \Magento\Core\Model\Config\Value { /** @@ -39,8 +38,8 @@ class MerchantCountry extends \Magento\Core\Model\Config\Value protected $_coreData; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Helper\Data $coreData @@ -49,8 +48,8 @@ class MerchantCountry extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Helper\Data $coreData, @@ -64,6 +63,8 @@ public function __construct( /** * Substitute empty value with Default country. + * + * @return void */ protected function _afterLoad() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php b/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php index e0bc6a3ac0f14..83ddfda9016fe 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for available Authorization Amounts for Account Verification @@ -32,14 +33,10 @@ * @package Magento_Paypal * @author Magento Core Team */ -namespace Magento\Paypal\Model\System\Config\Source; - -class AuthorizationAmounts implements \Magento\Core\Model\Option\ArrayInterface +class AuthorizationAmounts implements \Magento\Option\ArrayInterface { /** - * Options getter - * - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php b/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php index 341b31c8e3ab4..234ff0e3d3d2c 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php @@ -23,13 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for buyer countries supported by PayPal */ -namespace Magento\Paypal\Model\System\Config\Source; - -class BuyerCountry implements \Magento\Core\Model\Option\ArrayInterface +class BuyerCountry implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\ConfigFactory @@ -54,8 +53,7 @@ public function __construct( } /** - * @param bool $isMultiselect - * @return array + * {@inheritdoc} */ public function toOptionArray($isMultiselect = false) { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php b/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php index 512bb653d6431..bdbb02e34d0d3 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php @@ -23,14 +23,16 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for available settlement report fetching intervals */ -namespace Magento\Paypal\Model\System\Config\Source; - -class FetchingSchedule implements \Magento\Core\Model\Option\ArrayInterface +class FetchingSchedule implements \Magento\Option\ArrayInterface { + /** + * {@inheritdoc} + */ public function toOptionArray() { return array ( diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php b/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php index 06036cf598c47..4cd14b9e80d11 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php @@ -23,13 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for available logo types */ -namespace Magento\Paypal\Model\System\Config\Source; - -class Logo implements \Magento\Core\Model\Option\ArrayInterface +class Logo implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\ConfigFactory @@ -45,7 +44,7 @@ public function __construct(\Magento\Paypal\Model\ConfigFactory $configFactory) } /** - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php b/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php index 0d98d5cc45f77..d645a86a136d6 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php @@ -23,13 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for merchant countries supported by PayPal */ -namespace Magento\Paypal\Model\System\Config\Source; - -class MerchantCountry implements \Magento\Core\Model\Option\ArrayInterface +class MerchantCountry implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\ConfigFactory @@ -54,8 +53,7 @@ public function __construct( } /** - * @param bool $isMultiselect - * @return array + * {@inheritdoc} */ public function toOptionArray($isMultiselect = false) { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php b/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php index 02ebab4a6e140..323a60bae27bd 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php @@ -23,13 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for available payment actions */ -namespace Magento\Paypal\Model\System\Config\Source; -class PaymentActions implements \Magento\Core\Model\Option\ArrayInterface +class PaymentActions implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\ConfigFactory @@ -45,9 +45,7 @@ public function __construct(\Magento\Paypal\Model\ConfigFactory $configFactory) } /** - * Options getter - * - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php b/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php index 1edd5e213f7b7..c1e6706bfcecb 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source\PaymentActions; /** * Source model for available paypal express payment actions */ -namespace Magento\Paypal\Model\System\Config\Source\PaymentActions; - class Express - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\ConfigFactory @@ -46,9 +45,7 @@ public function __construct(\Magento\Paypal\Model\ConfigFactory $configFactory) } /** - * Options getter - * - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php b/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php index 403556584a4a1..81dfcd5f4c7ab 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php @@ -23,14 +23,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for Require Billing Address */ -namespace Magento\Paypal\Model\System\Config\Source; - class RequireBillingAddress - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var \Magento\Paypal\Model\ConfigFactory @@ -46,9 +45,7 @@ public function __construct(\Magento\Paypal\Model\ConfigFactory $configFactory) } /** - * Options getter - * - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php b/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php index 58cdac2d596d4..e940102f13eb5 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php +++ b/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php @@ -23,18 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Paypal\Model\System\Config\Source; /** * Source model for url method: GET/POST */ -namespace Magento\Paypal\Model\System\Config\Source; - -class UrlMethod implements \Magento\Core\Model\Option\ArrayInterface +class UrlMethod implements \Magento\Option\ArrayInterface { /** - * Options getter - * - * @return array + * {@inheritdoc} */ public function toOptionArray() { diff --git a/app/code/Magento/Paypal/etc/module.xml b/app/code/Magento/Paypal/etc/module.xml index 4a6524533f891..a439455121251 100755 --- a/app/code/Magento/Paypal/etc/module.xml +++ b/app/code/Magento/Paypal/etc/module.xml @@ -42,6 +42,7 @@ + diff --git a/app/code/Magento/Paypal/etc/payment.xml b/app/code/Magento/Paypal/etc/payment.xml index 4e21c0e33acee..27493a348afab 100644 --- a/app/code/Magento/Paypal/etc/payment.xml +++ b/app/code/Magento/Paypal/etc/payment.xml @@ -41,6 +41,11 @@ + + 1 + 1 + 1 + 1 1 diff --git a/app/code/Magento/Paypal/i18n/de_DE.csv b/app/code/Magento/Paypal/i18n/de_DE.csv index c10284950a9c4..635156ea4fbc8 100644 --- a/app/code/Magento/Paypal/i18n/de_DE.csv +++ b/app/code/Magento/Paypal/i18n/de_DE.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","Die Nummer Ihrer Zustimmung zur Abrechnung lautet: %s." "Bonus for first ACH Use","Bonus für erste ACH-Benutzung" "Buyer Credit Payment","Käuferkredit Zahlung" -"Buyer\'s Tax ID","Steuernummer des Käufers" -"Buyer\'s Tax ID Type","Art der Steuernummer des Käufers" +"Buyer's Tax ID","Steuernummer des Käufers" +"Buyer's Tax ID Type","Art der Steuernummer des Käufers" "By default it is ""reports.paypal.com"".","Standardmäßige Einstellung ist ""reports.paypal.com""." "CNPJ","CNPJ" "CPF","CPF" @@ -220,7 +220,7 @@ "Merchant Liability","Haftbarkeit des Händlers" "Merchant Protection Eligibility","Händlerschutz Berechtigung" "Merchant Referral Bonus","Händler Empfehlungsbonus" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Das Händlerkonto hat keine Abhebungsfunktion. Der Händler muss die Zahlung manuell annehmen oder ablehnen im ""Account Overview"" (Kontoübersicht)." +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Das Händlerkonto hat keine Abhebungsfunktion. Der Händler muss die Zahlung manuell annehmen oder ablehnen im ""Account Overview"" (Kontoübersicht)." "Merchant account is not verified.","Händlerkonto ist nicht verifiziert." "Merchant denied this pending payment.","Der Händler hat diese ausstehende Zahlung verweigert." "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","Der Händler besitzt ein Nicht-US Konto und hat keinen Überweisungsautomatismus." @@ -416,7 +416,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","Das Bild oben links auf der Checkout-Seite. Max. Größe 750 x 90 Pixel. https wird dringend empfohlen." "The maximum number of child authorizations is reached.","Die maximal mögliche Anzahl an Kinder-Autorisationen ist erreicht." "The merchant account is not yet verified.","Das Händlerkonto wurde noch nicht verifiziert." -"The payment curency does not match any of the merchant\'s balances currency.","Die Währung der Zahlung stimmt mit keiner der Währungen des Kontos des Händlers überein." +"The payment curency does not match any of the merchant's balances currency.","Die Währung der Zahlung stimmt mit keiner der Währungen des Kontos des Händlers überein." "The payment eCheck is not yet cleared.","Zahlung per eCheck ist noch nicht vereinbart." "The payment is authorized but not settled.","Die Zahlung wurde autorisiert aber noch nicht ausgeführt." "The payment is pending because it was made to an email address that is not yet registered or confirmed.","Die Zahlung steht noch aus, da sie an eine Email-Adresse versandt wurde, die weder registriert noch bestätigt ist." @@ -463,7 +463,7 @@ "Virtual PayPal Debit Card Transaction","Virtuelle PayPal Überweisung mit Debitkarte" "Virtual Terminal Payment","Virtuelles Zahlungsterminal" "Void","Leer" -"Waiting until Customer\'s eCheck will be cleared.","Warten bis der eCheck des Kunden freigegeben ist." +"Waiting until Customer's eCheck will be cleared.","Warten bis der eCheck des Kunden freigegeben ist." "We prefer PayPal (150 X 40)","Wir bevorzugen PayPal (150 X 40)" "We prefer PayPal (150 X 60)","Wir bevorzugen PayPal (150 X 60)" "Website Payments Plus","Webseite Zahlungen Plus" diff --git a/app/code/Magento/Paypal/i18n/en_US.csv b/app/code/Magento/Paypal/i18n/en_US.csv index 8cea21541ae01..5d65fec9c8463 100644 --- a/app/code/Magento/Paypal/i18n/en_US.csv +++ b/app/code/Magento/Paypal/i18n/en_US.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","Your billing agreement # is: %s." "Bonus for first ACH Use","Bonus for first ACH Use" "Buyer Credit Payment","Buyer Credit Payment" -"Buyer\'s Tax ID","Buyer\'s Tax ID" -"Buyer\'s Tax ID Type","Buyer\'s Tax ID Type" +"Buyer's Tax ID","Buyer's Tax ID" +"Buyer's Tax ID Type","Buyer's Tax ID Type" "By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." "CNPJ","CNPJ" "CPF","CPF" @@ -220,7 +220,7 @@ "Merchant Liability","Merchant Liability" "Merchant Protection Eligibility","Merchant Protection Eligibility" "Merchant Referral Bonus","Merchant Referral Bonus" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview." +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview." "Merchant account is not verified.","Merchant account is not verified." "Merchant denied this pending payment.","Merchant denied this pending payment." "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","Merchant holds a non-U.S. account and does not have a withdrawal mechanism." @@ -415,7 +415,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged." "The maximum number of child authorizations is reached.","The maximum number of child authorizations is reached." "The merchant account is not yet verified.","The merchant account is not yet verified." -"The payment curency does not match any of the merchant\'s balances currency.","The payment curency does not match any of the merchant\'s balances currency." +"The payment curency does not match any of the merchant's balances currency.","The payment curency does not match any of the merchant's balances currency." "The payment eCheck is not yet cleared.","The payment eCheck is not yet cleared." "The payment is authorized but not settled.","The payment is authorized but not settled." "The payment is pending because it was made to an email address that is not yet registered or confirmed.","The payment is pending because it was made to an email address that is not yet registered or confirmed." @@ -462,7 +462,7 @@ "Virtual PayPal Debit Card Transaction","Virtual PayPal Debit Card Transaction" "Virtual Terminal Payment","Virtual Terminal Payment" "Void","Void" -"Waiting until Customer\'s eCheck will be cleared.","Waiting until Customer\'s eCheck will be cleared." +"Waiting until Customer's eCheck will be cleared.","Waiting until Customer's eCheck will be cleared." "We prefer PayPal (150 X 40)","We prefer PayPal (150 X 40)" "We prefer PayPal (150 X 60)","We prefer PayPal (150 X 60)" "Website Payments Plus","Website Payments Plus" diff --git a/app/code/Magento/Paypal/i18n/es_ES.csv b/app/code/Magento/Paypal/i18n/es_ES.csv index 54e9caf5fc430..c4aeb894f336d 100644 --- a/app/code/Magento/Paypal/i18n/es_ES.csv +++ b/app/code/Magento/Paypal/i18n/es_ES.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","Su número de acuerdo de facturación es: %s." "Bonus for first ACH Use","Bono por el primer Uso de ACH" "Buyer Credit Payment","Pago de Crédito de Comprador" -"Buyer\'s Tax ID","Número de identificación social del contribuyente del comprador\es" -"Buyer\'s Tax ID Type","Tipo de número de identificación social del contribuyente del comprador\es" +"Buyer's Tax ID","Número de identificación social del contribuyente del comprador\es" +"Buyer's Tax ID Type","Tipo de número de identificación social del contribuyente del comprador\es" "By default it is ""reports.paypal.com"".","Por defecto es ""reports.paypal.com""." "CNPJ","CNPJ" "CPF","CPF" @@ -220,7 +220,7 @@ "Merchant Liability","Responsabilidad del comerciante" "Merchant Protection Eligibility","Requisitos de protección de mercado" "Merchant Referral Bonus","Bonificación de referencia del comerciante" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","La cuenta del envío no tiene una opción de retirada de dinero. El recipiente debe aceptar o rechazar manualmente este pago de su resumen de cuentas." +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","La cuenta del envío no tiene una opción de retirada de dinero. El recipiente debe aceptar o rechazar manualmente este pago de su resumen de cuentas." "Merchant account is not verified.","La cuenta del comerciante no ha sido verificada." "Merchant denied this pending payment.","El comerciante denegó este pago pendiente." "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","El comerciante no posee una cuenta de EEUU ni tampoco un mecanismo de retirada de dinero." @@ -416,7 +416,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","Imagen en la parte superior izquierda de la página de pago. El tamaño máximo es 750x90 píxeles. Se recomienda encarecidamente el uso de https." "The maximum number of child authorizations is reached.","Se ha alcanzado el número máximo de autorizaciones infantiles." "The merchant account is not yet verified.","Todavía no se ha verificado la cuenta de vendedor." -"The payment curency does not match any of the merchant\'s balances currency.","La moneda de pago no coincide con ninguna de las monedas de saldo del vendedor." +"The payment curency does not match any of the merchant's balances currency.","La moneda de pago no coincide con ninguna de las monedas de saldo del vendedor." "The payment eCheck is not yet cleared.","Todavía no se ha limpiado el eCheck de pago." "The payment is authorized but not settled.","El pago se ha autorizado, pero no se ha realizado." "The payment is pending because it was made to an email address that is not yet registered or confirmed.","El pago está pendiente porque se ha realizado a una dirección de mail que todavía no se ha registrado o confirmado." @@ -463,7 +463,7 @@ "Virtual PayPal Debit Card Transaction","Transacción de Tarjeta de Débito de PayPal Virtual" "Virtual Terminal Payment","Pago Terminal virtual" "Void","Nulo" -"Waiting until Customer\'s eCheck will be cleared.","En espera hasta que se produzca la compensación del Cheque Electrónico del Cliente" +"Waiting until Customer's eCheck will be cleared.","En espera hasta que se produzca la compensación del Cheque Electrónico del Cliente" "We prefer PayPal (150 X 40)","Preferimos PayPal (150 X 40)" "We prefer PayPal (150 X 60)","Preferimos PayPal (150 X 60)" "Website Payments Plus","Pagos Web Plus" diff --git a/app/code/Magento/Paypal/i18n/fr_FR.csv b/app/code/Magento/Paypal/i18n/fr_FR.csv index 6eaf7201817d1..ced16b1777add 100644 --- a/app/code/Magento/Paypal/i18n/fr_FR.csv +++ b/app/code/Magento/Paypal/i18n/fr_FR.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","Votre accord de facturation # est : %s." "Bonus for first ACH Use","Bonus pour première utilisation de l'ACH" "Buyer Credit Payment","Paiement acheteur" -"Buyer\'s Tax ID","Identification fiscale de l'acheteur" -"Buyer\'s Tax ID Type","Type d'identification fiscale de l'acheteur" +"Buyer's Tax ID","Identification fiscale de l'acheteur" +"Buyer's Tax ID Type","Type d'identification fiscale de l'acheteur" "By default it is ""reports.paypal.com"".","Par défaut ""reports.paypal.com""" "CNPJ","CNPJ" "CPF","CPF" @@ -220,7 +220,7 @@ "Merchant Liability","Responsabilité du vendeur" "Merchant Protection Eligibility","Eligibilité de protection marchande" "Merchant Referral Bonus","Bonus de parrainage d'un vendeur" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Le compte marchand n'a pas de mécanisme de retrait. Le marchand doit accepter ou refuser manuellement ce paiement à partir de l'aperçu du compte." +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Le compte marchand n'a pas de mécanisme de retrait. Le marchand doit accepter ou refuser manuellement ce paiement à partir de l'aperçu du compte." "Merchant account is not verified.","Le compte du vendeur n'est pas vérifié." "Merchant denied this pending payment.","Le vendeur a refusé ce paiement en attente." "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","Le vendeur utilise un compte en dehors des Etats Unis et ne dispose pas d'un mécanisme de virement de fonds." @@ -416,7 +416,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","L'image en haut à gauche de la page de paiement. Taille maximum : 750 x 90 pixels. https est fortement conseillé." "The maximum number of child authorizations is reached.","Le nombre maximum d'autorisations pour enfant est atteint." "The merchant account is not yet verified.","Le compte du vendeur n'est pas vérifié." -"The payment curency does not match any of the merchant\'s balances currency.","La monnaie du paiement ne correspond pas aux monnaies acceptées par le vendeur." +"The payment curency does not match any of the merchant's balances currency.","La monnaie du paiement ne correspond pas aux monnaies acceptées par le vendeur." "The payment eCheck is not yet cleared.","Le paiement eCheck n'est pas encore validé." "The payment is authorized but not settled.","Le paiement est autorisé mais pas encore réglé." "The payment is pending because it was made to an email address that is not yet registered or confirmed.","Le paiement est en attente car il a été fait vers une adresse qui n'est pas encore enregistrée ou confirmée." @@ -463,7 +463,7 @@ "Virtual PayPal Debit Card Transaction","Transaction via carte de débit virtuelle Paypal" "Virtual Terminal Payment","Terminal de paiement virtuel" "Void","Annuler" -"Waiting until Customer\'s eCheck will be cleared.","En attente de la vérification de l'eCheck du client." +"Waiting until Customer's eCheck will be cleared.","En attente de la vérification de l'eCheck du client." "We prefer PayPal (150 X 40)","Nous préférons Paypal (150 X 40)" "We prefer PayPal (150 X 60)","Nous préférons PayPal (150 X 60)" "Website Payments Plus","Paiements site Internet Plus" diff --git a/app/code/Magento/Paypal/i18n/nl_NL.csv b/app/code/Magento/Paypal/i18n/nl_NL.csv index d55a5b8263688..ce55d5c76b98c 100644 --- a/app/code/Magento/Paypal/i18n/nl_NL.csv +++ b/app/code/Magento/Paypal/i18n/nl_NL.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","Uw factureringsovereenkomst # is: %s." "Bonus for first ACH Use","Bonus voor eerste ACH gebruik" "Buyer Credit Payment","Koper krediet betaling" -"Buyer\'s Tax ID","Kopers Belastings ID" -"Buyer\'s Tax ID Type","Koper 's Belastings ID Type" +"Buyer's Tax ID","Kopers Belastings ID" +"Buyer's Tax ID Type","Koper 's Belastings ID Type" "By default it is ""reports.paypal.com"".","Ingesteld op ""reports.paypal.com""." "CNPJ","CNPJ" "CPF","CPF" @@ -220,7 +220,7 @@ "Merchant Liability","Winkelier Aansprakelijkheid" "Merchant Protection Eligibility","In aanmerking komen voor handelaar bescherming" "Merchant Referral Bonus","Handelaar Doorverwijzing Bonus" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Handelaar account heeft geen opname mechanisme. Handelaar moet handmatig betalingen accepteren of weigeren via zijn Account Overzicht." +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Handelaar account heeft geen opname mechanisme. Handelaar moet handmatig betalingen accepteren of weigeren via zijn Account Overzicht." "Merchant account is not verified.","Handelaar account niet geverifieerd." "Merchant denied this pending payment.","Handelaar heeft deze betaling afgewezen." "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","Handelaar bezit een niet-Amerikaans account en heeft geen opname mechanisme." @@ -415,7 +415,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","De afbeelding linksboven op de afrekeningspagina. Maximale grootte is 750x90 pixels. Https is ten sterkte aangeraden." "The maximum number of child authorizations is reached.","Het maximale aantal kindmachtigingen is bereikt." "The merchant account is not yet verified.","De handelsaccount is nog niet geverifieerd." -"The payment curency does not match any of the merchant\'s balances currency.","De betalingsvaluta komt met geen enkele valuta van de saldi van de handelaar overeen." +"The payment curency does not match any of the merchant's balances currency.","De betalingsvaluta komt met geen enkele valuta van de saldi van de handelaar overeen." "The payment eCheck is not yet cleared.","De betalings eCheck is nog niet vrijgegeven." "The payment is authorized but not settled.","De betaling is gemachtigd, maar niet afgehandeld." "The payment is pending because it was made to an email address that is not yet registered or confirmed.","De betaling staat in de wacht omdat deze aangemaakt is met een emailadres dat nog niet geregistreerd of bevestigd is." @@ -462,7 +462,7 @@ "Virtual PayPal Debit Card Transaction","Virtuele Paypal Debitcard Transactie" "Virtual Terminal Payment","Virtuele Laatste Betaling" "Void","Geldig" -"Waiting until Customer\'s eCheck will be cleared.","Wachten tot Klant\'s eCheck wordt vrijgegeven." +"Waiting until Customer's eCheck will be cleared.","Wachten tot Klant's eCheck wordt vrijgegeven." "We prefer PayPal (150 X 40)","PayPal heeft onze voorkeur (150 X 40)" "We prefer PayPal (150 X 60)","Paypal heeft onze voorkeur (150 X 60)" "Website Payments Plus","Website betalingen plus" diff --git a/app/code/Magento/Paypal/i18n/pt_BR.csv b/app/code/Magento/Paypal/i18n/pt_BR.csv index 2b8cf17f49c6d..7a972a9003ca1 100644 --- a/app/code/Magento/Paypal/i18n/pt_BR.csv +++ b/app/code/Magento/Paypal/i18n/pt_BR.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","Seu acordo de faturamento # está: %s." "Bonus for first ACH Use","Bônus pelo primeiro uso do ACH" "Buyer Credit Payment","Pagamento de Crédito do Comprador" -"Buyer\'s Tax ID","CPF do Comprador" -"Buyer\'s Tax ID Type","Tipo de CPF/CNPJ do Comprador" +"Buyer's Tax ID","CPF do Comprador" +"Buyer's Tax ID Type","Tipo de CPF/CNPJ do Comprador" "By default it is ""reports.paypal.com"".","Por padrão, é ""reports.paypal.com""." "CNPJ","CNPJ (Cadastro Nacional de Pessoas Jurídicas)" "CPF","CPF (Cadastro de Contribuintes Pessoas Físicas)" @@ -220,7 +220,7 @@ "Merchant Liability","Responsabilidade do Comerciante" "Merchant Protection Eligibility","Elegibilidade de Proteção do Comerciante" "Merchant Referral Bonus","Bónus de Comerciante" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Conta do comerciante não tem um mecanismo de levantamento. O comerciante deve aceitar ou recusar manualmente esse pagamento a partir de sua Visão Geral da conta." +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","Conta do comerciante não tem um mecanismo de levantamento. O comerciante deve aceitar ou recusar manualmente esse pagamento a partir de sua Visão Geral da conta." "Merchant account is not verified.","Conta do comerciante não verificada." "Merchant denied this pending payment.","Comerciante recusou o pagamento pendente." "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","O comerciante é titular de uma conta fora dos EUA e não tem um mecanismo de levantamento." @@ -415,7 +415,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","A imagem no canto superior esquerdo da página de compra. Tamanho máximo é 750x90 pixels. https é altamente recomendado." "The maximum number of child authorizations is reached.","O número máximo de autorizações de criança foi atingido." "The merchant account is not yet verified.","A conta de comerciante ainda não foi confirmada." -"The payment curency does not match any of the merchant\'s balances currency.","A moeda de pagamento não corresponde a nenhuma das moedas dos balanços do comerciante." +"The payment curency does not match any of the merchant's balances currency.","A moeda de pagamento não corresponde a nenhuma das moedas dos balanços do comerciante." "The payment eCheck is not yet cleared.","O pagamento eCheck ainda não está clarificado." "The payment is authorized but not settled.","O pagamento está autorizado, mas não liquidado." "The payment is pending because it was made to an email address that is not yet registered or confirmed.","O pagamento está pendente porque foi feito para um endereço de e-mail que ainda não está registrado ou confirmado." @@ -462,7 +462,7 @@ "Virtual PayPal Debit Card Transaction","Transação via Cartão de Débito Virtual PayPal" "Virtual Terminal Payment","Pagamento via Terminal Virtual" "Void","Anular" -"Waiting until Customer\'s eCheck will be cleared.","Aguardando eCheck do Cliente ser liberado." +"Waiting until Customer's eCheck will be cleared.","Aguardando eCheck do Cliente ser liberado." "We prefer PayPal (150 X 40)","Preferimos PayPal (150 x 40)" "We prefer PayPal (150 X 60)","Preferimos PayPal (150 x 60)" "Website Payments Plus","Website Payments Plus" diff --git a/app/code/Magento/Paypal/i18n/zh_CN.csv b/app/code/Magento/Paypal/i18n/zh_CN.csv index 3ead5d652b5d9..8b5bada846041 100644 --- a/app/code/Magento/Paypal/i18n/zh_CN.csv +++ b/app/code/Magento/Paypal/i18n/zh_CN.csv @@ -65,8 +65,8 @@ "Your billing agreement # is: %s.","您的账单编号为: %s" "Bonus for first ACH Use","首次使用ACH奖励" "Buyer Credit Payment","买家信用支付" -"Buyer\'s Tax ID","买家的纳税人 ID" -"Buyer\'s Tax ID Type","买家的纳税人 ID 类型" +"Buyer's Tax ID","买家的纳税人 ID" +"Buyer's Tax ID Type","买家的纳税人 ID 类型" "By default it is ""reports.paypal.com"".","默认为“reports.paypal.com”。" "CNPJ","CNPJ" "CPF","CPF" @@ -220,7 +220,7 @@ "Merchant Liability","商家责任" "Merchant Protection Eligibility","银行保护的资格" "Merchant Referral Bonus","银行推荐奖励" -"Merchant account doesn\'t have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","银行帐户没有撤销机制。银行必须从您的帐户概述中手工接受或拒绝本支付。" +"Merchant account doesn't have a withdrawal mechanism. Merchant must manually accept or deny this payment from your Account Overview.","银行帐户没有撤销机制。银行必须从您的帐户概述中手工接受或拒绝本支付。" "Merchant account is not verified.","银行帐户未验证。" "Merchant denied this pending payment.","银行拒绝了这一挂起的支付。" "Merchant holds a non-U.S. account and does not have a withdrawal mechanism.","银行提供了非美国帐户,并且没有撤销机制。" @@ -415,7 +415,7 @@ "The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged.","付款页面左上角的图像,最大尺寸为750x90像素。 强烈建议使用https地址。" "The maximum number of child authorizations is reached.","授权子帐户的最大数量已达到。" "The merchant account is not yet verified.","银行帐户尚未验证。" -"The payment curency does not match any of the merchant\'s balances currency.","支付的币种与银行支持的币种不一致。" +"The payment curency does not match any of the merchant's balances currency.","支付的币种与银行支持的币种不一致。" "The payment eCheck is not yet cleared.","支付的电子支票尚未兑现。" "The payment is authorized but not settled.","支付已获授权但尚未确定。" "The payment is pending because it was made to an email address that is not yet registered or confirmed.","支付被挂起,因为支付使用了一个未经确认的电子邮件地址。" @@ -462,7 +462,7 @@ "Virtual PayPal Debit Card Transaction","虚拟PayPal借记卡交易" "Virtual Terminal Payment","虚拟终端支付" "Void","无效" -"Waiting until Customer\'s eCheck will be cleared.","等待直到客户的电子支票兑现。" +"Waiting until Customer's eCheck will be cleared.","等待直到客户的电子支票兑现。" "We prefer PayPal (150 X 40)","我们喜欢PayPal(150X40)" "We prefer PayPal (150 X 60)","我们喜欢PayPal(150X60)" "Website Payments Plus","网站支付高级版" diff --git a/app/code/Magento/Persistent/Model/Observer.php b/app/code/Magento/Persistent/Model/Observer.php index 5c0e79c2872bd..c612083c82fa9 100644 --- a/app/code/Magento/Persistent/Model/Observer.php +++ b/app/code/Magento/Persistent/Model/Observer.php @@ -517,7 +517,7 @@ protected function _getQuote() { /** @var \Magento\Sales\Model\Quote $quote */ $quote = $this->_quoteFactory->create(); - $quote->loadByCustomer($this->_getPersistentCustomer()); + $quote->loadByCustomer($this->_persistentSession->getSession()->getCustomerId()); return $quote; } diff --git a/app/code/Magento/Persistent/Model/Session.php b/app/code/Magento/Persistent/Model/Session.php index a36d282b2f11e..82f4cee0f2acc 100644 --- a/app/code/Magento/Persistent/Model/Session.php +++ b/app/code/Magento/Persistent/Model/Session.php @@ -101,8 +101,8 @@ class Session extends \Magento\Core\Model\AbstractModel /** * Construct * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\App\ConfigInterface $coreConfig * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Persistent\Helper\Data $persistentData @@ -115,8 +115,8 @@ class Session extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\App\ConfigInterface $coreConfig, \Magento\Core\Helper\Data $coreData, \Magento\Persistent\Helper\Data $persistentData, diff --git a/app/code/Magento/Persistent/i18n/de_DE.csv b/app/code/Magento/Persistent/i18n/de_DE.csv index 6bd594fbd3f4f..f994c8c705861 100644 --- a/app/code/Magento/Persistent/i18n/de_DE.csv +++ b/app/code/Magento/Persistent/i18n/de_DE.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","Um weiter zur Kasse zu gehen, melden Sie sich bitte mit Ihrer E-Mail-Adresse an." "VAT Number","MwSt.-Nummer" "Welcome, %s!","Willkommen, %s!" -"What\'s this?","Was ist das?" +"What's this?","Was ist das?" "Zip/Postal Code","Postleitzahl" diff --git a/app/code/Magento/Persistent/i18n/en_US.csv b/app/code/Magento/Persistent/i18n/en_US.csv index a402521a1e865..e45246f8ae8ed 100644 --- a/app/code/Magento/Persistent/i18n/en_US.csv +++ b/app/code/Magento/Persistent/i18n/en_US.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." "VAT Number","VAT Number" "Welcome, %s!","Welcome, %s!" -"What\'s this?","What\'s this?" +"What's this?","What's this?" "Zip/Postal Code","Zip/Postal Code" diff --git a/app/code/Magento/Persistent/i18n/es_ES.csv b/app/code/Magento/Persistent/i18n/es_ES.csv index fc70d0dc3ead2..7a6ae4c2e1674 100644 --- a/app/code/Magento/Persistent/i18n/es_ES.csv +++ b/app/code/Magento/Persistent/i18n/es_ES.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","Para proceder a la comprobación, por favor, inicie sesión con su dirección de correo electrónico." "VAT Number","Número de IVA" "Welcome, %s!","¡Bienvenido, %s!" -"What\'s this?","¿Qué es esto?" +"What's this?","¿Qué es esto?" "Zip/Postal Code","Código postal" diff --git a/app/code/Magento/Persistent/i18n/fr_FR.csv b/app/code/Magento/Persistent/i18n/fr_FR.csv index 2b5a7f5cb7d34..82d77f2333d60 100644 --- a/app/code/Magento/Persistent/i18n/fr_FR.csv +++ b/app/code/Magento/Persistent/i18n/fr_FR.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","Pour passer votre commande, veuillez vous connecter en utilisant votre adresse e-mail." "VAT Number","Numéro TVA" "Welcome, %s!","Bienvenue, %s !" -"What\'s this?","Qu'est-ce ?" +"What's this?","Qu'est-ce ?" "Zip/Postal Code","Code postal" diff --git a/app/code/Magento/Persistent/i18n/nl_NL.csv b/app/code/Magento/Persistent/i18n/nl_NL.csv index 4a34390517b88..ccba8a511c70d 100644 --- a/app/code/Magento/Persistent/i18n/nl_NL.csv +++ b/app/code/Magento/Persistent/i18n/nl_NL.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","Om verder te gaan naar Checkout, gelieve in te loggen met uw email adres." "VAT Number","BTW nummer" "Welcome, %s!","Welkom, %s!" -"What\'s this?","Wat is dit?" +"What's this?","Wat is dit?" "Zip/Postal Code","Zip/Postcode" diff --git a/app/code/Magento/Persistent/i18n/pt_BR.csv b/app/code/Magento/Persistent/i18n/pt_BR.csv index 1782977898d4c..343991c764ec7 100644 --- a/app/code/Magento/Persistent/i18n/pt_BR.csv +++ b/app/code/Magento/Persistent/i18n/pt_BR.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","Para fazer checkout, por favor faça login usando o seu endereço de e-mail." "VAT Number","Número VAT" "Welcome, %s!","Bem-vindo, %s!" -"What\'s this?","O que é isso?" +"What's this?","O que é isso?" "Zip/Postal Code","Zip/Código Postal" diff --git a/app/code/Magento/Persistent/i18n/zh_CN.csv b/app/code/Magento/Persistent/i18n/zh_CN.csv index 7353117fb0143..8bab2cf2f41f8 100644 --- a/app/code/Magento/Persistent/i18n/zh_CN.csv +++ b/app/code/Magento/Persistent/i18n/zh_CN.csv @@ -60,5 +60,5 @@ "To proceed to Checkout, please log in using your email address.","要继续结账,请使用你的电子邮件地址登录。" "VAT Number","VAT 编号" "Welcome, %s!","欢迎,%s!" -"What\'s this?","这是什么?" +"What's this?","这是什么?" "Zip/Postal Code","邮政编码" diff --git a/app/code/Magento/ProductAlert/Block/Product/View.php b/app/code/Magento/ProductAlert/Block/Product/View.php index f1bdcee41cacb..c98e7938a891d 100644 --- a/app/code/Magento/ProductAlert/Block/Product/View.php +++ b/app/code/Magento/ProductAlert/Block/Product/View.php @@ -32,7 +32,7 @@ class View extends \Magento\View\Element\Template { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -53,13 +53,13 @@ class View extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\ProductAlert\Helper\Data $helper - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\ProductAlert\Helper\Data $helper, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { parent::__construct($context, $data); diff --git a/app/code/Magento/ProductAlert/Helper/Data.php b/app/code/Magento/ProductAlert/Helper/Data.php index d2d744e52858c..b94d87e528b86 100644 --- a/app/code/Magento/ProductAlert/Helper/Data.php +++ b/app/code/Magento/ProductAlert/Helper/Data.php @@ -46,10 +46,10 @@ class Data extends \Magento\Core\Helper\Url /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Core store config * @@ -70,7 +70,7 @@ class Data extends \Magento\Core\Helper\Url /** * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\View\LayoutInterface $layout * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Customer\Model\Session $session @@ -78,7 +78,7 @@ class Data extends \Magento\Core\Helper\Url public function __construct( \Magento\App\Helper\Context $context, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\View\LayoutInterface $layout, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Customer\Model\Session $session diff --git a/app/code/Magento/ProductAlert/Model/Email.php b/app/code/Magento/ProductAlert/Model/Email.php index b4b25f1d78058..886262edd1b88 100644 --- a/app/code/Magento/ProductAlert/Model/Email.php +++ b/app/code/Magento/ProductAlert/Model/Email.php @@ -119,32 +119,32 @@ class Email extends \Magento\Core\Model\AbstractModel protected $_appEmulation; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateFactory; + protected $_transportBuilder; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\ProductAlert\Helper\Data $productAlertData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Core\Model\App\Emulation $appEmulation - * @param \Magento\Email\Model\TemplateFactory $templateFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\ProductAlert\Helper\Data $productAlertData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Core\Model\App\Emulation $appEmulation, - \Magento\Email\Model\TemplateFactory $templateFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -154,7 +154,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_customerFactory = $customerFactory; $this->_appEmulation = $appEmulation; - $this->_templateFactory = $templateFactory; + $this->_transportBuilder = $transportBuilder; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -350,20 +350,21 @@ public function send() $this->_appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); - $this->_templateFactory->create() - ->setDesignConfig(array( + $transport = $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, 'store' => $storeId - ))->sendTransactional( - $templateId, - $this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId), - $this->_customer->getEmail(), - $this->_customer->getName(), - array( - 'customerName' => $this->_customer->getName(), - 'alertGrid' => $block - ) - ); + )) + ->setTemplateVars(array( + 'customerName' => $this->_customer->getName(), + 'alertGrid' => $block + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($this->_customer->getEmail(), $this->_customer->getName()) + ->getTransport(); + + $transport->sendMessage(); return true; } diff --git a/app/code/Magento/ProductAlert/Model/Observer.php b/app/code/Magento/ProductAlert/Model/Observer.php index 70442dd02bd69..4c029e6595401 100644 --- a/app/code/Magento/ProductAlert/Model/Observer.php +++ b/app/code/Magento/ProductAlert/Model/Observer.php @@ -127,9 +127,9 @@ class Observer protected $_translate; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateFactory; + protected $_transportBuilder; /** * @var \Magento\ProductAlert\Model\EmailFactory @@ -146,7 +146,7 @@ class Observer * @param \Magento\Core\Model\DateFactory $dateFactory * @param \Magento\ProductAlert\Model\Resource\Stock\CollectionFactory $stockColFactory * @param \Magento\TranslateInterface $translate - * @param \Magento\Email\Model\TemplateFactory $templateFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\ProductAlert\Model\EmailFactory $emailFactory */ public function __construct( @@ -159,7 +159,7 @@ public function __construct( \Magento\Core\Model\DateFactory $dateFactory, \Magento\ProductAlert\Model\Resource\Stock\CollectionFactory $stockColFactory, \Magento\TranslateInterface $translate, - \Magento\Email\Model\TemplateFactory $templateFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\ProductAlert\Model\EmailFactory $emailFactory ) { $this->_taxData = $taxData; @@ -171,7 +171,7 @@ public function __construct( $this->_dateFactory = $dateFactory; $this->_stockColFactory = $stockColFactory; $this->_translate = $translate; - $this->_templateFactory = $templateFactory; + $this->_transportBuilder = $transportBuilder; $this->_emailFactory = $emailFactory; } @@ -380,19 +380,22 @@ protected function _sendErrorEmail() return $this; } - $$this->_translate->setTranslateInline(false); + $this->_translate->setTranslateInline(false); - /* @var $emailTemplate \Magento\Email\Model\Template */ - $this->_templateFactory->create()->setDesignConfig(array('area' => 'backend')) - ->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_IDENTITY), - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT), - null, - array('warnings' => join("\n", $this->_errors)) - ); + $transport = $this->_transportBuilder + ->setTemplateIdentifier($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_TEMPLATE)) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $this->_storeManager->getStore()->getId() + )) + ->setTemplateVars(array('warnings' => join("\n", $this->_errors))) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_IDENTITY)) + ->addTo($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT)) + ->getTransport(); - $$this->_translate->setTranslateInline(true); + $transport->sendMessage(); + + $this->_translate->setTranslateInline(true); $this->_errors[] = array(); } return $this; diff --git a/app/code/Magento/ProductAlert/Model/Price.php b/app/code/Magento/ProductAlert/Model/Price.php index 5d5e72f08a065..0117f7fb15879 100644 --- a/app/code/Magento/ProductAlert/Model/Price.php +++ b/app/code/Magento/ProductAlert/Model/Price.php @@ -61,16 +61,16 @@ class Price extends \Magento\Core\Model\AbstractModel protected $_customerColFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\ProductAlert\Model\Resource\Price\Customer\CollectionFactory $customerColFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\ProductAlert\Model\Resource\Price\Customer\CollectionFactory $customerColFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/ProductAlert/Model/Stock.php b/app/code/Magento/ProductAlert/Model/Stock.php index 60acab15364f5..8a5217be98e7e 100644 --- a/app/code/Magento/ProductAlert/Model/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Stock.php @@ -59,16 +59,16 @@ class Stock extends \Magento\Core\Model\AbstractModel protected $_customerColFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\ProductAlert\Model\Resource\Stock\Customer\CollectionFactory $customerColFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\ProductAlert\Model\Resource\Stock\Customer\CollectionFactory $customerColFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/ProductAlert/etc/module.xml b/app/code/Magento/ProductAlert/etc/module.xml index 40d29f0c30a3d..ebac0744f61db 100755 --- a/app/code/Magento/ProductAlert/etc/module.xml +++ b/app/code/Magento/ProductAlert/etc/module.xml @@ -34,7 +34,6 @@ - diff --git a/app/code/Magento/Rating/Block/Adminhtml/Edit.php b/app/code/Magento/Rating/Block/Adminhtml/Edit.php index eefe3fab22e8c..aa85dd2544149 100644 --- a/app/code/Magento/Rating/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Rating/Block/Adminhtml/Edit.php @@ -34,7 +34,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -49,13 +49,13 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Rating\Model\RatingFactory $ratingFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Rating\Model\RatingFactory $ratingFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_ratingFactory = $ratingFactory; diff --git a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php index c9daf35b314d6..5612e513ad2c4 100644 --- a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php +++ b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php @@ -51,7 +51,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Rating\Model\Rating\OptionFactory $optionFactory * @param \Magento\Session\SessionManagerInterface $session @@ -60,7 +60,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Rating\Model\Rating\OptionFactory $optionFactory, \Magento\Session\SessionManagerInterface $session, diff --git a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php index 87cd46003adac..5dd5afded546d 100644 --- a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php +++ b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php @@ -37,14 +37,14 @@ class Options extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Rating\Model\Rating\OptionFactory $optionFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Rating\Model\Rating\OptionFactory $optionFactory, array $data = array() diff --git a/app/code/Magento/Rating/Controller/Adminhtml/Index.php b/app/code/Magento/Rating/Controller/Adminhtml/Index.php index d85ad15f4588e..bc9542cda4f97 100644 --- a/app/code/Magento/Rating/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Rating/Controller/Adminhtml/Index.php @@ -36,17 +36,17 @@ class Index extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Rating/Model/Rating.php b/app/code/Magento/Rating/Model/Rating.php index 184166ffc1625..71d65b99e8ca4 100644 --- a/app/code/Magento/Rating/Model/Rating.php +++ b/app/code/Magento/Rating/Model/Rating.php @@ -61,8 +61,8 @@ class Rating extends \Magento\Core\Model\AbstractModel protected $_ratingCollectionF; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Rating\Model\Rating\OptionFactory $ratingOptionFactory * @param \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -70,8 +70,8 @@ class Rating extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Rating\Model\Rating\OptionFactory $ratingOptionFactory, \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php b/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php index d0e0a0d112e09..bff5d51cc28c7 100644 --- a/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php +++ b/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php @@ -38,7 +38,7 @@ class Collection extends \Magento\Rating\Model\Resource\Rating\Collection /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -49,7 +49,7 @@ class Collection extends \Magento\Rating\Model\Resource\Rating\Collection * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ @@ -60,7 +60,7 @@ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { diff --git a/app/code/Magento/RecurringProfile/Block/Adminhtml/Customer/Edit/Tab/RecurringProfile.php b/app/code/Magento/RecurringProfile/Block/Adminhtml/Customer/Edit/Tab/RecurringProfile.php index c9cfa3a844e6f..1e0a9d3bacffc 100644 --- a/app/code/Magento/RecurringProfile/Block/Adminhtml/Customer/Edit/Tab/RecurringProfile.php +++ b/app/code/Magento/RecurringProfile/Block/Adminhtml/Customer/Edit/Tab/RecurringProfile.php @@ -35,7 +35,7 @@ class RecurringProfile /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -47,21 +47,21 @@ class RecurringProfile /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\RecurringProfile\Model\Resource\Profile\CollectionFactory $profileCollection * @param \Magento\RecurringProfile\Model\States $recurringStates * @param \Magento\RecurringProfile\Block\Fields $fields - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\RecurringProfile\Model\Method\PaymentMethodsList $payments + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Payment\Helper\Data $paymentData, \Magento\RecurringProfile\Model\Resource\Profile\CollectionFactory $profileCollection, \Magento\RecurringProfile\Model\States $recurringStates, \Magento\RecurringProfile\Block\Fields $fields, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\RecurringProfile\Model\Method\PaymentMethodsList $payments, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; @@ -79,10 +79,10 @@ public function __construct( parent::__construct( $context, $backendHelper, - $paymentData, $profileCollection, $recurringStates, $fields, + $payments, $data ); } diff --git a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/Grid.php b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/Grid.php index b6293e7edea90..6903133f5d7c9 100644 --- a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/Grid.php +++ b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/Grid.php @@ -27,18 +27,12 @@ */ namespace Magento\RecurringProfile\Block\Adminhtml\Profile; +/** + * Class Grid + * @todo: convert to layout update + */ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { - /** - * Set ajax/session parameters - */ - /** - * Payment data - * - * @var \Magento\Payment\Helper\Data - */ - protected $_paymentData = null; - /** * @var \Magento\RecurringProfile\Model\Resource\Profile\CollectionFactory */ @@ -54,27 +48,30 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_fields; + /** @var \Magento\RecurringProfile\Model\Method\PaymentMethodsList */ + protected $payments; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\RecurringProfile\Model\Resource\Profile\CollectionFactory $profileCollection * @param \Magento\RecurringProfile\Model\States $recurringStates * @param \Magento\RecurringProfile\Block\Fields $fields + * @param \Magento\RecurringProfile\Model\Method\PaymentMethodsList $payments * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Payment\Helper\Data $paymentData, \Magento\RecurringProfile\Model\Resource\Profile\CollectionFactory $profileCollection, \Magento\RecurringProfile\Model\States $recurringStates, \Magento\RecurringProfile\Block\Fields $fields, + \Magento\RecurringProfile\Model\Method\PaymentMethodsList $payments, array $data = array() ) { - $this->_paymentData = $paymentData; $this->_profileCollection = $profileCollection; $this->recurringStates = $recurringStates; + $this->payments = $payments; parent::__construct($context, $backendHelper, $data); $this->_fields = $fields; } @@ -151,15 +148,11 @@ protected function _prepareColumns() 'width' => 1, )); - $methods = array(); - foreach ($this->_paymentData->getRecurringProfileMethods() as $method) { - $methods[$method->getCode()] = $method->getTitle(); - } $this->addColumn('method_code', array( 'header' => $this->_fields->getFieldLabel('method_code'), 'index' => 'method_code', 'type' => 'options', - 'options' => $methods, + 'options' => $this->payments->toOptionArray(), )); $this->addColumn('schedule_description', array( diff --git a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View.php b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View.php index 36688fae546df..09dccf5a7134e 100644 --- a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View.php +++ b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View.php @@ -32,18 +32,18 @@ class View extends \Magento\Backend\Block\Widget\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Getawayinfo.php b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Getawayinfo.php index 899745b4ebd8b..e4248be3cb0e8 100644 --- a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Getawayinfo.php +++ b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Getawayinfo.php @@ -36,7 +36,7 @@ class Getawayinfo extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -47,13 +47,13 @@ class Getawayinfo extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\RecurringProfile\Block\Fields $fields * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\RecurringProfile\Block\Fields $fields, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Info.php b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Info.php index 1b7a164e85e4d..be7545581455b 100644 --- a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Info.php +++ b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Info.php @@ -36,7 +36,7 @@ class Info extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -47,13 +47,13 @@ class Info extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\RecurringProfile\Block\Fields $fields * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\RecurringProfile\Block\Fields $fields, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Tab/Orders.php b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Tab/Orders.php index 2123c842fa43c..f146c58a545fd 100644 --- a/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Tab/Orders.php +++ b/app/code/Magento/RecurringProfile/Block/Adminhtml/Profile/View/Tab/Orders.php @@ -34,12 +34,12 @@ class Orders /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** - * @var \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory + * @var \Magento\Sales\Model\Resource\Order\CollectionFactory */ protected $_orderCollection; @@ -48,25 +48,32 @@ class Orders */ protected $_orderConfig; + /** + * @var \Magento\RecurringProfile\Model\Resource\Order\CollectionFilter + */ + protected $_recurringCollectionFilter; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $orderCollection + * @param \Magento\Registry $coreRegistry + * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollection * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Core\Model\Registry $coreRegistry, - \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $orderCollection, + \Magento\Registry $coreRegistry, + \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollection, \Magento\Sales\Model\Order\ConfigFactory $orderConfig, + \Magento\RecurringProfile\Model\Resource\Order\CollectionFilter $recurringCollectionFilter, array $data = array() ) { $this->_coreRegistry = $coreRegistry; $this->_orderCollection = $orderCollection; $this->_orderConfig = $orderConfig; + $this->_recurringCollectionFilter = $recurringCollectionFilter; parent::__construct($context, $backendHelper, $data); } @@ -88,8 +95,10 @@ protected function _construct() */ protected function _prepareCollection() { - $collection = $this->_orderCollection->create() - ->addRecurringProfilesFilter($this->_coreRegistry->registry('current_recurring_profile')->getId()); + $collection = $this->_recurringCollectionFilter->byIds( + $this->_orderCollection->create(), + $this->_coreRegistry->registry('current_recurring_profile')->getId() + ); $this->setCollection($collection); return parent::_prepareCollection(); } diff --git a/app/code/Magento/RecurringProfile/Block/Catalog/Product/View/Profile.php b/app/code/Magento/RecurringProfile/Block/Catalog/Product/View/Profile.php index b21bc0e32e82d..ee7809e0ad2b6 100644 --- a/app/code/Magento/RecurringProfile/Block/Catalog/Product/View/Profile.php +++ b/app/code/Magento/RecurringProfile/Block/Catalog/Product/View/Profile.php @@ -39,7 +39,7 @@ class Profile extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry = null; @@ -52,13 +52,13 @@ class Profile extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\RecurringProfile\Model\RecurringProfileFactory $profileFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\RecurringProfile\Model\RecurringProfileFactory $profileFactory, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Block/Plugin/Payment.php b/app/code/Magento/RecurringProfile/Block/Plugin/Payment.php new file mode 100644 index 0000000000000..114efdf8768f1 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Block/Plugin/Payment.php @@ -0,0 +1,61 @@ +session = $session; + $this->filter = $filter; + } + + /** + * Add hasRecurringItems option + * + * @param array $result + * @return array + */ + public function afterGetOptions(array $result) + { + $quote = $this->session->getQuote(); + $result['hasRecurringItems'] = $quote && $this->filter->hasRecurringItems($quote); + return $result; + } +} \ No newline at end of file diff --git a/app/code/Magento/RecurringProfile/Block/Profile/Grid.php b/app/code/Magento/RecurringProfile/Block/Profile/Grid.php index 523e11699789b..ed54e6a566225 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/Grid.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/Grid.php @@ -30,7 +30,7 @@ class Grid extends \Magento\RecurringProfile\Block\Profiles { /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -54,14 +54,14 @@ class Grid extends \Magento\RecurringProfile\Block\Profiles /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\RecurringProfile\Model\Profile $recurringProfile - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\RecurringProfile\Block\Fields $fields * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\RecurringProfile\Model\Profile $recurringProfile, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\RecurringProfile\Block\Fields $fields, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Block/Profile/Related/Orders/Grid.php b/app/code/Magento/RecurringProfile/Block/Profile/Related/Orders/Grid.php index 7e8566318da2a..112c131a836e7 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/Related/Orders/Grid.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/Related/Orders/Grid.php @@ -30,7 +30,7 @@ class Grid extends \Magento\RecurringProfile\Block\Profile\View { /** - * @var \Magento\Sales\Model\Resource\Order\Collection + * @var \Magento\RecurringProfile\Model\Resource\Order\Collection */ protected $_orderCollection; /** @@ -43,20 +43,27 @@ class Grid extends \Magento\RecurringProfile\Block\Profile\View */ protected $_coreHelper; + /** + * @var \Magento\RecurringProfile\Model\Resource\Order\CollectionFilter + */ + protected $_recurringCollectionFilter; + /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Resource\Order\Collection $collection * @param \Magento\Sales\Model\Order\Config $config * @param \Magento\Core\Helper\Data $coreHelper + * @param \Magento\RecurringProfile\Model\Resource\Order\CollectionFilter $recurringCollectionFilter * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Model\Resource\Order\Collection $collection, \Magento\Sales\Model\Order\Config $config, \Magento\Core\Helper\Data $coreHelper, + \Magento\RecurringProfile\Model\Resource\Order\CollectionFilter $recurringCollectionFilter, array $data = array() ) { $this->_coreHelper = $coreHelper; @@ -64,6 +71,7 @@ public function __construct( $this->_orderCollection = $collection; $this->_config = $config; $this->_isScopePrivate = true; + $this->_recurringCollectionFilter = $recurringCollectionFilter; } /** * Prepare related orders collection @@ -73,11 +81,14 @@ public function __construct( protected function _prepareRelatedOrders($fieldsToSelect = '*') { if (null === $this->_relatedOrders) { - $this->_relatedOrders = $this->_orderCollection + $this->_orderCollection ->addFieldToSelect($fieldsToSelect) ->addFieldToFilter('customer_id', $this->_registry->registry('current_customer')->getId()) - ->addRecurringProfilesFilter($this->_recurringProfile->getId()) ->setOrder('entity_id', 'desc'); + $this->_relatedOrders = $this->_recurringCollectionFilter->byIds( + $this->_orderCollection, + $this->_recurringProfile->getId() + ); } } diff --git a/app/code/Magento/RecurringProfile/Block/Profile/View.php b/app/code/Magento/RecurringProfile/Block/Profile/View.php index 0183fa3b3a9fd..5b5aae97d0c1a 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/View.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/View.php @@ -56,7 +56,7 @@ class View extends \Magento\View\Element\Template protected $_relatedOrders = null; /** - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; @@ -69,12 +69,12 @@ class View extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_registry = $registry; diff --git a/app/code/Magento/RecurringProfile/Block/Profile/View/Address.php b/app/code/Magento/RecurringProfile/Block/Profile/View/Address.php index 165f9ecb850f3..d3e683eb7d795 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/View/Address.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/View/Address.php @@ -31,13 +31,13 @@ class Address extends \Magento\RecurringProfile\Block\Profile\View { /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Order\AddressFactory $addressFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Model\Order\AddressFactory $addressFactory, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Block/Profile/View/Fees.php b/app/code/Magento/RecurringProfile/Block/Profile/View/Fees.php index bd800dfef3990..720336d40e7ff 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/View/Fees.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/View/Fees.php @@ -41,14 +41,14 @@ class Fees extends \Magento\RecurringProfile\Block\Profile\View /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Core\Helper\Data $coreHelper * @param \Magento\RecurringProfile\Block\Fields $fields * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Core\Helper\Data $coreHelper, \Magento\RecurringProfile\Block\Fields $fields, array $data = array() diff --git a/app/code/Magento/RecurringProfile/Block/Profile/View/Item.php b/app/code/Magento/RecurringProfile/Block/Profile/View/Item.php index 3162e01be2ed5..5fb29bc8a800e 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/View/Item.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/View/Item.php @@ -40,14 +40,14 @@ class Item extends \Magento\RecurringProfile\Block\Profile\View /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Product\Option $option * @param \Magento\Catalog\Model\Product $product * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Catalog\Model\Product\Option $option, \Magento\Catalog\Model\Product $product, array $data = array() @@ -115,7 +115,7 @@ protected function _prepareLayout() 'option_id' => $option->getId(), 'key' => $request['options'][$option->getId()]['secret_key'] ); - $group->setCustomOptionDownloadUrl('sales/download/downloadProfileCustomOption') + $group->setCustomOptionDownloadUrl('recurringProfile/download/downloadProfileCustomOption') ->setCustomOptionUrlParams($downloadParams); } diff --git a/app/code/Magento/RecurringProfile/Block/Profile/View/Reference.php b/app/code/Magento/RecurringProfile/Block/Profile/View/Reference.php index 90a94a18c8281..7041b7eae298c 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/View/Reference.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/View/Reference.php @@ -36,13 +36,13 @@ class Reference extends \Magento\RecurringProfile\Block\Profile\View /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\RecurringProfile\Block\Fields $fields * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\RecurringProfile\Block\Fields $fields, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Block/Profile/View/Schedule.php b/app/code/Magento/RecurringProfile/Block/Profile/View/Schedule.php index 18d0c76e3787a..a554fa6376d2c 100644 --- a/app/code/Magento/RecurringProfile/Block/Profile/View/Schedule.php +++ b/app/code/Magento/RecurringProfile/Block/Profile/View/Schedule.php @@ -36,13 +36,13 @@ class Schedule extends \Magento\RecurringProfile\Block\Profile\View /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\RecurringProfile\Block\Fields $fields * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\RecurringProfile\Block\Fields $fields, array $data = array() ) { diff --git a/app/code/Magento/RecurringProfile/Controller/Adminhtml/RecurringProfile.php b/app/code/Magento/RecurringProfile/Controller/Adminhtml/RecurringProfile.php index bbbd032e54a14..ae2a81317f9e3 100644 --- a/app/code/Magento/RecurringProfile/Controller/Adminhtml/RecurringProfile.php +++ b/app/code/Magento/RecurringProfile/Controller/Adminhtml/RecurringProfile.php @@ -54,7 +54,7 @@ class RecurringProfile extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -70,13 +70,13 @@ class RecurringProfile extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Service\V1\CustomerServiceInterface $customerService * @param \Magento\Logger $logger */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Customer\Service\V1\CustomerServiceInterface $customerService, \Magento\Logger $logger ) { diff --git a/app/code/Magento/RecurringProfile/Controller/Download.php b/app/code/Magento/RecurringProfile/Controller/Download.php new file mode 100644 index 0000000000000..91e3d5c38ff56 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Controller/Download.php @@ -0,0 +1,89 @@ +download = $download; + } + + /** + * Profile custom options download action + */ + public function downloadProfileCustomOptionAction() + { + $recurringProfile = $this->_objectManager->create('Magento\RecurringProfile\Model\Profile') + ->load($this->getRequest()->getParam('id')); + + if (!$recurringProfile->getId()) { + $this->_forward('noroute'); + } + + $orderItemInfo = $recurringProfile->getData('order_item_info'); + try { + $buyRequest = unserialize($orderItemInfo['info_buyRequest']); + if ($buyRequest['product'] != $orderItemInfo['product_id']) { + throw new \Exception(); + } + $this->download->downloadFile($this->getOptionInfo($buyRequest)); + } catch (\Exception $e) { + $this->_forward('noroute'); + } + } + + /** + * Retrieve custom option information + * + * @param array $buyRequest + * @return array + * @throws \Exception + */ + protected function getOptionInfo($buyRequest) + { + $optionId = $this->getRequest()->getParam('option_id'); + if (!isset($buyRequest['options'][$optionId])) { + throw new \Exception(); + } + /** @var Magento\Catalog\Model\Product $product */ + $product = $this->_objectManager->create('Magento\Catalog\Model\Product')->load($buyRequest['product']); + if (!$product->getId()) { + throw new \Exception(); + } + $option = $product->getOptionById($optionId); + if (!$option || !$option->getId() || $option->getType() != 'file') { + throw new \Exception(); + } + $info = $buyRequest['options'][$this->getRequest()->getParam('option_id')]; + if ($this->getRequest()->getParam('key') != $info['secret_key']) { + throw new \Exception(); + } + return $info; + } +} diff --git a/app/code/Magento/RecurringProfile/Controller/RecurringProfile.php b/app/code/Magento/RecurringProfile/Controller/RecurringProfile.php index 1c228392c92bc..a59005b537f86 100644 --- a/app/code/Magento/RecurringProfile/Controller/RecurringProfile.php +++ b/app/code/Magento/RecurringProfile/Controller/RecurringProfile.php @@ -40,7 +40,7 @@ class RecurringProfile extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,12 +51,12 @@ class RecurringProfile extends \Magento\App\Action\Action /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\Action\Title $title */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\Action\Title $title ) { $this->_coreRegistry = $coreRegistry; @@ -102,6 +102,14 @@ public function viewAction() $this->_viewAction(); } + /** + * Profile related orders view + */ + public function ordersAction() + { + $this->_viewAction(); + } + /** * Attempt to set profile state */ diff --git a/app/code/Magento/RecurringProfile/Model/Method/PaymentMethodsList.php b/app/code/Magento/RecurringProfile/Model/Method/PaymentMethodsList.php new file mode 100644 index 0000000000000..5aaf5b9c11405 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Model/Method/PaymentMethodsList.php @@ -0,0 +1,63 @@ +paymentHelper = $paymentHelper; + $this->specification = $specification; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + $result = array(); + foreach ($this->paymentHelper->getPaymentMethods() as $code => $data) { + if ($this->specification->isSatisfiedBy($code)) { + $result[$code] = isset($data['title']) + ? $data['title'] + : $this->paymentHelper->getMethodInstance($code)->getTitle(); + } + } + return $result; + } +} \ No newline at end of file diff --git a/app/code/Magento/RecurringProfile/Model/Method/RecurringPaymentSpecification.php b/app/code/Magento/RecurringProfile/Model/Method/RecurringPaymentSpecification.php new file mode 100644 index 0000000000000..7fab8988192b0 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Model/Method/RecurringPaymentSpecification.php @@ -0,0 +1,47 @@ +methodsInfo[$paymentMethod][self::CONFIG_KEY]) + && $this->methodsInfo[$paymentMethod][self::CONFIG_KEY]; + } +} diff --git a/app/code/Magento/RecurringProfile/Model/Observer.php b/app/code/Magento/RecurringProfile/Model/Observer.php index c4c253d20ebb1..2d5254bad3a91 100644 --- a/app/code/Magento/RecurringProfile/Model/Observer.php +++ b/app/code/Magento/RecurringProfile/Model/Observer.php @@ -48,7 +48,7 @@ class Observer * * @var \Magento\RecurringProfile\Model\RecurringProfileFactory */ - protected $_profileFactory; + protected $_recurringProfileFactory; /** * @var \Magento\View\Element\BlockFactory @@ -60,25 +60,41 @@ class Observer */ protected $_fields; + /** + * @var \Magento\Checkout\Model\Session + */ + protected $_checkoutSession; + + /** + * @var Quote + */ + protected $_quoteImporter; + /** * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\RecurringProfile\Model\RecurringProfileFactory $profileFactory + * @param \Magento\RecurringProfile\Model\RecurringProfileFactory $recurringProfileFactory * @param \Magento\View\Element\BlockFactory $blockFactory * @param \Magento\RecurringProfile\Block\Fields $fields + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param QuoteImporter $quoteImporter */ public function __construct( \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\RecurringProfile\Model\RecurringProfileFactory $profileFactory, + \Magento\RecurringProfile\Model\RecurringProfileFactory $recurringProfileFactory, \Magento\View\Element\BlockFactory $blockFactory, - \Magento\RecurringProfile\Block\Fields $fields + \Magento\RecurringProfile\Block\Fields $fields, + \Magento\Checkout\Model\Session $checkoutSession, + \Magento\RecurringProfile\Model\QuoteImporter $quoteImporter ) { $this->_locale = $locale; $this->_storeManager = $storeManager; - $this->_profileFactory = $profileFactory; + $this->_recurringProfileFactory = $recurringProfileFactory; $this->_blockFactory = $blockFactory; $this->_fields = $fields; + $this->_checkoutSession = $checkoutSession; + $this->_quoteImporter = $quoteImporter; } /** @@ -98,7 +114,7 @@ public function prepareProductRecurringProfileOptions($observer) } /** @var \Magento\RecurringProfile\Model\RecurringProfile $profile */ - $profile = $this->_profileFactory->create(['locale' => $this->_locale]); + $profile = $this->_recurringProfileFactory->create(['locale' => $this->_locale]); $profile->setStore($this->_storeManager->getStore()) ->importBuyRequest($buyRequest) ->importProduct($product); @@ -157,4 +173,33 @@ public function addFieldsToProductEditForm($observer) $observer->getEvent()->getResult()->output = $output; } + + /** + * Submit recurring profiles + * + * @param \Magento\Event\Observer $observer + * @throws \Magento\Core\Exception + */ + public function submitRecurringPaymentProfiles($observer) + { + $profiles = $this->_quoteImporter->prepareRecurringPaymentProfiles($observer->getEvent()->getQuote()); + foreach ($profiles as $profile) { + if (!$profile->isValid()) { + throw new \Magento\Core\Exception($profile->getValidationErrors()); + } + $profile->submit(); + } + } + + public function addRecurringProfileIdsToSession($observer) + { + $profiles = $this->_quoteImporter->prepareRecurringPaymentProfiles($observer->getEvent()->getQuote()); + if ($profiles) { + $ids = array(); + foreach ($profiles as $profile) { + $ids[] = $profile->getId(); + } + $this->_checkoutSession->setLastRecurringProfileIds($ids); + } + } } diff --git a/app/code/Magento/RecurringProfile/Model/Observer/PaymentAvailabilityObserver.php b/app/code/Magento/RecurringProfile/Model/Observer/PaymentAvailabilityObserver.php new file mode 100644 index 0000000000000..051f971ab43a3 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Model/Observer/PaymentAvailabilityObserver.php @@ -0,0 +1,69 @@ +quoteFilter = $quoteFilter; + } + + /** + * @param \Magento\Payment\Model\Method\AbstractMethod $paymentMethod + * @return bool + */ + private function canManageRecurringProfiles(\Magento\Payment\Model\Method\AbstractMethod $paymentMethod) + { + return $paymentMethod instanceof \Magento\Payment\Model\Recurring\Profile\MethodInterface; + } + + /** + * @param \Magento\Event\Observer $observer + */ + public function observe(\Magento\Event\Observer $observer) + { + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $observer->getEvent()->getQuote(); + /** @var \Magento\Payment\Model\Method\AbstractMethod $paymentMethod */ + $paymentMethod = $observer->getEvent()->getMethodInstance(); + $result = $observer->getEvent()->getResult(); + + if ($quote + && $this->quoteFilter->hasRecurringItems($quote) + && !$this->canManageRecurringProfiles($paymentMethod) + ) { + $result->isAvailable = false; + } + } +} + \ No newline at end of file diff --git a/app/code/Magento/RecurringProfile/Model/PeriodUnits.php b/app/code/Magento/RecurringProfile/Model/PeriodUnits.php index c2ff91f065312..7c587123fcb9d 100644 --- a/app/code/Magento/RecurringProfile/Model/PeriodUnits.php +++ b/app/code/Magento/RecurringProfile/Model/PeriodUnits.php @@ -23,9 +23,7 @@ */ namespace Magento\RecurringProfile\Model; -use Magento\Core\Model\Option; - -class PeriodUnits implements Option\ArrayInterface +class PeriodUnits implements \Magento\Option\ArrayInterface { const DAY = 'day'; const WEEK = 'week'; diff --git a/app/code/Magento/RecurringProfile/Model/Profile.php b/app/code/Magento/RecurringProfile/Model/Profile.php index c9088be385f57..edd3462e72b69 100644 --- a/app/code/Magento/RecurringProfile/Model/Profile.php +++ b/app/code/Magento/RecurringProfile/Model/Profile.php @@ -135,8 +135,8 @@ class Profile extends \Magento\RecurringProfile\Model\RecurringProfile protected $states; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentData * @param PeriodUnits $periodUnits * @param \Magento\RecurringProfile\Block\Fields $fields @@ -153,8 +153,8 @@ class Profile extends \Magento\RecurringProfile\Model\RecurringProfile * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentData, \Magento\RecurringProfile\Model\PeriodUnits $periodUnits, \Magento\RecurringProfile\Block\Fields $fields, diff --git a/app/code/Magento/RecurringProfile/Model/Quote/Filter.php b/app/code/Magento/RecurringProfile/Model/Quote/Filter.php new file mode 100644 index 0000000000000..44dd77a03f081 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Model/Quote/Filter.php @@ -0,0 +1,49 @@ +getAllVisibleItems() as $item) { + if ($item->getProduct() && $item->getProduct()->getIsRecurring() == '1') { + return true; + } + } + return false; + } +} + \ No newline at end of file diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/AbstractRecurring.php b/app/code/Magento/RecurringProfile/Model/Quote/Total/AbstractRecurring.php similarity index 94% rename from app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/AbstractRecurring.php rename to app/code/Magento/RecurringProfile/Model/Quote/Total/AbstractRecurring.php index 64d1b8a0bb12b..5c41017f44f4f 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/AbstractRecurring.php +++ b/app/code/Magento/RecurringProfile/Model/Quote/Total/AbstractRecurring.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * Total model for recurring profiles */ -namespace Magento\Sales\Model\Quote\Address\Total\Nominal; +namespace Magento\RecurringProfile\Model\Quote\Total; abstract class AbstractRecurring extends \Magento\Sales\Model\Quote\Address\Total\AbstractTotal @@ -57,7 +55,7 @@ abstract class AbstractRecurring * Collect recurring item parameters and copy to the address items * * @param \Magento\Sales\Model\Quote\Address $address - * @return \Magento\Sales\Model\Quote\Address\Total\Nominal\AbstractRecurring + * @return \Magento\RecurringProfile\Model\Quote\Total\AbstractRecurring */ public function collect(\Magento\Sales\Model\Quote\Address $address) { @@ -105,6 +103,7 @@ protected function _getAddressItems(\Magento\Sales\Model\Quote\Address $address) * * @param \Magento\Sales\Model\Quote\Address $address * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _afterCollectSuccess($address, $item) { diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php b/app/code/Magento/RecurringProfile/Model/Quote/Total/Initial.php similarity index 86% rename from app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php rename to app/code/Magento/RecurringProfile/Model/Quote/Total/Initial.php index 9beee23eee142..ae31484611d0e 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php +++ b/app/code/Magento/RecurringProfile/Model/Quote/Total/Initial.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,10 +25,10 @@ /** * Total model for recurring profile initial fee */ -namespace Magento\Sales\Model\Quote\Address\Total\Nominal\Recurring; +namespace Magento\RecurringProfile\Model\Quote\Total; class Initial - extends \Magento\Sales\Model\Quote\Address\Total\Nominal\AbstractRecurring + extends \Magento\RecurringProfile\Model\Quote\Total\AbstractRecurring { /** * Custom row total/profile keys diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php b/app/code/Magento/RecurringProfile/Model/Quote/Total/Trial.php similarity index 89% rename from app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php rename to app/code/Magento/RecurringProfile/Model/Quote/Total/Trial.php index 18a53563261ce..3fc3f1d78562a 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php +++ b/app/code/Magento/RecurringProfile/Model/Quote/Total/Trial.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,10 +25,10 @@ /** * Total model for recurring profile trial payment */ -namespace Magento\Sales\Model\Quote\Address\Total\Nominal\Recurring; +namespace Magento\RecurringProfile\Model\Quote\Total; class Trial - extends \Magento\Sales\Model\Quote\Address\Total\Nominal\AbstractRecurring + extends \Magento\RecurringProfile\Model\Quote\Total\AbstractRecurring { /** * Custom row total/profile keys diff --git a/app/code/Magento/RecurringProfile/Model/QuoteImporter.php b/app/code/Magento/RecurringProfile/Model/QuoteImporter.php new file mode 100644 index 0000000000000..c89c7c337e9b9 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Model/QuoteImporter.php @@ -0,0 +1,71 @@ +_profileFactory = $profileFactory; + } + + /** + * Prepare recurring payment profiles + * + * @param \Magento\Sales\Model\Quote $quote + * @throws \Exception + * @return array + */ + public function prepareRecurringPaymentProfiles(\Magento\Sales\Model\Quote $quote) + { + if (!$quote->getTotalsCollectedFlag()) { + throw new \Exception('Quote totals must be collected before this operation.'); + } + + $result = []; + foreach ($quote->getAllVisibleItems() as $item) { + $product = $item->getProduct(); + if (is_object($product) && ($product->isRecurring()) + && $profile = $this->_profileFactory->create()->importProduct($product) + ) { + $profile->importQuote($quote); + $profile->importQuoteItem($item); + $result[] = $profile; + } + } + return $result; + } +} diff --git a/app/code/Magento/RecurringProfile/Model/RecurringProfile.php b/app/code/Magento/RecurringProfile/Model/RecurringProfile.php index 4c482f9df3b04..a9367259a96f4 100644 --- a/app/code/Magento/RecurringProfile/Model/RecurringProfile.php +++ b/app/code/Magento/RecurringProfile/Model/RecurringProfile.php @@ -88,8 +88,8 @@ class RecurringProfile extends \Magento\Core\Model\AbstractModel protected $_locale; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentData * @param PeriodUnits $periodUnits * @param \Magento\RecurringProfile\Block\Fields $fields @@ -99,8 +99,8 @@ class RecurringProfile extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentData, \Magento\RecurringProfile\Model\PeriodUnits $periodUnits, \Magento\RecurringProfile\Block\Fields $fields, diff --git a/app/code/Magento/RecurringProfile/Model/Resource/Order/CollectionFilter.php b/app/code/Magento/RecurringProfile/Model/Resource/Order/CollectionFilter.php new file mode 100644 index 0000000000000..c0a3f6abb1593 --- /dev/null +++ b/app/code/Magento/RecurringProfile/Model/Resource/Order/CollectionFilter.php @@ -0,0 +1,51 @@ +getSelect() + ->joinInner( + array('rpo' => $collection->getTable('recurring_profile_order')), + 'main_table.entity_id = rpo.order_id', + array()) + ->where('rpo.profile_id IN(?)', $ids); + return $collection; + } +} diff --git a/app/code/Magento/RecurringProfile/Model/States.php b/app/code/Magento/RecurringProfile/Model/States.php index 6e71f25ef3021..5f628433dacf1 100644 --- a/app/code/Magento/RecurringProfile/Model/States.php +++ b/app/code/Magento/RecurringProfile/Model/States.php @@ -23,9 +23,7 @@ */ namespace Magento\RecurringProfile\Model; -use Magento\Core\Model\Option\ArrayInterface; - -class States implements ArrayInterface +class States implements \Magento\Option\ArrayInterface { /** * @var string diff --git a/app/code/Magento/RecurringProfile/etc/di.xml b/app/code/Magento/RecurringProfile/etc/di.xml index 4b01a188af7c8..5234b163ca265 100644 --- a/app/code/Magento/RecurringProfile/etc/di.xml +++ b/app/code/Magento/RecurringProfile/etc/di.xml @@ -31,4 +31,7 @@ + + + diff --git a/app/code/Magento/RecurringProfile/etc/events.xml b/app/code/Magento/RecurringProfile/etc/events.xml new file mode 100644 index 0000000000000..138451f567dbe --- /dev/null +++ b/app/code/Magento/RecurringProfile/etc/events.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Cms/etc/events.xml b/app/code/Magento/RecurringProfile/etc/frontend/page_types.xml similarity index 83% rename from app/code/Magento/Cms/etc/events.xml rename to app/code/Magento/RecurringProfile/etc/frontend/page_types.xml index e143b427cd67b..922db7cde2fe1 100644 --- a/app/code/Magento/Cms/etc/events.xml +++ b/app/code/Magento/RecurringProfile/etc/frontend/page_types.xml @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - - - - - + + + + diff --git a/app/code/Magento/RecurringProfile/etc/module.xml b/app/code/Magento/RecurringProfile/etc/module.xml index bce35e7e3443a..4d360b6a96f5f 100644 --- a/app/code/Magento/RecurringProfile/etc/module.xml +++ b/app/code/Magento/RecurringProfile/etc/module.xml @@ -33,6 +33,7 @@ + diff --git a/app/code/Magento/RecurringProfile/etc/sales.xml b/app/code/Magento/RecurringProfile/etc/sales.xml new file mode 100644 index 0000000000000..ff83653ffe0be --- /dev/null +++ b/app/code/Magento/RecurringProfile/etc/sales.xml @@ -0,0 +1,33 @@ + + + +
    + + + + +
    +
    diff --git a/app/code/Magento/Reports/Block/Product/AbstractProduct.php b/app/code/Magento/Reports/Block/Product/AbstractProduct.php index 227028ef78689..4df3b191973aa 100644 --- a/app/code/Magento/Reports/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Reports/Block/Product/AbstractProduct.php @@ -60,7 +60,7 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -73,13 +73,13 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr * @param \Magento\Reports\Model\Product\Index\Factory $indexFactory * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Reports/Model/Event.php b/app/code/Magento/Reports/Model/Event.php index 6b689ebf08a9f..fd00071254a71 100644 --- a/app/code/Magento/Reports/Model/Event.php +++ b/app/code/Magento/Reports/Model/Event.php @@ -67,8 +67,8 @@ class Event extends \Magento\Core\Model\AbstractModel protected $_eventTypeFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\DateFactory $dateFactory * @param \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -76,8 +76,8 @@ class Event extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\DateFactory $dateFactory, \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php index ebc069145d52c..deedcab06b118 100644 --- a/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php @@ -69,8 +69,8 @@ abstract class AbstractIndex extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession @@ -82,8 +82,8 @@ abstract class AbstractIndex extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Reports/Model/Product/Index/Compared.php b/app/code/Magento/Reports/Model/Product/Index/Compared.php index 45441c5449972..9f2973be6f9b4 100644 --- a/app/code/Magento/Reports/Model/Product/Index/Compared.php +++ b/app/code/Magento/Reports/Model/Product/Index/Compared.php @@ -59,8 +59,8 @@ class Compared extends \Magento\Reports\Model\Product\Index\AbstractIndex protected $_productCompare = null; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession @@ -73,8 +73,8 @@ class Compared extends \Magento\Reports\Model\Product\Index\AbstractIndex * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Collection.php index 57f8ce31b471b..14bd60dd018e7 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Collection.php @@ -88,7 +88,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -114,7 +114,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -141,7 +141,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php index ba0a113f955d1..0a8f4cc941081 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php @@ -61,7 +61,7 @@ abstract class AbstractCollection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -85,7 +85,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -107,7 +107,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php index 6e53922d83fcb..264726a6f3172 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -74,7 +74,7 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -102,7 +102,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -128,7 +128,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Reports/Model/Resource/Report/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/Resource/Report/Collection/AbstractCollection.php index afb1b6fab838d..6ed85738818fc 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Collection/AbstractCollection.php @@ -244,13 +244,23 @@ protected function _applyCustomFilter() return $this; } + /** + * @return $this + */ + protected function _initSelect() + { + return $this; + } + /** * Apply filters common to reports * * @return $this */ - protected function _initSelect() + protected function _beforeLoad() { + parent::_beforeLoad(); + $this->_applyDateRangeFilter(); $this->_applyStoresFilter(); $this->_applyCustomFilter(); diff --git a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php index fa58391274b67..ac0c468f695c0 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php @@ -50,7 +50,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $systemStore * @param \Magento\Review\Helper\Data $reviewData @@ -58,7 +58,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $systemStore, \Magento\Review\Helper\Data $reviewData, diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit.php b/app/code/Magento/Review/Block/Adminhtml/Edit.php index be6711f6ac05b..820b98d1b228c 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit.php @@ -41,7 +41,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -56,14 +56,14 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Review\Model\ReviewFactory $reviewFactory * @param \Magento\Review\Helper\Action\Pager $reviewActionPager - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Review\Model\ReviewFactory $reviewFactory, \Magento\Review\Helper\Action\Pager $reviewActionPager, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php index 1e0d62c72c704..dfc5526879199 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php @@ -61,7 +61,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $systemStore * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -71,7 +71,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $systemStore, \Magento\Customer\Model\CustomerFactory $customerFactory, diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Grid.php index 5ac101ef5dde0..a4372c1c816bc 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid.php @@ -58,7 +58,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -83,7 +83,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory * @param \Magento\Review\Helper\Data $reviewData * @param \Magento\Review\Helper\Action\Pager $reviewActionPager - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -93,7 +93,7 @@ public function __construct( \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory, \Magento\Review\Helper\Data $reviewData, \Magento\Review\Helper\Action\Pager $reviewActionPager, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_productsFactory = $productsFactory; diff --git a/app/code/Magento/Review/Block/Adminhtml/Main.php b/app/code/Magento/Review/Block/Adminhtml/Main.php index f8933abeac87f..e23dc928a0cb6 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Main.php +++ b/app/code/Magento/Review/Block/Adminhtml/Main.php @@ -34,7 +34,7 @@ class Main extends \Magento\Backend\Block\Widget\Grid\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -56,14 +56,14 @@ class Main extends \Magento\Backend\Block\Widget\Grid\Container * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php index a96a1ef279637..dec3a13343f92 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php @@ -52,7 +52,7 @@ class Detailed extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -74,14 +74,14 @@ class Detailed extends \Magento\Backend\Block\Template * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory, \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_ratingsFactory = $ratingsFactory; diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php index 7e3830e1cdaed..a1a6c617c68c1 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php @@ -43,7 +43,7 @@ class Summary extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -65,14 +65,14 @@ class Summary extends \Magento\Backend\Block\Template * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory * @param \Magento\Rating\Model\RatingFactory $ratingFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, \Magento\Rating\Model\RatingFactory $ratingFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_votesFactory = $votesFactory; diff --git a/app/code/Magento/Review/Block/Customer/View.php b/app/code/Magento/Review/Block/Customer/View.php index d23751758e208..d9e408a2139fd 100644 --- a/app/code/Magento/Review/Block/Customer/View.php +++ b/app/code/Magento/Review/Block/Customer/View.php @@ -83,7 +83,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -99,13 +99,13 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Customer\Model\Session $customerSession * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Review/Block/Product/View.php b/app/code/Magento/Review/Block/Product/View.php index f6af37fd442c5..bf121539a1cad 100644 --- a/app/code/Magento/Review/Block/Product/View.php +++ b/app/code/Magento/Review/Block/Product/View.php @@ -53,7 +53,7 @@ class View extends \Magento\Catalog\Block\Product\View /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -78,7 +78,7 @@ class View extends \Magento\Catalog\Block\Product\View public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Review/Block/Product/View/Other.php b/app/code/Magento/Review/Block/Product/View/Other.php index e3051b6e9d01f..6124ced6f6e56 100644 --- a/app/code/Magento/Review/Block/Product/View/Other.php +++ b/app/code/Magento/Review/Block/Product/View/Other.php @@ -32,19 +32,18 @@ class Other extends \Magento\View\Element\Template { /** - * Core model registry - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_registry = $registry; diff --git a/app/code/Magento/Review/Block/View.php b/app/code/Magento/Review/Block/View.php index 38d493b8cc7d6..14e51e6c2e3b8 100644 --- a/app/code/Magento/Review/Block/View.php +++ b/app/code/Magento/Review/Block/View.php @@ -63,7 +63,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -77,13 +77,13 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Review\Model\ReviewFactory $reviewFactory * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index 918239e399ccf..82c69962a005d 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -39,7 +39,7 @@ class Product extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -122,7 +122,7 @@ class Product extends \Magento\App\Action\Action /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Logger $logger @@ -137,7 +137,7 @@ class Product extends \Magento\App\Action\Action */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Logger $logger, diff --git a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php index f7211458a52ba..bdcbf6ecfa3c1 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php @@ -88,7 +88,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat + * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl @@ -113,7 +113,7 @@ public function __construct( \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, + \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, @@ -138,7 +138,7 @@ public function __construct( $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, + $catalogProductFlatState, $coreStoreConfig, $productOptionFactory, $catalogUrl, diff --git a/app/code/Magento/Review/Model/Review.php b/app/code/Magento/Review/Model/Review.php index 1fe17a541aa68..86124ac64a66c 100644 --- a/app/code/Magento/Review/Model/Review.php +++ b/app/code/Magento/Review/Model/Review.php @@ -116,8 +116,8 @@ class Review extends \Magento\Core\Model\AbstractModel protected $_urlModel; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productFactory * @param \Magento\Review\Model\Resource\Review\Status\CollectionFactory $statusFactory * @param \Magento\Review\Model\Resource\Review\Summary\CollectionFactory $summaryFactory @@ -130,8 +130,8 @@ class Review extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productFactory, \Magento\Review\Model\Resource\Review\Status\CollectionFactory $statusFactory, \Magento\Review\Model\Resource\Review\Summary\CollectionFactory $summaryFactory, diff --git a/app/code/Magento/Review/Model/Review/Status.php b/app/code/Magento/Review/Model/Review/Status.php index 77bcb5e564993..e7b5ae7041675 100644 --- a/app/code/Magento/Review/Model/Review/Status.php +++ b/app/code/Magento/Review/Model/Review/Status.php @@ -37,15 +37,15 @@ class Status extends \Magento\Core\Model\AbstractModel { /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Review/Model/Review/Summary.php b/app/code/Magento/Review/Model/Review/Summary.php index ea8ad61347bc0..6414fcdb2398f 100644 --- a/app/code/Magento/Review/Model/Review/Summary.php +++ b/app/code/Magento/Review/Model/Review/Summary.php @@ -31,15 +31,15 @@ class Summary extends \Magento\Core\Model\AbstractModel { /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Review\Model\Resource\Review\Summary $resource * @param \Magento\Review\Model\Resource\Review\Summary\Collection $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Review\Model\Resource\Review\Summary $resource, \Magento\Review\Model\Resource\Review\Summary\Collection $resourceCollection, array $data = array() diff --git a/app/code/Magento/Review/i18n/de_DE.csv b/app/code/Magento/Review/i18n/de_DE.csv index eacb925e72fc2..fd00ded0e34c4 100644 --- a/app/code/Magento/Review/i18n/de_DE.csv +++ b/app/code/Magento/Review/i18n/de_DE.csv @@ -6,7 +6,7 @@ "3 stars","3 Sterne" "4 stars","4 Sterne" "5 stars","5 Sterne" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Neues Review hinzufügen" "Add Your Review","Eigenes Review hinzufügen" "Administrator","Administrator" @@ -44,7 +44,7 @@ "Name in Store","Name im Shop" "New Review","Neues Review" "Nickname","Nickname" -"Nickname can\'t be empty","Nickname darf nicht leer sein" +"Nickname can't be empty","Nickname darf nicht leer sein" "Only registered users can write reviews. Please, log in or register","Nur registrierte Benutzer können Bewertungen schreiben. Bitte loggen Sie sich ein oder registrieren Sie sich" "Pending Reviews","Ausstehende Reviews" "Pending Reviews of Customer `%s`","Ausstehende Reviews des Kunden '%s'" @@ -67,8 +67,8 @@ "Review Details","Reviewdetails" "Review Form Fields Before","Felder Bewertungsformular vorher" "Review by %s","Review von %s" -"Review can\'t be empty","Review darf nicht leer sein" -"Review summary can\'t be empty","Zusammenfassung des Reviews darf nicht leer sein" +"Review can't be empty","Review darf nicht leer sein" +"Review summary can't be empty","Zusammenfassung des Reviews darf nicht leer sein" "Reviews and Ratings","Reviews und Bewertungen" "SKU","SKU" "Save Review","Review speichern" diff --git a/app/code/Magento/Review/i18n/en_US.csv b/app/code/Magento/Review/i18n/en_US.csv index 369dae49b8d4f..367ef415570b3 100644 --- a/app/code/Magento/Review/i18n/en_US.csv +++ b/app/code/Magento/Review/i18n/en_US.csv @@ -6,7 +6,7 @@ "3 stars","3 stars" "4 stars","4 stars" "5 stars","5 stars" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Add New Review" "Add Your Review","Add Your Review" "Administrator","Administrator" @@ -45,7 +45,7 @@ "Name in Store","Name in Store" "New Review","New Review" "Nickname","Nickname" -"Nickname can\'t be empty","Nickname can\'t be empty" +"Nickname can't be empty","Nickname can't be empty" "Only registered users can write reviews. Please, log in or register","Only registered users can write reviews. Please, log in or register" "Pending Reviews","Pending Reviews" "Pending Reviews of Customer `%s`","Pending Reviews of Customer `%s`" @@ -68,8 +68,8 @@ "Review Details","Review Details" "Review Form Fields Before","Review Form Fields Before" "Review by %s","Review by %s" -"Review can\'t be empty","Review can\'t be empty" -"Review summary can\'t be empty","Review summary can\'t be empty" +"Review can't be empty","Review can't be empty" +"Review summary can't be empty","Review summary can't be empty" "Reviews and Ratings","Reviews and Ratings" "SKU","SKU" "Save Review","Save Review" diff --git a/app/code/Magento/Review/i18n/es_ES.csv b/app/code/Magento/Review/i18n/es_ES.csv index b71b0aec1ea31..bbd0019f5c98f 100644 --- a/app/code/Magento/Review/i18n/es_ES.csv +++ b/app/code/Magento/Review/i18n/es_ES.csv @@ -6,7 +6,7 @@ "3 stars","3 estrellas" "4 stars","4 estrellas" "5 stars","5 estrellas" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Añadir Nueva Revisión" "Add Your Review","Añadir Tu Revisión" "Administrator","Administrador" @@ -44,7 +44,7 @@ "Name in Store","Nombre en la Tienda" "New Review","Nueva Revisión" "Nickname","Apodo" -"Nickname can\'t be empty","El apodo no puede estar vacío" +"Nickname can't be empty","El apodo no puede estar vacío" "Only registered users can write reviews. Please, log in or register","Sólo usuarios registrados pueden escribir sus opiniones. Conéctese o regístrese" "Pending Reviews","Revisiones Pendientes" "Pending Reviews of Customer `%s`","Revisiones Pendientes del Cliente `%s`" @@ -67,8 +67,8 @@ "Review Details","Detalles de Revisión" "Review Form Fields Before","Revisar campos del formulario antes" "Review by %s","Revisión por %s" -"Review can\'t be empty","La opinión no puede estar vacía" -"Review summary can\'t be empty","El resumen de la opinión no puede estar vacío" +"Review can't be empty","La opinión no puede estar vacía" +"Review summary can't be empty","El resumen de la opinión no puede estar vacío" "Reviews and Ratings","Revisiones y Valoraciones" "SKU","Número de referencia" "Save Review","Guardar Revisión" diff --git a/app/code/Magento/Review/i18n/fr_FR.csv b/app/code/Magento/Review/i18n/fr_FR.csv index dfe52dff1fa00..be523f8a1039f 100644 --- a/app/code/Magento/Review/i18n/fr_FR.csv +++ b/app/code/Magento/Review/i18n/fr_FR.csv @@ -6,7 +6,7 @@ "3 stars","3 étoiles" "4 stars","4 étoiles" "5 stars","5 étoiles" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Ajouter un nouvel avis" "Add Your Review","Ajouter votre avis" "Administrator","Administrateur" @@ -44,7 +44,7 @@ "Name in Store","Nom dans la boutique" "New Review","Nouvel avis" "Nickname","Surnom" -"Nickname can\'t be empty","Le pseudo doit être spécifié" +"Nickname can't be empty","Le pseudo doit être spécifié" "Only registered users can write reviews. Please, log in or register","Seuls les utilisateurs qui se sont identifiés peuvent faire partager leurs remarques. Veillez vous identifier ou vous enregistrer" "Pending Reviews","Avis en attente" "Pending Reviews of Customer `%s`","Avis en attente du client `%s`" @@ -67,8 +67,8 @@ "Review Details","Détails de l'avis" "Review Form Fields Before","Vérifiez les champs du formulaire avant" "Review by %s","Avis de %s" -"Review can\'t be empty","Le champ Visualiser doit être rempli" -"Review summary can\'t be empty","Le champ Visualiser le récapitulatif doit être rempli" +"Review can't be empty","Le champ Visualiser doit être rempli" +"Review summary can't be empty","Le champ Visualiser le récapitulatif doit être rempli" "Reviews and Ratings","Avis et évaluations" "SKU","UGS" "Save Review","Enregistrer l'avis" diff --git a/app/code/Magento/Review/i18n/nl_NL.csv b/app/code/Magento/Review/i18n/nl_NL.csv index a938593e17fec..9da9f411908a0 100644 --- a/app/code/Magento/Review/i18n/nl_NL.csv +++ b/app/code/Magento/Review/i18n/nl_NL.csv @@ -6,7 +6,7 @@ "3 stars","3 sterren" "4 stars","4 sterren" "5 stars","5 sterren" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Voeg Nieuwe Beoordeling toe" "Add Your Review","Voeg Uw Beoordeling toe" "Administrator","Administrator" @@ -44,7 +44,7 @@ "Name in Store","Naam in Winkel" "New Review","Nieuwe Review" "Nickname","Bijnaam" -"Nickname can\'t be empty","Nickname kan niet leeg zijn" +"Nickname can't be empty","Nickname kan niet leeg zijn" "Only registered users can write reviews. Please, log in or register","Alleen geregistreerde gebruikers kunnen beoordelingen schrijven. Log in of registreer" "Pending Reviews","In afwachting van beoordelingen" "Pending Reviews of Customer `%s`","Nog gaande zijnde Reviews van Klant `%s`" @@ -67,8 +67,8 @@ "Review Details","Details recensie" "Review Form Fields Before","Beoordeel formuliervelden voor" "Review by %s","Recensie door %s" -"Review can\'t be empty","Beoordeling kan niet leeg zijn" -"Review summary can\'t be empty","Overzicht kan niet leeg zijn" +"Review can't be empty","Beoordeling kan niet leeg zijn" +"Review summary can't be empty","Overzicht kan niet leeg zijn" "Reviews and Ratings","Beoordelingen en waarderingen" "SKU","SKU" "Save Review","Recensie opslaan" diff --git a/app/code/Magento/Review/i18n/pt_BR.csv b/app/code/Magento/Review/i18n/pt_BR.csv index f96a6be95c68c..ea1bf5212acb4 100644 --- a/app/code/Magento/Review/i18n/pt_BR.csv +++ b/app/code/Magento/Review/i18n/pt_BR.csv @@ -6,7 +6,7 @@ "3 stars","3 estrelas" "4 stars","4 estrelas" "5 stars","5 estrelas" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Adicionar novo comentário" "Add Your Review","Adicionar seu comentário" "Administrator","Administrador" @@ -44,7 +44,7 @@ "Name in Store","Noma na loja" "New Review","Nova Resenha" "Nickname","Alcunha (Nickname)" -"Nickname can\'t be empty","O apelido não pode estar vazio" +"Nickname can't be empty","O apelido não pode estar vazio" "Only registered users can write reviews. Please, log in or register","Apenas usuários cadastrados podem escrever avaliações. Por favor, conecte-se ou cadastre-se" "Pending Reviews","Comentários Pendentes" "Pending Reviews of Customer `%s`","Aguardando revisão do cliente '%s'" @@ -67,8 +67,8 @@ "Review Details","Detalhes de análise" "Review Form Fields Before","Analisar antes os campos do formulário" "Review by %s","Analisado por %s" -"Review can\'t be empty","Revisão não pode estar vazia" -"Review summary can\'t be empty","Resumo da revisão não pode estar vazio" +"Review can't be empty","Revisão não pode estar vazia" +"Review summary can't be empty","Resumo da revisão não pode estar vazio" "Reviews and Ratings","Resenhas e Avaliações" "SKU","Unidade de Manutenção de Estoque" "Save Review","Salvar análise" diff --git a/app/code/Magento/Review/i18n/zh_CN.csv b/app/code/Magento/Review/i18n/zh_CN.csv index a6540ceb979f8..57907575727fa 100644 --- a/app/code/Magento/Review/i18n/zh_CN.csv +++ b/app/code/Magento/Review/i18n/zh_CN.csv @@ -6,7 +6,7 @@ "3 stars","3 星" "4 stars","4 星" "5 stars","5 星" -"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","添加新评测" "Add Your Review","添加您的评测" "Administrator","管理员" @@ -44,7 +44,7 @@ "Name in Store","商店名称" "New Review","新评测" "Nickname","昵称" -"Nickname can\'t be empty","昵称不能为空" +"Nickname can't be empty","昵称不能为空" "Only registered users can write reviews. Please, log in or register","仅注册用户可撰写评论。请登录注册" "Pending Reviews","挂起的评测" "Pending Reviews of Customer `%s`","来自客户“%s”未决的评论" @@ -67,8 +67,8 @@ "Review Details","评测详情" "Review Form Fields Before","评测表单字段之前" "Review by %s","评测者 %s" -"Review can\'t be empty","评论不能为空" -"Review summary can\'t be empty","评论摘要不能为空" +"Review can't be empty","评论不能为空" +"Review summary can't be empty","评论摘要不能为空" "Reviews and Ratings","评测与评级" "SKU","SKU" "Save Review","保存评测" diff --git a/app/code/Magento/Rss/Block/Order/Status.php b/app/code/Magento/Rss/Block/Order/Status.php index 7dc443612811b..20b0a880d402b 100644 --- a/app/code/Magento/Rss/Block/Order/Status.php +++ b/app/code/Magento/Rss/Block/Order/Status.php @@ -34,7 +34,7 @@ class Status extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -50,14 +50,14 @@ class Status extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Rss\Model\RssFactory $rssFactory * @param \Magento\Rss\Model\Resource\OrderFactory $orderFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\Rss\Model\Resource\OrderFactory $orderFactory, array $data = array() diff --git a/app/code/Magento/Rss/Block/Wishlist.php b/app/code/Magento/Rss/Block/Wishlist.php index 5f983466ca0ff..3ae79b55fe6d9 100644 --- a/app/code/Magento/Rss/Block/Wishlist.php +++ b/app/code/Magento/Rss/Block/Wishlist.php @@ -77,7 +77,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom @@ -95,13 +95,13 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param \Magento\Catalog\Helper\Output $outputHelper * @param array $data * @param array $priceBlockTypes - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, diff --git a/app/code/Magento/Rss/Controller/Order.php b/app/code/Magento/Rss/Controller/Order.php index 850101a540564..fbe27825a112b 100644 --- a/app/code/Magento/Rss/Controller/Order.php +++ b/app/code/Magento/Rss/Controller/Order.php @@ -34,17 +34,17 @@ class Order extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php index 84953cec8ddc3..014c2f9d8d979 100644 --- a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php +++ b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php @@ -38,8 +38,8 @@ class Links extends \Magento\Core\Model\Config\Value protected $_cacheTypeList; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\App\Cache\TypeListInterface $cacheTypeList @@ -48,8 +48,8 @@ class Links extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\App\Cache\TypeListInterface $cacheTypeList, diff --git a/app/code/Magento/Rss/i18n/de_DE.csv b/app/code/Magento/Rss/i18n/de_DE.csv index 8dca1fca61fa4..4093b2e2f80e8 100644 --- a/app/code/Magento/Rss/i18n/de_DE.csv +++ b/app/code/Magento/Rss/i18n/de_DE.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - Sonderangebote" "%s RSS Feed","%s RSS-Feed" "%s has reached a quantity of %s.","%s hat eine Menge von %s erreicht." -"%s\'s Wishlist","%ss Wunschzettel" +"%s's Wishlist","%ss Wunschzettel" "Cannot retrieve the wishlist","Kann den Wunschzettel nicht abrufen." "Catalog","Katalog" "Category Feeds","Feeds aus Kategorien" diff --git a/app/code/Magento/Rss/i18n/en_US.csv b/app/code/Magento/Rss/i18n/en_US.csv index ddc6d7767a48d..2781d47486490 100644 --- a/app/code/Magento/Rss/i18n/en_US.csv +++ b/app/code/Magento/Rss/i18n/en_US.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - Special Products" "%s RSS Feed","%s RSS Feed" "%s has reached a quantity of %s.","%s has reached a quantity of %s." -"%s\'s Wishlist","%s\'s Wishlist" +"%s's Wishlist","%s's Wishlist" "Cannot retrieve the wishlist","Cannot retrieve the wishlist" "Catalog","Catalog" "Category Feeds","Category Feeds" diff --git a/app/code/Magento/Rss/i18n/es_ES.csv b/app/code/Magento/Rss/i18n/es_ES.csv index 8a1b656e386bc..4bfdde6c4e356 100644 --- a/app/code/Magento/Rss/i18n/es_ES.csv +++ b/app/code/Magento/Rss/i18n/es_ES.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - Productos especiales" "%s RSS Feed","Fuente RSS de %s" "%s has reached a quantity of %s.","%s ha alcanzado una cantidad de %s" -"%s\'s Wishlist","%s's Lista" +"%s's Wishlist","%s's Lista" "Cannot retrieve the wishlist","No se puede recuperar la lista de regalos" "Catalog","Catálogo" "Category Feeds","Fuentes por categoría" diff --git a/app/code/Magento/Rss/i18n/fr_FR.csv b/app/code/Magento/Rss/i18n/fr_FR.csv index 8e0dc13a01f2f..fc34750285ff1 100644 --- a/app/code/Magento/Rss/i18n/fr_FR.csv +++ b/app/code/Magento/Rss/i18n/fr_FR.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - Produits spéciaux" "%s RSS Feed","%s Flux RSS" "%s has reached a quantity of %s.","%s a atteint une quantité de %s." -"%s\'s Wishlist","Liste de cadeaux de %s" +"%s's Wishlist","Liste de cadeaux de %s" "Cannot retrieve the wishlist","Impossible de récupérer la liste de cadeaux" "Catalog","Catalogue" "Category Feeds","Flux de catégorie" diff --git a/app/code/Magento/Rss/i18n/nl_NL.csv b/app/code/Magento/Rss/i18n/nl_NL.csv index 2415a1d9846cc..9d26ecaaf9d0e 100644 --- a/app/code/Magento/Rss/i18n/nl_NL.csv +++ b/app/code/Magento/Rss/i18n/nl_NL.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - Speciale Producten" "%s RSS Feed","%s RSS Feed" "%s has reached a quantity of %s.","%s heeft een kwantiteit van %s bereikt." -"%s\'s Wishlist","%s\'s Wensenlijst" +"%s's Wishlist","%s's Wensenlijst" "Cannot retrieve the wishlist","Kan de wensenlijst niet ontvangen" "Catalog","Catalogus" "Category Feeds","Categorie feeds" diff --git a/app/code/Magento/Rss/i18n/pt_BR.csv b/app/code/Magento/Rss/i18n/pt_BR.csv index e8b53bbe8391a..2c0b5c7b49b37 100644 --- a/app/code/Magento/Rss/i18n/pt_BR.csv +++ b/app/code/Magento/Rss/i18n/pt_BR.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - Produtos especiais" "%s RSS Feed","%s RSS Feed" "%s has reached a quantity of %s.","%s atingiu a quantia de %s." -"%s\'s Wishlist","Lista de presente de %s\" +"%s's Wishlist","Lista de presente de %s\" "Cannot retrieve the wishlist","Não é possível recuperar a lista de presente" "Catalog","Catálogo" "Category Feeds","Feeds da categoria" diff --git a/app/code/Magento/Rss/i18n/zh_CN.csv b/app/code/Magento/Rss/i18n/zh_CN.csv index bb08f2c0cff54..d95ecdb96ba2a 100644 --- a/app/code/Magento/Rss/i18n/zh_CN.csv +++ b/app/code/Magento/Rss/i18n/zh_CN.csv @@ -2,7 +2,7 @@ "%s - Special Products","%s - 特价产品" "%s RSS Feed","%s RSS源" "%s has reached a quantity of %s.","%s 已经达到了一些 %s" -"%s\'s Wishlist","%s 的愿望清单" +"%s's Wishlist","%s 的愿望清单" "Cannot retrieve the wishlist","无法获取愿望清单" "Catalog","分类" "Category Feeds","分类源" diff --git a/app/code/Magento/Rule/Model/AbstractModel.php b/app/code/Magento/Rule/Model/AbstractModel.php index a90309cd88ab6..13a27aed067f5 100644 --- a/app/code/Magento/Rule/Model/AbstractModel.php +++ b/app/code/Magento/Rule/Model/AbstractModel.php @@ -93,8 +93,8 @@ abstract public function getActionsInstance(); protected $_locale; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -102,8 +102,8 @@ abstract public function getActionsInstance(); * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Rule/Model/Rule.php b/app/code/Magento/Rule/Model/Rule.php index eda4c0ae201b0..5188c6a3045b8 100644 --- a/app/code/Magento/Rule/Model/Rule.php +++ b/app/code/Magento/Rule/Model/Rule.php @@ -48,8 +48,8 @@ class Rule extends AbstractModel protected $_actions; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Rule\Model\Condition\CombineFactory $conditionsFactory @@ -59,8 +59,8 @@ class Rule extends AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Rule\Model\Condition\CombineFactory $conditionsFactory, diff --git a/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php b/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php index e1943ac01c465..4d735dc3b7eea 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php @@ -56,7 +56,7 @@ class AbstractItems extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -68,13 +68,13 @@ class AbstractItems extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_productFactory = $productFactory; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php b/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php index 6e6bcfd77f8ad..d07306e70e06f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php @@ -38,7 +38,7 @@ class AbstractOrder extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -49,13 +49,13 @@ class AbstractOrder extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Admin $adminHelper * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Admin $adminHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php index 8ec4eca51b2cb..22f90f71adf1a 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php @@ -34,18 +34,18 @@ class Address extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php index 348a185fc5a87..b9219a9ab6dae 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php @@ -35,7 +35,7 @@ class Form /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -50,7 +50,7 @@ class Form * @param \Magento\Customer\Helper\Data $customerHelper * @param \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService * @param \Magento\Customer\Helper\Address $addressHelper - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -65,7 +65,7 @@ public function __construct( \Magento\Customer\Helper\Data $customerHelper, \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService, \Magento\Customer\Helper\Address $addressHelper, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php index 5b9b5708f4b2a..ff8ca293bccb3 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php @@ -128,7 +128,7 @@ public function getOrderDataJson() $addressForm = $this->_customerFormFactory->create( 'customer_address', 'adminhtml_customer_address', - $addressDto->__toArray() + $addressDto->getAttributes() ); $data['addresses'][$addressDto->getId()] = $addressForm ->outputData(\Magento\Eav\Model\AttributeDataFactory::OUTPUT_FORMAT_JSON); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php index 363f0cf19638c..4b31868750059 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php @@ -155,7 +155,7 @@ public function getFormValues() } catch (\Exception $e) { /** If customer does not exist do nothing. */ } - $data = isset($customer) ? $customer->__toArray() : array(); + $data = isset($customer) ? $customer->getAttributes() : array(); foreach ($this->getQuote()->getData() as $key => $value) { if (strpos($key, 'customer_') === 0) { $data[substr($key, 9)] = $value; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php index 84b9b7eb8a9b2..a4329f4669336 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php @@ -143,7 +143,7 @@ public function getAddressCollectionJson() $addressForm = $this->_customerFormFactory->create( 'customer_address', 'adminhtml_customer_address', - $addressDto->__toArray() + $addressDto->getAttributes() ); $data[$addressDto->getId()] = $addressForm->outputData( \Magento\Eav\Model\AttributeDataFactory::OUTPUT_FORMAT_JSON @@ -277,7 +277,7 @@ public function getAddressAsString($addressData) $formatTypeRenderer = $this->_addressHelper->getFormatTypeRenderer('oneline'); $result = ''; if ($formatTypeRenderer) { - $result = $formatTypeRenderer->renderArray($addressData->__toArray()); + $result = $formatTypeRenderer->renderArray($addressData->getAttributes()); } return $this->escapeHtml($result); } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php index 532c9e0f1b83f..2478edddc0d63 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php @@ -65,7 +65,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Session\Quote $sessionQuote * @param \Magento\GiftMessage\Helper\Message $messageHelper @@ -73,7 +73,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Session\Quote $sessionQuote, \Magento\GiftMessage\Helper\Message $messageHelper, diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php index 6c9521e328f25..69b8a41299b12 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php @@ -35,18 +35,18 @@ class Create extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php index ae8f325e6c3d0..1f5cc8b24616f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php @@ -43,14 +43,14 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Data $salesData * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Data $salesData, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php index 6d64c7d255657..3e9d3ea60be58 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php @@ -38,18 +38,18 @@ class View extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php index c837f3f8222d9..48cdf667a57f9 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php @@ -39,18 +39,18 @@ class Comments extends \Magento\Backend\Block\Text\ListText /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php index b6184432389f8..6eb25fd8bbfac 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php @@ -35,18 +35,18 @@ class Create extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php index a6d83c08c8a92..3948ef7be0c29 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php @@ -43,14 +43,14 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Data $salesData * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Data $salesData, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php index e05e2bdf711e1..8c1667cbf1e30 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php @@ -45,7 +45,7 @@ class View extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -57,13 +57,13 @@ class View extends \Magento\Backend\Block\Widget\Form\Container /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Model\Auth\Session $backendSession - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Model\Auth\Session $backendSession, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_backendSession = $backendSession; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php index fcb86272ca1fe..85917f0b174e8 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php @@ -39,18 +39,18 @@ class Comments extends \Magento\Backend\Block\Text\ListText /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php index c5a0305cf2f21..36a6e3fa8e9df 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php @@ -43,7 +43,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Sales\Model\Order\Config $orderConfig * @param \Magento\Sales\Model\Resource\Order\Status\CollectionFactory $collectionFactory @@ -51,7 +51,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Sales\Model\Resource\Order\Status\CollectionFactory $collectionFactory, diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php index 5c01a6f55c9fa..a6375beaf5c81 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php @@ -43,7 +43,7 @@ class View extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -59,14 +59,14 @@ class View extends \Magento\Backend\Block\Widget\Form\Container /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Sales\Helper\Reorder $reorderHelper * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Model\Config $salesConfig, \Magento\Sales\Helper\Reorder $reorderHelper, array $data = array() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php index 1473547241a51..1ec1e638d933f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php @@ -45,7 +45,7 @@ class Giftmessage extends \Magento\Backend\Block\Widget /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -62,14 +62,14 @@ class Giftmessage extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\GiftMessage\Model\MessageFactory $messageFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\GiftMessage\Helper\Message $messageHelper * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\GiftMessage\Model\MessageFactory $messageFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\GiftMessage\Helper\Message $messageHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php index 34b0064aed6ba..8f0d2fc7a795d 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php @@ -38,10 +38,10 @@ class History extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Sales data * @@ -52,13 +52,13 @@ class History extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Sales\Helper\Data $salesData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php index e62c28153fdb1..aeff22b584e92 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php @@ -50,7 +50,7 @@ class Info extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Admin $adminHelper * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param CustomerMetadataServiceInterface $customerMetadataService @@ -59,7 +59,7 @@ class Info extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Admin $adminHelper, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, CustomerMetadataServiceInterface $customerMetadataService, diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Items/Renderer/DefaultRenderer.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Items/Renderer/DefaultRenderer.php index 0e60429430f14..3da5ac481ace1 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Items/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Items/Renderer/DefaultRenderer.php @@ -48,7 +48,7 @@ class DefaultRenderer extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\GiftMessage\Helper\Message $messageHelper * @param \Magento\Checkout\Helper\Data $checkoutHelper * @param array $data @@ -56,7 +56,7 @@ class DefaultRenderer extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\GiftMessage\Helper\Message $messageHelper, \Magento\Checkout\Helper\Data $checkoutHelper, array $data = array() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php index 4f10e2c27ca48..166cbce76ea71 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php @@ -38,7 +38,7 @@ class Messages extends \Magento\View\Element\Messages /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $coreRegistry = null; @@ -47,7 +47,7 @@ class Messages extends \Magento\View\Element\Messages * @param \Magento\Message\Factory $messageFactory * @param \Magento\Message\CollectionFactory $collectionFactory * @param \Magento\Message\ManagerInterface $messageManager - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( @@ -55,7 +55,7 @@ public function __construct( \Magento\Message\Factory $messageFactory, \Magento\Message\CollectionFactory $collectionFactory, \Magento\Message\ManagerInterface $messageManager, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php index 6cfa1ee36a42a..b65d04d36fbe6 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php @@ -40,7 +40,7 @@ class Creditmemos /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -59,7 +59,7 @@ class Creditmemos * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory * @param \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -67,7 +67,7 @@ public function __construct( \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 45532f4183b97..50237f6a034d3 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -43,18 +43,18 @@ class History /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php index 41743203a0911..4dc528c1c96dc 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php @@ -40,7 +40,7 @@ class Invoices /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -59,7 +59,7 @@ class Invoices * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory * @param \Magento\Sales\Model\Order\Invoice $orderInvoice - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -67,7 +67,7 @@ public function __construct( \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, \Magento\Sales\Model\Order\Invoice $orderInvoice, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php index ca7726e567b66..6c7e3e2a1d5ad 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php @@ -36,7 +36,7 @@ class Shipments /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -49,14 +49,14 @@ class Shipments * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php index 5ac91da0aac25..3fb32362d959c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php @@ -34,7 +34,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -42,14 +42,14 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php index e914de1a70d34..11bf6bb567012 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php @@ -42,14 +42,14 @@ class Form extends \Magento\Reports\Block\Adminhtml\Filter\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Sales\Model\Order\ConfigFactory $orderConfig, array $data = array() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php index b97322bc48563..24aaaecae29eb 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php @@ -49,7 +49,7 @@ class Coupon extends \Magento\Sales\Block\Adminhtml\Report\Filter\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig * @param \Magento\SalesRule\Model\Resource\Report\RuleFactory $reportRule @@ -57,7 +57,7 @@ class Coupon extends \Magento\Sales\Block\Adminhtml\Report\Filter\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Sales\Model\Order\ConfigFactory $orderConfig, \Magento\SalesRule\Model\Resource\Report\RuleFactory $reportRule, diff --git a/app/code/Magento/Sales/Block/Adminhtml/Totals.php b/app/code/Magento/Sales/Block/Adminhtml/Totals.php index 6b76b15b05f70..32b2bf5adbaeb 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Totals.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Totals.php @@ -35,13 +35,13 @@ class Totals extends \Magento\Sales\Block\Order\Totals /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Admin $adminHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Admin $adminHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php index c7417b269960f..ac8669142fb5c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php @@ -45,18 +45,18 @@ class Detail extends \Magento\Backend\Block\Widget\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php index 11c7f3a29b193..2f99f3693d91f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php @@ -38,7 +38,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,14 +51,14 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Data\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Data\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_collectionFactory = $collectionFactory; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php index de7195575f2f7..05dc58f2fcb04 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php @@ -38,10 +38,10 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; - + /** * Payment data * @@ -65,7 +65,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Sales\Model\Order\Payment\Transaction $transaction * @param \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -74,7 +74,7 @@ public function __construct( \Magento\Sales\Model\Order\Payment\Transaction $transaction, \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory, \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo.php b/app/code/Magento/Sales/Block/Order/Creditmemo.php index 5051f6b8e1545..4703ebd9d39ba 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo.php @@ -52,14 +52,14 @@ class Creditmemo extends \Magento\Sales\Block\Order\Creditmemo\Items /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php index f4f797daf3bbf..d4e5ecc440d9c 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php @@ -34,18 +34,18 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo/Totals.php b/app/code/Magento/Sales/Block/Order/Creditmemo/Totals.php index 9609d7a6789c6..5a3b2f8bce138 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo/Totals.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo/Totals.php @@ -29,12 +29,12 @@ class Totals extends \Magento\Sales\Block\Order\Totals { /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { parent::__construct($context, $registry, $data); diff --git a/app/code/Magento/Sales/Block/Order/Info.php b/app/code/Magento/Sales/Block/Order/Info.php index 861b945ad4106..bf3420dc3872f 100644 --- a/app/code/Magento/Sales/Block/Order/Info.php +++ b/app/code/Magento/Sales/Block/Order/Info.php @@ -41,7 +41,7 @@ class Info extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -52,13 +52,13 @@ class Info extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/Info/Buttons.php b/app/code/Magento/Sales/Block/Order/Info/Buttons.php index e78513db515e5..8a6fe8a5b3223 100644 --- a/app/code/Magento/Sales/Block/Order/Info/Buttons.php +++ b/app/code/Magento/Sales/Block/Order/Info/Buttons.php @@ -40,7 +40,7 @@ class Buttons extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,13 +51,13 @@ class Buttons extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/Invoice.php b/app/code/Magento/Sales/Block/Order/Invoice.php index 4b84a76d58a87..99ff50e07a32c 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice.php +++ b/app/code/Magento/Sales/Block/Order/Invoice.php @@ -48,14 +48,14 @@ class Invoice extends \Magento\Sales\Block\Order\Invoice\Items /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() diff --git a/app/code/Magento/Sales/Block/Order/Invoice/Items.php b/app/code/Magento/Sales/Block/Order/Invoice/Items.php index c81621060133e..0727dd879b5b1 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice/Items.php +++ b/app/code/Magento/Sales/Block/Order/Invoice/Items.php @@ -38,18 +38,18 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Order/Invoice/Totals.php b/app/code/Magento/Sales/Block/Order/Invoice/Totals.php index b762ef093fc98..d3c14c9bb36b7 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice/Totals.php +++ b/app/code/Magento/Sales/Block/Order/Invoice/Totals.php @@ -29,12 +29,12 @@ class Totals extends \Magento\Sales\Block\Order\Totals { /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { parent::__construct($context, $registry, $data); diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php index 52d88c8ccaece..a2ab2b8266380 100644 --- a/app/code/Magento/Sales/Block/Order/Items.php +++ b/app/code/Magento/Sales/Block/Order/Items.php @@ -38,18 +38,18 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Order/Link.php b/app/code/Magento/Sales/Block/Order/Link.php index 40f448150af7c..996313df4897c 100644 --- a/app/code/Magento/Sales/Block/Order/Link.php +++ b/app/code/Magento/Sales/Block/Order/Link.php @@ -29,19 +29,19 @@ */ class Link extends \Magento\View\Element\Html\Link\Current { - /** @var \Magento\Core\Model\Registry */ + /** @var \Magento\Registry */ protected $_registry; /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\App\DefaultPathInterface $defaultPath - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\App\DefaultPathInterface $defaultPath, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { parent::__construct($context, $defaultPath, $data); diff --git a/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php b/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php index 2a9ca1e450e7c..fa172cd92f265 100644 --- a/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php +++ b/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php @@ -34,7 +34,7 @@ class Creditmemo extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -45,13 +45,13 @@ class Creditmemo extends \Magento\Sales\Block\Items\AbstractItems /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php b/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php index 5cad3b904aaa2..b505b74995f9f 100644 --- a/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php +++ b/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php @@ -34,7 +34,7 @@ class Invoice extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -45,13 +45,13 @@ class Invoice extends \Magento\Sales\Block\Items\AbstractItems /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php b/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php index 9c3e227841ddd..fff9896d019bc 100644 --- a/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php +++ b/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php @@ -48,7 +48,7 @@ class Shipment extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -59,13 +59,13 @@ class Shipment extends \Magento\Sales\Block\Items\AbstractItems /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/PrintShipment.php b/app/code/Magento/Sales/Block/Order/PrintShipment.php index 461f19eaf3827..e6d071efe3de1 100644 --- a/app/code/Magento/Sales/Block/Order/PrintShipment.php +++ b/app/code/Magento/Sales/Block/Order/PrintShipment.php @@ -38,7 +38,7 @@ class PrintShipment extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -49,13 +49,13 @@ class PrintShipment extends \Magento\Sales\Block\Items\AbstractItems /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/Totals.php b/app/code/Magento/Sales/Block/Order/Totals.php index b9ff01e0c3448..6ea76ba996db6 100644 --- a/app/code/Magento/Sales/Block/Order/Totals.php +++ b/app/code/Magento/Sales/Block/Order/Totals.php @@ -41,18 +41,18 @@ class Totals extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Order/View.php b/app/code/Magento/Sales/Block/Order/View.php index 764853bf3d059..39db103fdc04f 100644 --- a/app/code/Magento/Sales/Block/Order/View.php +++ b/app/code/Magento/Sales/Block/Order/View.php @@ -39,7 +39,7 @@ class View extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -55,14 +55,14 @@ class View extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() diff --git a/app/code/Magento/Sales/Controller/AbstractController.php b/app/code/Magento/Sales/Controller/AbstractController.php index bade585075c68..951c798a07842 100644 --- a/app/code/Magento/Sales/Controller/AbstractController.php +++ b/app/code/Magento/Sales/Controller/AbstractController.php @@ -34,17 +34,17 @@ abstract class AbstractController extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order.php b/app/code/Magento/Sales/Controller/Adminhtml/Order.php index a7e82aa7be637..266afe31a6860 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order.php @@ -47,7 +47,7 @@ class Order extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -63,13 +63,13 @@ class Order extends \Magento\Backend\App\Action /** * @param Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\Response\Http\FileFactory $fileFactory * @param \Magento\Translate\InlineInterface $translateInline */ public function __construct( Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\Response\Http\FileFactory $fileFactory, \Magento\Translate\InlineInterface $translateInline ) { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php index 78830b9df1cde..736fa2b9e5a10 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php @@ -170,7 +170,7 @@ protected function _initCreditmemo($update = false) 'request' => $this->getRequest(), )); - $this->_objectManager->get('Magento\Core\Model\Registry')->register('current_creditmemo', $creditmemo); + $this->_objectManager->get('Magento\Registry')->register('current_creditmemo', $creditmemo); return $creditmemo; } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php index 4877d8c711c2d..cc0661ef92e36 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php @@ -38,7 +38,7 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -50,12 +50,12 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\App\Response\Http\FileFactory $fileFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\App\Response\Http\FileFactory $fileFactory, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context, $fileFactory); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php index ff09f54f97d5a..6783b8f97e8d7 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php @@ -38,17 +38,17 @@ class Status extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php index 6b4c60e11e752..aba38bb402f33 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php @@ -38,17 +38,17 @@ class Transactions extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Sales/Controller/Download.php b/app/code/Magento/Sales/Controller/Download.php index f4d2789fe8730..b175f4513cfb3 100644 --- a/app/code/Magento/Sales/Controller/Download.php +++ b/app/code/Magento/Sales/Controller/Download.php @@ -18,169 +18,27 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Controller; + +use \Magento\Catalog\Model\Product\Type\AbstractType as AbstractProductType; /** * Sales controller for download purposes - * - * @category Magento - * @package Magento_Sales - * @author Magento Core Team */ -namespace Magento\Sales\Controller; - class Download extends \Magento\App\Action\Action { /** - * @var \Magento\App\Response\Http\FileFactory - */ - protected $_fileResponseFactory; - - /** - * Filesystem instance - * - * @var \Magento\App\Filesystem - */ - protected $_filesystem; - - /** - * @param \Magento\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileResponseFactory - * @param \Magento\App\Filesystem $filesystem - */ - public function __construct( - \Magento\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileResponseFactory, - \Magento\App\Filesystem $filesystem - ) { - $this->_fileResponseFactory = $fileResponseFactory; - $this->_filesystem = $filesystem; - parent::__construct($context); - } - - /** - * Custom options downloader - * - * @param mixed $info - */ - protected function _downloadFileAction($info) - { - $secretKey = $this->getRequest()->getParam('key'); - try { - if ($secretKey != $info['secret_key']) { - throw new \Exception(); - } - - /** @var \Magento\Filesystem\Directory\Read $directory */ - $directory = $this->_objectManager->get('Magento\App\Filesystem') - ->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); - - $relativePath = $info['order_path']; - $filePath = $directory->getAbsolutePath($relativePath); - if ((!$directory->isFile($relativePath) || !$directory->isReadable($relativePath)) - && !$this->_processDatabaseFile($filePath) - ) { - //try get file from quote - $relativePath = $info['quote_path']; - $filePath = $directory->getAbsolutePath($relativePath); - if ((!$directory->isFile($relativePath) || !$directory->isReadable($relativePath)) - && !$this->_processDatabaseFile($filePath) - ) { - throw new \Exception(); - } - } - $this->_fileResponseFactory->create( - $info['title'], - array( - 'value' => $filePath, - 'type' => 'filename' - ), - \Magento\App\Filesystem::ROOT_DIR - ); - } catch (\Exception $e) { - $this->_forward('noroute'); - } - } - - /** - * Check file in database storage if needed and place it on file system - * - * @param string $filePath - * @return bool + * @var \Magento\Sales\Model\Download */ - protected function _processDatabaseFile($filePath) - { - if (!$this->_objectManager->get('Magento\Core\Helper\File\Storage\Database')->checkDbUsage()) { - return false; - } - - $relativePath = $this->_objectManager->get('Magento\Core\Helper\File\Storage\Database') - ->getMediaRelativePath($filePath); - $file = $this->_objectManager->create('Magento\Core\Model\File\Storage\Database') - ->loadByFilename($relativePath); - - if (!$file->getId()) { - return false; - } - - /** @var \Magento\Filesystem\Directory\WriteInterface $directory */ - $directory = $this->_objectManager->get('Magento\App\Filesystem') - ->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); - $stream = $directory->openFile($filePath, 'w+'); - $stream->lock(); - $stream->write($filePath, $file->getContent()); - $stream->unlock(); - $stream->close(); - - return true; - } + protected $_download; - /** - * Profile custom options download action - */ - public function downloadProfileCustomOptionAction() + public function __construct(\Magento\App\Action\Context $context, \Magento\Sales\Model\Download $download) { - $recurringProfile = $this->_objectManager->create('Magento\RecurringProfile\Model\Profile') - ->load($this->getRequest()->getParam('id')); - - if (!$recurringProfile->getId()) { - $this->_forward('noroute'); - } - - $orderItemInfo = $recurringProfile->getData('order_item_info'); - try { - $request = unserialize($orderItemInfo['info_buyRequest']); - - if ($request['product'] != $orderItemInfo['product_id']) { - $this->_forward('noroute'); - return; - } - - $optionId = $this->getRequest()->getParam('option_id'); - if (!isset($request['options'][$optionId])) { - $this->_forward('noroute'); - return; - } - // Check if the product exists - $product = $this->_objectManager->create('Magento\Catalog\Model\Product')->load($request['product']); - if (!$product || !$product->getId()) { - $this->_forward('noroute'); - return; - } - // Try to load the option - $option = $product->getOptionById($optionId); - if (!$option || !$option->getId() || $option->getType() != 'file') { - $this->_forward('noroute'); - return; - } - $this->_downloadFileAction($request['options'][$this->getRequest()->getParam('option_id')]); - } catch (\Exception $e) { - $this->_forward('noroute'); - } + $this->_download = $download; + parent::__construct($context); } /** @@ -198,8 +56,8 @@ public function downloadCustomOptionAction() } $optionId = null; - if (strpos($option->getCode(), \Magento\Catalog\Model\Product\Type\AbstractType::OPTION_PREFIX) === 0) { - $optionId = str_replace(\Magento\Catalog\Model\Product\Type\AbstractType::OPTION_PREFIX, '', $option->getCode()); + if (strpos($option->getCode(), AbstractProductType::OPTION_PREFIX) === 0) { + $optionId = str_replace(AbstractProductType::OPTION_PREFIX, '', $option->getCode()); if ((int)$optionId != $optionId) { $optionId = null; } @@ -218,7 +76,11 @@ public function downloadCustomOptionAction() try { $info = unserialize($option->getValue()); - $this->_downloadFileAction($info); + if ($this->getRequest()->getParam('key') != $info['secret_key']) { + $this->_forward('noroute'); + return; + } + $this->_download->downloadFile($info); } catch (\Exception $e) { $this->_forward('noroute'); } diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index 55df6ad74a326..6bb48e376c707 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -43,7 +43,7 @@ class Guest extends \Magento\Core\Helper\Data /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -73,7 +73,7 @@ class Guest extends \Magento\Core\Helper\Data * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Locale $locale * @param \Magento\App\State $appState - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Stdlib\Cookie $coreCookie * @param \Magento\Message\ManagerInterface $messageManager @@ -87,7 +87,7 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Locale $locale, \Magento\App\State $appState, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Stdlib\Cookie $coreCookie, \Magento\Message\ManagerInterface $messageManager, diff --git a/app/code/Magento/Sales/Model/AbstractModel.php b/app/code/Magento/Sales/Model/AbstractModel.php index f20c2d2ae11bb..2e27caed3345d 100644 --- a/app/code/Magento/Sales/Model/AbstractModel.php +++ b/app/code/Magento/Sales/Model/AbstractModel.php @@ -43,8 +43,8 @@ abstract class AbstractModel extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -52,8 +52,8 @@ abstract class AbstractModel extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Sales/Model/AdminOrder.php b/app/code/Magento/Sales/Model/AdminOrder.php deleted file mode 100644 index f434ce6a14afc..0000000000000 --- a/app/code/Magento/Sales/Model/AdminOrder.php +++ /dev/null @@ -1,107 +0,0 @@ - - */ -namespace Magento\Sales\Model; - -class AdminOrder -{ - /** - * @var \Magento\Message\ManagerInterface - */ - protected $messageManager; - - /** - * @var \Magento\Customer\Model\CustomerFactory] - */ - protected $_customerFactory; - - /** - * @var \Magento\Catalog\Model\ProductFactory - */ - protected $_productFactory; - - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Message\ManagerInterface $messageManager - */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Message\ManagerInterface $messageManager - ) { - $this->_productFactory = $productFactory; - $this->_customerFactory = $customerFactory; - $this->messageManager = $messageManager; - } - - public function checkRelation(\Magento\Sales\Model\Order $order) - { - /** - * Check customer existing - */ - $customer = $this->_customerFactory->create()->load($order->getCustomerId()); - if (!$customer->getId()) { - $this->messageManager->addNotice(__(' The customer does not exist in the system anymore.')); - } - - /** - * Check Item products existing - */ - $productIds = array(); - foreach ($order->getAllItems() as $item) { - $productIds[] = $item->getProductId(); - } - - $productCollection = $this->_productFactory->create()->getCollection() - ->addIdFilter($productIds) - ->load(); - - $hasBadItems = false; - foreach ($order->getAllItems() as $item) { - if (!$productCollection->getItemById($item->getProductId())) { - $this->messageManager->addError( - __('The item %1 (SKU %2) does not exist in the catalog anymore.', $item->getName(), $item->getSku() - )); - $hasBadItems = true; - } - } - if ($hasBadItems) { - $this->messageManager->addError( - __('Some items in this order are no longer in our catalog.') - ); - } - return $this; - } - -} diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 97246cabba103..8d26da9a9a473 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -18,24 +18,29 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\AdminOrder; + +use Magento\Customer\Service\V1\CustomerServiceInterface; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; +use Magento\Customer\Service\V1\Dto\AddressBuilder as CustomerAddressBuilder; +use Magento\Customer\Service\V1\Dto\CustomerBuilder; +use Magento\Customer\Service\V1\CustomerGroupServiceInterface; +use Magento\Customer\Service\V1\Dto\Customer as CustomerDto; +use Magento\Customer\Model\Metadata\Form as CustomerForm; +use Magento\Customer\Service\V1\Dto\Address as CustomerAddressDto; /** * Order create model - * - * @category Magento - * @package Magento_Sales - * @author Magento Core Team */ -namespace Magento\Sales\Model\AdminOrder; - class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartInterface { + const XML_PATH_DEFAULT_EMAIL_DOMAIN = 'customer/create_account/email_domain'; + /** * Quote session object * @@ -85,27 +90,6 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car */ protected $_isValidate = false; - /** - * Customer instance - * - * @var \Magento\Customer\Model\Customer - */ - protected $_customer; - - /** - * Customer Address Form instance - * - * @var \Magento\Customer\Model\Form - */ - protected $_customerAddressForm; - - /** - * Customer Form instance - * - * @var \Magento\Customer\Model\Form - */ - protected $_customerForm; - /** * Array of validate errors * @@ -123,7 +107,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -164,40 +148,96 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car */ protected $quoteInitializer; + /** + * @var CustomerServiceInterface + */ + protected $_customerService; + + /** + * @var CustomerAddressServiceInterface + */ + protected $_customerAddressService; + + /** + * @var CustomerAddressBuilder + */ + protected $_customerAddressBuilder; + + /** + * @var \Magento\Customer\Model\Metadata\FormFactory + */ + protected $_metadataFormFactory; + + /** + * @var CustomerBuilder + */ + protected $_customerBuilder; + + /** + * @var \Magento\Customer\Helper\Data + */ + protected $_customerHelper; + + /** + * @var CustomerGroupServiceInterface + */ + protected $_customerGroupService; + /** * @param \Magento\ObjectManager $objectManager * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Backend\Model\Session\Quote $sessionQuote + * @param \Magento\Backend\Model\Session\Quote $quoteSession * @param \Magento\Logger $logger * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Message\ManagerInterface $messageManager * @param Product\Quote\Initializer $quoteInitializer + * @param CustomerServiceInterface $customerService + * @param CustomerAddressServiceInterface $customerAddressService + * @param CustomerAddressBuilder $customerAddressBuilder + * @param \Magento\Customer\Model\Metadata\FormFactory $metadataFormFactory + * @param CustomerBuilder $customerBuilder + * @param \Magento\Customer\Helper\Data $customerHelper + * @param CustomerGroupServiceInterface $customerGroupService * @param array $data */ public function __construct( \Magento\ObjectManager $objectManager, \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Sales\Model\Config $salesConfig, - \Magento\Backend\Model\Session\Quote $sessionQuote, + \Magento\Backend\Model\Session\Quote $quoteSession, \Magento\Logger $logger, \Magento\Object\Copy $objectCopyService, \Magento\Message\ManagerInterface $messageManager, Product\Quote\Initializer $quoteInitializer, + CustomerServiceInterface $customerService, + CustomerAddressServiceInterface $customerAddressService, + CustomerAddressBuilder $customerAddressBuilder, + \Magento\Customer\Model\Metadata\FormFactory $metadataFormFactory, + CustomerBuilder $customerBuilder, + \Magento\Customer\Helper\Data $customerHelper, + CustomerGroupServiceInterface $customerGroupService, array $data = array() ) { $this->_objectManager = $objectManager; $this->_eventManager = $eventManager; $this->_coreRegistry = $coreRegistry; $this->_salesConfig = $salesConfig; + $this->_session = $quoteSession; $this->_logger = $logger; $this->_objectCopyService = $objectCopyService; $this->quoteInitializer = $quoteInitializer; - parent::__construct($data); - $this->_session = $sessionQuote; $this->messageManager = $messageManager; + $this->_customerService = $customerService; + $this->_customerAddressService = $customerAddressService; + $this->_customerAddressBuilder = $customerAddressBuilder; + $this->_metadataFormFactory = $metadataFormFactory; + $this->_customerBuilder = $customerBuilder; + $this->_customerHelper = $customerHelper; + $this->_customerGroupService = $customerGroupService; + parent::__construct($data); } /** @@ -340,7 +380,8 @@ public function setQuote(\Magento\Sales\Model\Quote $quote) * Initialize creation data from existing order * * @param \Magento\Sales\Model\Order $order - * @return \Magento\Sales\Model\AdminOrder\Create + * @return $this + * @throws \Magento\Core\Exception */ public function initFromOrder(\Magento\Sales\Model\Order $order) { @@ -432,6 +473,11 @@ public function initFromOrder(\Magento\Sales\Model\Order $order) return $this; } + /** + * Copy billing address from order + * + * @param \Magento\Sales\Model\Order $order + */ protected function _initBillingAddressFromOrder(\Magento\Sales\Model\Order $order) { $this->getQuote()->getBillingAddress()->setCustomerAddressId(''); @@ -443,6 +489,11 @@ protected function _initBillingAddressFromOrder(\Magento\Sales\Model\Order $orde ); } + /** + * Copy shipping address from order + * + * @param \Magento\Sales\Model\Order $order + */ protected function _initShippingAddressFromOrder(\Magento\Sales\Model\Order $order) { $orderShippingAddress = $order->getShippingAddress(); @@ -510,7 +561,7 @@ public function initFromOrderItem(\Magento\Sales\Model\Order\Item $orderItem, $q * * @params bool $cacheReload pass cached wishlist object and get new one * @param bool $cacheReload - * @return \Magento\Wishlist\Model\Wishlist + * @return \Magento\Wishlist\Model\Wishlist|bool Return false if customer ID is not specified */ public function getCustomerWishlist($cacheReload = false) { @@ -518,10 +569,10 @@ public function getCustomerWishlist($cacheReload = false) return $this->_wishlist; } - if ($this->getSession()->getCustomer()->getId()) { - $this->_wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist')->loadByCustomer( - $this->getSession()->getCustomer(), true - ); + $customerId = (int)$this->getSession()->getCustomerId(); + if ($customerId) { + $this->_wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist'); + $this->_wishlist->loadByCustomer($customerId, true); $this->_wishlist->setStore($this->getSession()->getStore()) ->setSharedStoreIds($this->getSession()->getStore()->getWebsite()->getStoreIds()); } else { @@ -544,11 +595,12 @@ public function getCustomerCart() $this->_cart = $this->_objectManager->create('Magento\Sales\Model\Quote'); - if ($this->getSession()->getCustomer()->getId()) { - $this->_cart->setStore($this->getSession()->getStore()) - ->loadByCustomer($this->getSession()->getCustomer()->getId()); + $customerId = (int)$this->getSession()->getCustomerId(); + if ($customerId) { + $this->_cart->setStore($this->getSession()->getStore())->loadByCustomer($customerId); if (!$this->_cart->getId()) { - $this->_cart->assignCustomer($this->getSession()->getCustomer()); + $customerData = $this->_customerService->getCustomer($customerId); + $this->_cart->assignCustomer($customerData); $this->_cart->save(); } } @@ -566,8 +618,8 @@ public function getCustomerCompareList() if (!is_null($this->_compareList)) { return $this->_compareList; } - - if ($this->getSession()->getCustomer()->getId()) { + $customerId = (int)$this->getSession()->getCustomerId(); + if ($customerId) { $this->_compareList = $this->_objectManager->create('Magento\Catalog\Model\Product\Compare\ListCompare'); } else { $this->_compareList = false; @@ -575,6 +627,11 @@ public function getCustomerCompareList() return $this->_compareList; } + /** + * Retrieve current customer group ID. + * + * @return int + */ public function getCustomerGroupId() { $groupId = $this->getQuote()->getCustomerGroupId(); @@ -591,6 +648,7 @@ public function getCustomerGroupId() * @param string $moveTo * @param int $qty * @return \Magento\Sales\Model\AdminOrder\Create + * @throws \Magento\Core\Exception */ public function moveQuoteItem($item, $moveTo, $qty) { @@ -653,15 +711,11 @@ public function moveQuoteItem($item, $moveTo, $qty) case 'wishlist': $wishlist = null; if (!isset($moveTo[1])) { - $wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist')->loadByCustomer( - $this->getSession()->getCustomer(), - true - ); + $wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist') + ->loadByCustomer($this->getSession()->getCustomerId(), true); } else { $wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist')->load($moveTo[1]); - if (!$wishlist->getId() - || $wishlist->getCustomerId() != $this->getSession()->getCustomerId() - ) { + if (!$wishlist->getId() || $wishlist->getCustomerId() != $this->getSession()->getCustomerId()) { $wishlist = null; } } @@ -699,6 +753,7 @@ public function moveQuoteItem($item, $moveTo, $qty) * * @param array $data * @return \Magento\Sales\Model\AdminOrder\Create + * @throws \Magento\Core\Exception */ public function applySidebarData($data) { @@ -804,6 +859,7 @@ public function removeQuoteItem($item) * @param int|\Magento\Catalog\Model\Product $product * @param array|float|int|\Magento\Object $config * @return \Magento\Sales\Model\AdminOrder\Create + * @throws \Magento\Core\Exception */ public function addProduct($product, $config = 1) { @@ -924,6 +980,7 @@ public function updateQuoteItems($data) * @param \Magento\Sales\Model\Quote\Item $item * @param $additionalOptions * @return array + * @throws \Magento\Core\Exception */ protected function _parseOptions(\Magento\Sales\Model\Quote\Item $item, $additionalOptions) { @@ -1064,6 +1121,12 @@ protected function _prepareOptionsForRequest($item) return $newInfoOptions; } + /** + * Return valid price + * + * @param float|int $price + * @return int + */ protected function _parseCustomPrice($price) { $price = $this->_objectManager->get('Magento\Core\Model\LocaleInterface')->getNumber($price); @@ -1084,31 +1147,19 @@ public function getShippingAddress() /** * Return Customer (Checkout) Form instance * - * @return \Magento\Customer\Model\Form + * @param CustomerDto $customerDto + * @return CustomerForm */ - protected function _getCustomerForm() + protected function _createCustomerForm(CustomerDto $customerDto) { - if (is_null($this->_customerForm)) { - $this->_customerForm = $this->_objectManager->create('Magento\Customer\Model\Form') - ->setFormCode('adminhtml_checkout') - ->ignoreInvisible(false); - } - return $this->_customerForm; - } + $customerForm = $this->_metadataFormFactory->create( + \Magento\Customer\Service\V1\CustomerMetadataServiceInterface::ENTITY_TYPE_CUSTOMER, + 'adminhtml_checkout', + $customerDto->getAttributes(), + CustomerForm::DONT_IGNORE_INVISIBLE + ); - /** - * Return Customer Address Form instance - * - * @return \Magento\Customer\Model\Form - */ - protected function _getCustomerAddressForm() - { - if (is_null($this->_customerAddressForm)) { - $this->_customerAddressForm = $this->_objectManager->create('Magento\Customer\Model\Form') - ->setFormCode('adminhtml_customer_address') - ->ignoreInvisible(false); - } - return $this->_customerAddressForm; + return $customerForm; } /** @@ -1121,10 +1172,24 @@ protected function _getCustomerAddressForm() */ protected function _setQuoteAddress(\Magento\Sales\Model\Quote\Address $address, array $data) { - $addressForm = $this->_getCustomerAddressForm() - ->setEntity($address) - ->setEntityType($this->_objectManager->get('Magento\Eav\Model\Config')->getEntityType('customer_address')) - ->setIsAjaxRequest(!$this->getIsValidate()); + $isAjax = !$this->getIsValidate(); + + // Region is a DTO, so it is represented by an array. validateData() doesn't understand arrays, so we need to + // merge region data with address data. This is going to be removed when we switch to use address DTO instead + // of the address model. + // Note: if we use getRegion() here it will pull region from db using the region_id + $data = isset($data['region']) && is_array($data['region']) + ? array_merge($data, $data['region']) + : $data; + + $addressForm = $this->_metadataFormFactory->create( + CustomerMetadataServiceInterface::ENTITY_TYPE_ADDRESS, + 'adminhtml_customer_address', + $data, + CustomerForm::DONT_IGNORE_INVISIBLE, + [], + $isAjax + ); // prepare request // save original request structure for files @@ -1135,8 +1200,8 @@ protected function _setQuoteAddress(\Magento\Sales\Model\Quote\Address $address, $requestData = array('order' => array('billing_address' => $data)); $requestScope = 'order/billing_address'; } - $request = $addressForm->prepareRequest($requestData); - $addressData = $addressForm->extractData($request, $requestScope); + $request = $addressForm->prepareRequest($requestData); + $addressData = $addressForm->extractData($request, $requestScope); if ($this->getIsValidate()) { $errors = $addressForm->validateData($addressData); if ($errors !== true) { @@ -1148,28 +1213,37 @@ protected function _setQuoteAddress(\Magento\Sales\Model\Quote\Address $address, foreach ($errors as $error) { $this->_errors[] = $typeName . $error; } - $addressForm->restoreData($addressData); + $address->setData($addressForm->restoreData($addressData)); } else { - $addressForm->compactData($addressData); + $address->setData($addressForm->compactData($addressData)); } } else { - $addressForm->restoreData($addressData); + $address->addData($addressForm->restoreData($addressData)); } - return $this; } + /** + * Set shipping address into quote + * + * @param \Magento\Sales\Model\Quote\Address|array $address + * @return $this + */ public function setShippingAddress($address) { if (is_array($address)) { - $address['save_in_address_book'] = isset($address['save_in_address_book']) - && !empty($address['save_in_address_book']); $shippingAddress = $this->_objectManager->create('Magento\Sales\Model\Quote\Address') ->setData($address) ->setAddressType(\Magento\Sales\Model\Quote\Address::TYPE_SHIPPING); if (!$this->getQuote()->isVirtual()) { $this->_setQuoteAddress($shippingAddress, $address); } + /** + * save_in_address_book is not a valid attribute and is filtered out by _setQuoteAddress, + * that is why it should be added after _setQuoteAddress call + */ + $saveInAddressBook = (int)!empty($address['save_in_address_book']); + $shippingAddress->setData('save_in_address_book', $saveInAddressBook); } if ($address instanceof \Magento\Sales\Model\Quote\Address) { $shippingAddress = $address; @@ -1180,6 +1254,13 @@ public function setShippingAddress($address) return $this; } + /** + * Set shipping anddress to be same as billing + * + * @param bool $flag If true - don't save in address book and actually copy data across billing and shipping + * addresses + * @return $this + */ public function setShippingAsBilling($flag) { if ($flag) { @@ -1205,28 +1286,45 @@ public function getBillingAddress() return $this->getQuote()->getBillingAddress(); } + /** + * Set billing address into quote + * + * @param array $address + * @return $this + */ public function setBillingAddress($address) { if (is_array($address)) { - $address['save_in_address_book'] = isset($address['save_in_address_book']) ? 1 : 0; $billingAddress = $this->_objectManager->create('Magento\Sales\Model\Quote\Address') ->setData($address) ->setAddressType(\Magento\Sales\Model\Quote\Address::TYPE_BILLING); $this->_setQuoteAddress($billingAddress, $address); - } + /** + * save_in_address_book is not a valid attribute and is filtered out by _setQuoteAddress, + * that is why it should be added after _setQuoteAddress call + */ + $saveInAddressBook = (int)!empty($address['save_in_address_book']); + $billingAddress->setData('save_in_address_book', $saveInAddressBook); + + if ($this->getShippingAddress()->getSameAsBilling()) { + $shippingAddress = clone $billingAddress; + $shippingAddress->setSameAsBilling(true); + $shippingAddress->setSaveInAddressBook(false); + $address['save_in_address_book'] = 0; + $this->setShippingAddress($address); + } - if ($this->getShippingAddress()->getSameAsBilling()) { - $shippingAddress = clone $billingAddress; - $shippingAddress->setSameAsBilling(true); - $shippingAddress->setSaveInAddressBook(false); - $address['save_in_address_book'] = 0; - $this->setShippingAddress($address); + $this->getQuote()->setBillingAddress($billingAddress); } - - $this->getQuote()->setBillingAddress($billingAddress); return $this; } + /** + * Set shipping method + * + * @param string $method + * @return $this + */ public function setShippingMethod($method) { $this->getShippingAddress()->setShippingMethod($method); @@ -1234,6 +1332,11 @@ public function setShippingMethod($method) return $this; } + /** + * Empty shipping method and clear shipping rates + * + * @return $this + */ public function resetShippingMethod() { $this->getShippingAddress()->setShippingMethod(false); @@ -1251,17 +1354,32 @@ public function collectShippingRates() return $this; } + /** + * Calculate totals + */ public function collectRates() { $this->getQuote()->collectTotals(); } + /** + * Set payment method into quote + * + * @param string $method + * @return $this + */ public function setPaymentMethod($method) { $this->getQuote()->getPayment()->setMethod($method); return $this; } + /** + * Set payment data into quote + * + * @param array $data + * @return $this + */ public function setPaymentData($data) { if (!isset($data['method'])) { @@ -1271,6 +1389,12 @@ public function setPaymentData($data) return $this; } + /** + * Add coupon code to the quote + * + * @param string $code + * @return $this + */ public function applyCoupon($code) { $code = trim((string)$code); @@ -1279,26 +1403,32 @@ public function applyCoupon($code) return $this; } + /** + * Add account data to quote + * + * @param array $accountData + * @return $this + */ public function setAccountData($accountData) { - $customer = $this->getQuote()->getCustomer(); - $form = $this->_getCustomerForm(); - $form->setEntity($customer); + $customer = $this->getQuote()->getCustomerData(); + $form = $this->_createCustomerForm($customer); // emulate request $request = $form->prepareRequest($accountData); - $data = $form->extractData($request); - $form->restoreData($data); + $data = $form->extractData($request); + $data = $form->restoreData($data); + $this->getQuote()->updateCustomerData($this->_customerBuilder->mergeDtoWithArray($customer, $data)); + $data = []; - $data = array(); foreach ($form->getAttributes() as $attribute) { $code = sprintf('customer_%s', $attribute->getAttributeCode()); - $data[$code] = $customer->getData($attribute->getAttributeCode()); + $data[$code] = $customer->getAttribute($attribute->getAttributeCode()); } if (isset($data['customer_group_id'])) { - $groupModel = $this->_objectManager->create('Magento\Customer\Model\Group')->load($data['customer_group_id']); - $data['customer_tax_class_id'] = $groupModel->getTaxClassId(); + $customerGroup = $this->_customerGroupService->getGroup($data['customer_group_id']); + $data['customer_tax_class_id'] = $customerGroup->getTaxClassId(); $this->setRecollect(true); } @@ -1358,173 +1488,155 @@ public function importPostData($data) /** * Check whether we need to create new customer (for another website) during order creation * - * @param \Magento\Core\Model\Store $store - * @return boolean + * @param \Magento\Core\Model\Store $store + * @return bool */ protected function _customerIsInStore($store) { - $customer = $this->getSession()->getCustomer(); - if ($customer->getWebsiteId() == $store->getWebsiteId()) { - return true; - } - return $customer->isInStore($store); + $customerId = (int)$this->getSession()->getCustomerId(); + $customerData = $this->_customerService->getCustomer($customerId); + return $customerData->getWebsiteId() == $store->getWebsiteId() || + $this->_customerHelper->isCustomerInStore($customerData->getWebsiteId(), $store->getId()); } /** - * Set and validate Customer data + * Set and validate Customer data. Return the updated DTO merged with the account data * - * @param \Magento\Customer\Model\Customer $customer - * @return \Magento\Sales\Model\AdminOrder\Create + * @param CustomerDto $customerDto + * @return CustomerDto */ - protected function _setCustomerData(\Magento\Customer\Model\Customer $customer) + protected function _validateCustomerData(CustomerDto $customerDto) { - $form = $this->_getCustomerForm(); - $form->setEntity($customer); - + $form = $this->_createCustomerForm($customerDto); // emulate request $request = $form->prepareRequest(array('order' => $this->getData())); - $data = $form->extractData($request, 'order/account'); + $data = $form->extractData($request, 'order/account'); if ($this->getIsValidate()) { $errors = $form->validateData($data); - if ($errors !== true) { + if (is_array($errors)) { foreach ($errors as $error) { $this->_errors[] = $error; } - $form->restoreData($data); - } else { - $form->compactData($data); } - } else { - $form->restoreData($data); } - - return $this; + $data = $form->restoreData($data); + foreach($data as $key => $value) { + if(!is_null($value)){ + unset($data[$key]); + } + } + return $this->_customerBuilder->mergeDtoWithArray($customerDto, $data); } /** - * Prepare quote customer + * Prepare customer data for order creation. + * + * Create customer if not created using data from customer form. + * Create customer billing/shipping address if necessary using data from customer address forms. + * Set customer data to quote. * * @return \Magento\Sales\Model\AdminOrder\Create */ public function _prepareCustomer() { - /** @var $quote \Magento\Sales\Model\Quote */ - $quote = $this->getQuote(); - if ($quote->getCustomerIsGuest()) { + if ($this->getQuote()->getCustomerIsGuest()) { return $this; } - - /** @var $customer \Magento\Customer\Model\Customer */ - $customer = $this->getSession()->getCustomer(); /** @var $store \Magento\Core\Model\Store */ $store = $this->getSession()->getStore(); + $customerDto = $this->getQuote()->getCustomerData(); + if ($customerDto->getCustomerId() && !$this->_customerIsInStore($store)) { + /** Create a new customer record if it is not available in the specified store */ + $customerDto = $this->_customerBuilder->mergeDtoWithArray( + $customerDto, + /** Unset customer ID to ensure that new customer will be created */ + [CustomerDto::STORE_ID => $store->getId(), CustomerDto::ID => null, CustomerDto::CREATED_AT => null] + ); + $customerDto = $this->_validateCustomerData($customerDto); + } else if (!$customerDto->getCustomerId()) { + /** Create new customer */ + $customerBillingAddressDto = $this->getBillingAddress()->exportCustomerAddressData(); + $customerDto = $this->_customerBuilder->mergeDtos($customerDto, $customerBillingAddressDto); + $customerDto = $this->_customerBuilder->mergeDtoWithArray( + $customerDto, + [CustomerDto::STORE_ID => $store->getId(), CustomerDto::EMAIL => $this->_getNewCustomerEmail()] + ); + $customerDto = $this->_validateCustomerData($customerDto); + } + if ($this->getBillingAddress()->getSaveInAddressBook()) { + $this->_prepareCustomerAddress($customerDto, $this->getBillingAddress()); + } + if (!$this->getQuote()->isVirtual() && $this->getShippingAddress()->getSaveInAddressBook()) { + $this->_prepareCustomerAddress($customerDto, $this->getShippingAddress()); + } + $this->getQuote()->updateCustomerData($customerDto); - $customerIsInStore = $this->_customerIsInStore($store); - $customerBillingAddress = null; - $customerShippingAddress = null; - - if ($customer->getId()) { - // Create new customer if customer is not registered in specified store - if (!$customerIsInStore) { - $customer->setId(null) - ->setStore($store) - ->setDefaultBilling(null) - ->setDefaultShipping(null) - ->setPassword($customer->generatePassword()); - $this->_setCustomerData($customer); - } - - if ($this->getBillingAddress()->getSaveInAddressBook()) { - /** @var $customerBillingAddress \Magento\Customer\Model\Address */ - $customerBillingAddress = $this->getBillingAddress()->exportCustomerAddress(); - $customerAddressId = $this->getBillingAddress()->getCustomerAddressId(); - if ($customerAddressId && $customer->getId()) { - $customer->getAddressItemById($customerAddressId)->addData($customerBillingAddress->getData()); - } else { - $customer->addAddress($customerBillingAddress); - } - } - - if (!$this->getQuote()->isVirtual() && $this->getShippingAddress()->getSaveInAddressBook()) { - /** @var $customerShippingAddress \Magento\Customer\Model\Address */ - $customerShippingAddress = $this->getShippingAddress()->exportCustomerAddress(); - $customerAddressId = $this->getShippingAddress()->getCustomerAddressId(); - if ($customerAddressId && $customer->getId()) { - $customer->getAddressItemById($customerAddressId)->addData($customerShippingAddress->getData()); - } elseif (!empty($customerAddressId) - && $customerBillingAddress !== null - && $this->getBillingAddress()->getCustomerAddressId() == $customerAddressId - ) { - $customerBillingAddress->setIsDefaultShipping(true); - } else { - $customer->addAddress($customerShippingAddress); - } - } - - if (is_null($customer->getDefaultBilling()) && $customerBillingAddress) { - $customerBillingAddress->setIsDefaultBilling(true); + foreach ($this->_createCustomerForm($customerDto)->getUserAttributes() as $attribute) { + if (!is_null($customerDto->getAttribute($attribute->getAttributeCode()))) { + $quoteCode = sprintf('customer_%s', $attribute->getAttributeCode()); + $this->getQuote()->setData($quoteCode, $customerDto->getAttribute($attribute->getAttributeCode())); } + } + return $this; + } - if (is_null($customer->getDefaultShipping())) { - if ($this->getShippingAddress()->getSameAsBilling() && $customerBillingAddress) { - $customerBillingAddress->setIsDefaultShipping(true); - } elseif ($customerShippingAddress) { - $customerShippingAddress->setIsDefaultShipping(true); - } - } - } else { - // Prepare new customer - /** @var $customerBillingAddress \Magento\Customer\Model\Address */ - $customerBillingAddress = $this->getBillingAddress()->exportCustomerAddress(); - $customer->addData($customerBillingAddress->getData()) - ->setPassword($customer->generatePassword()) - ->setStore($store); - $customer->setEmail($this->_getNewCustomerEmail($customer)); - $this->_setCustomerData($customer); - - if ($this->getBillingAddress()->getSaveInAddressBook()) { - $customerBillingAddress->setIsDefaultBilling(true); - $customer->addAddress($customerBillingAddress); + /** + * Create customerAddressDto and save it in the Model\Quote so that it can be used to persist later. + * + * @param CustomerDto $customerDto + * @param \Magento\Sales\Model\Quote\Address $quoteCustomerAddress + * @throws \InvalidArgumentException + */ + protected function _prepareCustomerAddress($customerDto, $quoteCustomerAddress) + { + // Possible that customerId is null for new customers + $customerId = $customerDto->getCustomerId(); + $quoteCustomerAddress->setCustomerId($customerId); + $customerAddressDto = $quoteCustomerAddress->exportCustomerAddressData(); + $quoteAddressId = $quoteCustomerAddress->getCustomerAddressId(); + $addressType = $quoteCustomerAddress->getAddressType(); + if ($quoteAddressId) { + /** Update existing address */ + $existingAddressDto = $this->_customerAddressService->getAddressById($quoteAddressId); + /** Update customer address data */ + $customerAddressDto = $this->_customerAddressBuilder->mergeDtos($existingAddressDto, $customerAddressDto); + } else if ($addressType == CustomerAddressDto::ADDRESS_TYPE_SHIPPING ) { + try { + $billingAddressDto = $this->_customerAddressService->getDefaultBillingAddress($customerId); + } catch (\Exception $e) { + /** Billing address does not exist. */ } - - /** @var $shippingAddress \Magento\Sales\Model\Quote\Address */ - $shippingAddress = $this->getShippingAddress(); - if (!$this->getQuote()->isVirtual() - && !$shippingAddress->getSameAsBilling() - && $shippingAddress->getSaveInAddressBook() - ) { - /** @var $customerShippingAddress \Magento\Customer\Model\Address */ - $customerShippingAddress = $shippingAddress->exportCustomerAddress(); - $customerShippingAddress->setIsDefaultShipping(true); - $customer->addAddress($customerShippingAddress); - } else { - $customerBillingAddress->setIsDefaultShipping(true); + $isShippingAsBilling = $quoteCustomerAddress->getSameAsBilling(); + if (isset($billingAddressDto) && $isShippingAsBilling) { + /** Set existing billing address as default shipping */ + $customerAddressDto = $this->_customerAddressBuilder->mergeDtoWithArray( + $billingAddressDto, + [CustomerAddressDto::KEY_DEFAULT_SHIPPING => true] + ); } } - // Set quote customer data to customer - $this->_setCustomerData($customer); - - // Set customer to quote and convert customer data to quote - $quote->setCustomer($customer); - - // Add user defined attributes to quote - $form = $this->_getCustomerForm()->setEntity($customer); - foreach ($form->getUserAttributes() as $attribute) { - $quoteCode = sprintf('customer_%s', $attribute->getAttributeCode()); - $quote->setData($quoteCode, $customer->getData($attribute->getAttributeCode())); - } - - if ($customer->getId()) { - // Restore account data for existing customer - $this->_getCustomerForm() - ->setEntity($customer) - ->resetEntityData(); - } else { - $quote->setCustomerId(true); + switch ($addressType) { + case CustomerAddressDto::ADDRESS_TYPE_BILLING: + if (is_null($customerDto->getDefaultBilling())) { + $customerAddressDto = $this->_customerAddressBuilder->mergeDtoWithArray( + $customerAddressDto, + [CustomerAddressDto::KEY_DEFAULT_BILLING => true] + ); + } + break; + case CustomerAddressDto::ADDRESS_TYPE_SHIPPING: + if (is_null($customerDto->getDefaultShipping())) { + $customerAddressDto = $this->_customerAddressBuilder->mergeDtoWithArray( + $customerAddressDto, + [CustomerAddressDto::KEY_DEFAULT_SHIPPING => true] + ); + } + break; + default: + throw new \InvalidArgumentException('Customer address type is invalid.'); } - - return $this; + $this->getQuote()->addCustomerAddressData($customerAddressDto); } /** @@ -1579,22 +1691,13 @@ public function createOrder() $service->setOrderData($orderData); } - $order = $service->submitOrder(); - if ((!$quote->getCustomer()->getId() || !$quote->getCustomer()->isInStore($this->getSession()->getStore())) - && !$quote->getCustomerIsGuest() - ) { - $quote->getCustomer()->setCreatedAt($order->getCreatedAt()); - $quote->getCustomer() - ->save() - ->sendNewAccountEmail('registered', '', $quote->getStoreId());; - } + $order = $service->submitOrderWithDto(); + if ($this->getSession()->getOrder()->getId()) { $oldOrder = $this->getSession()->getOrder(); - - $this->getSession()->getOrder()->setRelationChildId($order->getId()); - $this->getSession()->getOrder()->setRelationChildRealId($order->getIncrementId()); - $this->getSession()->getOrder()->cancel() - ->save(); + $oldOrder->setRelationChildId($order->getId()); + $oldOrder->setRelationChildRealId($order->getIncrementId()); + $oldOrder->cancel()->save(); $order->save(); } if ($this->getSendConfirmation()) { @@ -1610,6 +1713,7 @@ public function createOrder() * Validate quote data before order creation * * @return \Magento\Sales\Model\AdminOrder\Create + * @throws \Magento\Core\Exception */ protected function _validate() { @@ -1658,7 +1762,6 @@ protected function _validate() } } } - if (!empty($this->_errors)) { foreach ($this->_errors as $error) { $this->messageManager->addError($error); @@ -1669,19 +1772,16 @@ protected function _validate() } /** - * Retrieve new customer email + * Retrieve or generate new customer email. * - * @param \Magento\Customer\Model\Customer $customer - * @return string + * @return string */ - protected function _getNewCustomerEmail($customer) + protected function _getNewCustomerEmail() { $email = $this->getData('account/email'); if (empty($email)) { - $host = $this->getSession() - ->getStore() - ->getConfig(\Magento\Customer\Model\Customer::XML_PATH_DEFAULT_EMAIL_DOMAIN); - $account = $customer->getIncrementId() ? $customer->getIncrementId() : time(); + $host = $this->getSession()->getStore()->getConfig(self::XML_PATH_DEFAULT_EMAIL_DOMAIN); + $account = time(); $email = $account.'@'. $host; $account = $this->getData('account'); $account['email'] = $email; diff --git a/app/code/Magento/Sales/Model/AdminOrder/Random.php b/app/code/Magento/Sales/Model/AdminOrder/Random.php deleted file mode 100644 index 3f159384389e0..0000000000000 --- a/app/code/Magento/Sales/Model/AdminOrder/Random.php +++ /dev/null @@ -1,216 +0,0 @@ - - * - */ -namespace Magento\Sales\Model\AdminOrder; - -/** - * @SuppressWarnings(PHPMD.LongVariable) - */ -class Random -{ - /** - * Quote model object - * - * @var \Magento\Sales\Model\Quote - */ - protected $_quote; - - /** - * Order model object - * - * @var \Magento\Sales\Model\Order - */ - protected $_order; - protected $_store; - protected $_customer; - protected $_productCollection; - - protected static $_storeCollection; - protected static $_customerCollection; - - /** - * @var \Magento\Core\Model\Resource\Store\CollectionFactory - */ - protected $_storeCollectionFactory; - - /** - * @var \Magento\Customer\Model\Resource\Customer\CollectionFactory - */ - protected $_customerCollectionFactory; - - /** - * @var \Magento\Catalog\Model\Resource\Product\CollectionFactory - */ - protected $_productCollectionFactory; - - /** - * @var \Magento\Catalog\Model\Product\Visibility - */ - protected $_productVisibility; - - /** - * @param \Magento\Catalog\Model\Product\Visibility $productVisibility - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory - * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerCollectionFactory - * @param \Magento\Core\Model\Resource\Store\CollectionFactory $storeCollectionFactory - * @param \Magento\Sales\Model\QuoteFactory $quoteFactory - * @param \Magento\Sales\Model\OrderFactory $orderFactory - */ - public function __construct( - \Magento\Catalog\Model\Product\Visibility $productVisibility, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, - \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerCollectionFactory, - \Magento\Core\Model\Resource\Store\CollectionFactory $storeCollectionFactory, - \Magento\Sales\Model\QuoteFactory $quoteFactory, - \Magento\Sales\Model\OrderFactory $orderFactory - ) { - $this->_productVisibility = $productVisibility; - $this->_productCollectionFactory = $productCollectionFactory; - $this->_customerCollectionFactory = $customerCollectionFactory; - $this->_storeCollectionFactory = $storeCollectionFactory; - $this->_quote = $quoteFactory->create()->save(); - $this->_order = $orderFactory->create(); - } - - protected function _getStores() - { - if (!self::$_storeCollection) { - self::$_storeCollection = $this->_storeCollectionFactory->create() - ->load(); - } - return self::$_storeCollection->getItems(); - } - - protected function _getCustomers() - { - if (!self::$_customerCollection) { - self::$_customerCollection = $this->_customerCollectionFactory->create() - ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'inner') - ->joinAttribute('shipping_country_id', 'customer_address/country_id', 'default_shipping', null, 'inner') - ->load(); - } - return self::$_customerCollection->getItems(); - } - - protected function _getProducts() - { - if (!$this->_productCollection) { - $this->_productCollection= $this->_productCollectionFactory->create(); - //$this->_productCollection->getEntity()->setStore($this->_getStore()); - $this->_productCollection->addAttributeToSelect('name') - ->addAttributeToSelect('sku') - ->addAttributeToFilter('type_id', \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) - ->setVisibility($this->_productVisibility->getVisibleInSearchIds()) - ->load(); - } - return $this->_productCollection->getItems(); - } - - /** - * Retrieve customer model - * - * @return \Magento\Customer\Model\Customer - */ - protected function _getCustomer() - { - if (!$this->_customer) { - $items = $this->_getCustomers(); - $randKey = array_rand($items); - $this->_customer = $items[$randKey]; - } - return $this->_customer; - } - - protected function _getRandomProduct() - { - $items = $this->_getProducts(); - $randKey = array_rand($items); - return isset($items[$randKey]) ? $items[$randKey] : false; - } - - protected function _getStore() - { - if (!$this->_store) { - $items = $this->_getStores(); - $randKey = array_rand($items); - $this->_store = $items[$randKey]; - } - return $this->_store; - } - - public function render() - { - $customer = $this->_getCustomer(); - $this->_quote->setStore($this->_getStore()) - ->setCustomer($customer); - $this->_quote->getBillingAddress()->importCustomerAddress($customer->getDefaultBillingAddress()); - $this->_quote->getShippingAddress()->importCustomerAddress($customer->getDefaultShippingAddress()); - - $productCount = rand(3, 10); - for ($i=0; $i<$productCount; $i++){ - $product = $this->_getRandomProduct(); - if ($product) { - $product->setQuoteQty(1); - $this->_quote->addCatalogProduct($product); - } - } - $this->_quote->getPayment()->setMethod('checkmo'); - - $this->_quote->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');//->collectTotals()->save(); - $this->_quote->getShippingAddress()->setCollectShippingRates(true); - $this->_quote->collectTotals() - ->save(); - $this->_quote->save(); - return $this; - } - - protected function _getRandomDate() - { - $timestamp = mktime(rand(0,23), rand(0,59), 0, rand(1,11), rand(1,28), rand(2006, 2007)); - return date('Y-m-d H:i:s', $timestamp); - } - - public function save() - { - $this->_order->setStoreId($this->_getStore()->getId()); - $this->_order->createFromQuoteAddress($this->_quote->getShippingAddress()); - $this->_order->validate(); - $this->_order->setInitialStatus(); - $this->_order->save(); - $this->_order->setCreatedAt($this->_getRandomDate()); - $this->_order->save(); - - $this->_quote->setIsActive(false); - $this->_quote->save(); - return $this; - } -} diff --git a/app/code/Magento/Sales/Model/Config/Source/Order/Status.php b/app/code/Magento/Sales/Model/Config/Source/Order/Status.php index 937c5e339bba1..78c5537a80f00 100644 --- a/app/code/Magento/Sales/Model/Config/Source/Order/Status.php +++ b/app/code/Magento/Sales/Model/Config/Source/Order/Status.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Model\Config\Source\Order; -class Status implements \Magento\Core\Model\Option\ArrayInterface +class Status implements \Magento\Option\ArrayInterface { // set null to enable all possible /** diff --git a/app/code/Magento/Sales/Model/Download.php b/app/code/Magento/Sales/Model/Download.php new file mode 100644 index 0000000000000..49479d56ffa5d --- /dev/null +++ b/app/code/Magento/Sales/Model/Download.php @@ -0,0 +1,127 @@ +_rootDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->_fileStorageDatabase = $fileStorageDatabase; + $this->_storageDatabaseFactory = $storageDatabaseFactory; + $this->_fileFactory = $fileFactory; + } + + /** + * Custom options downloader + * + * @param array $info + * @throws \Exception + */ + public function downloadFile($info) + { + $relativePath = $info['order_path']; + if ($this->_isCanProcessed($relativePath)) { + //try get file from quote + $relativePath = $info['quote_path']; + if ($this->_isCanProcessed($relativePath)) { + throw new \Exception(); + } + } + + $this->_fileFactory->create( + $info['title'], + [ + 'value' => $this->_rootDir->getRelativePath($relativePath), + 'type' => 'filename', + ], + \Magento\App\Filesystem::ROOT_DIR + ); + } + + /** + * @param string $relativePath + * @return bool + */ + protected function _isCanProcessed($relativePath) + { + $filePath = $this->_rootDir->getAbsolutePath($relativePath); + return (!$this->_rootDir->isFile($relativePath) || !$this->_rootDir->isReadable($relativePath)) + && !$this->_processDatabaseFile($filePath); + } + + /** + * Check file in database storage if needed and place it on file system + * + * @param string $filePath + * @return bool + */ + protected function _processDatabaseFile($filePath) + { + if (!$this->_fileStorageDatabase->checkDbUsage()) { + return false; + } + $relativePath = $this->_fileStorageDatabase->getMediaRelativePath($filePath); + $file = $this->_storageDatabaseFactory->create()->loadByFilename($relativePath); + if (!$file->getId()) { + return false; + } + $stream = $this->_rootDir->openFile($filePath, 'w+'); + $stream->lock(); + $stream->write($filePath, $file->getContent()); + $stream->unlock(); + $stream->close(); + return true; + } +} diff --git a/app/code/Magento/Sales/Model/Observer.php b/app/code/Magento/Sales/Model/Observer.php index d02f977bf3e7d..46274ea58284c 100644 --- a/app/code/Magento/Sales/Model/Observer.php +++ b/app/code/Magento/Sales/Model/Observer.php @@ -316,6 +316,7 @@ public function addVatRequestParamsOrderComment(\Magento\Event\Observer $observe */ protected function _getVatRequiredSalesAddress($salesModel, $store = null) { + /** TODO: References to Magento\Customer\Model\Address will be eliminated in scope of MAGETWO-21105 */ $configAddressType = $this->_customerAddress->getTaxCalculationAddressType($store); $requiredAddress = null; switch ($configAddressType) { @@ -329,28 +330,6 @@ protected function _getVatRequiredSalesAddress($salesModel, $store = null) return $requiredAddress; } - /** - * Retrieve customer address (default billing or default shipping) ID on which tax calculation must be based - * - * @param \Magento\Customer\Model\Customer $customer - * @param \Magento\Core\Model\Store|string|int|null $store - * @return int|string - */ - protected function _getVatRequiredCustomerAddress(\Magento\Customer\Model\Customer $customer, $store = null) - { - $configAddressType = $this->_customerAddress->getTaxCalculationAddressType($store); - $requiredAddress = null; - switch ($configAddressType) { - case \Magento\Customer\Model\Address\AbstractAddress::TYPE_SHIPPING: - $requiredAddress = $customer->getDefaultShipping(); - break; - default: - $requiredAddress = $customer->getDefaultBilling(); - break; - } - return $requiredAddress; - } - /** * Restore initial customer group ID in quote if needed on collect_totals_after event of quote address * @@ -358,6 +337,7 @@ protected function _getVatRequiredCustomerAddress(\Magento\Customer\Model\Custom */ public function restoreQuoteCustomerGroupId($observer) { + /** TODO: References to Magento\Customer\Model\Address will be eliminated in scope of MAGETWO-21105 */ $quoteAddress = $observer->getQuoteAddress(); $configAddressType = $this->_customerAddress->getTaxCalculationAddressType(); // Restore initial customer group ID in quote only if VAT is calculated based on shipping address diff --git a/app/code/Magento/Sales/Model/Observer/Backend/CustomerQuote.php b/app/code/Magento/Sales/Model/Observer/Backend/CustomerQuote.php index 17a5eb10de441..d065da808c572 100644 --- a/app/code/Magento/Sales/Model/Observer/Backend/CustomerQuote.php +++ b/app/code/Magento/Sales/Model/Observer/Backend/CustomerQuote.php @@ -23,6 +23,8 @@ */ namespace Magento\Sales\Model\Observer\Backend; +use Magento\Customer\Service\V1\Dto\Customer as CustomerDto; + class CustomerQuote { /** @@ -36,23 +38,23 @@ class CustomerQuote protected $_storeManager; /** - * @var \Magento\Sales\Model\Quote + * @var \Magento\Sales\Model\QuoteFactory */ - protected $_quote; + protected $_quoteFactory; /** * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Config\Share $config - * @param \Magento\Sales\Model\Quote $quote + * @param \Magento\Sales\Model\QuoteFactory $quoteFactory */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Config\Share $config, - \Magento\Sales\Model\Quote $quote + \Magento\Sales\Model\QuoteFactory $quoteFactory ) { $this->_storeManager = $storeManager; $this->_config = $config; - $this->_quote = $quote; + $this->_quoteFactory = $quoteFactory; } /** @@ -62,27 +64,28 @@ public function __construct( */ public function dispatch(\Magento\Event\Observer $observer) { - /** @var $customer \Magento\Customer\Model\Customer */ - $customer = $observer->getEvent()->getCustomer(); - - if ($customer->getGroupId() !== $customer->getOrigData('group_id')) { + /** @var CustomerDto $customerDto */ + $customerDto = $observer->getEvent()->getCustomerDto(); + /** @var CustomerDto $origCustomerDto */ + $origCustomerDto = $observer->getEvent()->getOrigCustomerDto(); + if ($customerDto->getGroupId() !== $origCustomerDto->getGroupId()) { /** * It is needed to process customer's quotes for all websites * if customer accounts are shared between all of them */ /** @var $websites \Magento\Core\Model\Website[] */ - $websites = $this->_config->isWebsiteScope() ? - array($this->_storeManager->getWebsite($customer->getWebsiteId())) : - $this->_storeManager->getWebsites(); + $websites = $this->_config->isWebsiteScope() + ? array($this->_storeManager->getWebsite($customerDto->getWebsiteId())) + : $this->_storeManager->getWebsites(); foreach ($websites as $website) { - $this->_quote->setWebsite($website); - $this->_quote->loadByCustomer($customer); - - if ($this->_quote->getId()) { - $this->_quote->setCustomerGroupId($customer->getGroupId()); - $this->_quote->collectTotals(); - $this->_quote->save(); + $quote = $this->_quoteFactory->create(); + $quote->setWebsite($website); + $quote->loadByCustomer($customerDto->getCustomerId()); + if ($quote->getId()) { + $quote->setCustomerGroupId($customerDto->getGroupId()); + $quote->collectTotals(); + $quote->save(); } } } diff --git a/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php index 5bfcd759f9cde..d4d2f4e4dc399 100644 --- a/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php +++ b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php @@ -73,6 +73,7 @@ public function dispatch(\Magento\Event\Observer $observer) /** @var \Magento\Sales\Model\Quote $quote */ $quote = $quoteAddress->getQuote(); + /** TODO: References to Magento\Customer\Model\Customer will be eliminated in scope of MAGETWO-19763 */ /** @var \Magento\Customer\Model\Customer $customer */ $customer = $quote->getCustomer(); @@ -90,6 +91,7 @@ public function dispatch(\Magento\Event\Observer $observer) if (empty($customerVatNumber) || false == $this->customerData->isCountryInEU($customerCountryCode)) { $groupId = $customer->getId() ? $this->customerData->getDefaultCustomerGroupId($store) + /** TODO: References to Magento\Customer\Model\Group will be eliminated in scope of MAGETWO-19763 */ : \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID; } else { // Magento always has to emulate group even if customer uses default billing/shipping address diff --git a/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php index 11559758dd051..6fc0fb70ce1e9 100644 --- a/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php +++ b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php @@ -112,6 +112,10 @@ public function isEnabled(\Magento\Sales\Model\Quote\Address $quoteAddress, $sto { $configAddressType = $this->customerAddress->getTaxCalculationAddressType($store); + /** + * TODO: References to Magento\Customer\Model\Address\AbstractAddress will be eliminated + * in scope of MAGETWO-21105 + */ // When VAT is based on billing address then Magento have to handle only billing addresses $additionalBillingAddressCondition = $configAddressType == \Magento\Customer\Model\Address\AbstractAddress::TYPE_BILLING @@ -125,4 +129,4 @@ public function isEnabled(\Magento\Sales\Model\Quote\Address $quoteAddress, $sto return true; } -} +} diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index c22fe82760ba6..e26a15effe580 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -437,14 +437,9 @@ class Order extends \Magento\Sales\Model\AbstractModel protected $_productFactory; /** - * @var \Magento\Email\Model\Template\MailerFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateMailerFactory; - - /** - * @var \Magento\Email\Model\InfoFactory - */ - protected $_emailInfoFactory; + protected $_transportBuilder; /** * @var \Magento\Sales\Model\Resource\Order\Item\CollectionFactory @@ -522,8 +517,8 @@ class Order extends \Magento\Sales\Model\AbstractModel protected $_trackCollectionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData @@ -532,8 +527,7 @@ class Order extends \Magento\Sales\Model\AbstractModel * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param Order\Config $orderConfig * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory - * @param \Magento\Email\Model\InfoFactory $emailInfoFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param Resource\Order\Item\CollectionFactory $orderItemCollectionFactory * @param \Magento\Catalog\Model\Product\Visibility $productVisibility * @param \Magento\Tax\Model\Calculation $taxCalculation @@ -554,8 +548,8 @@ class Order extends \Magento\Sales\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, @@ -564,8 +558,7 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Email\Model\Template\MailerFactory $templateMailerFactory, - \Magento\Email\Model\InfoFactory $emailInfoFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Sales\Model\Resource\Order\Item\CollectionFactory $orderItemCollectionFactory, \Magento\Catalog\Model\Product\Visibility $productVisibility, \Magento\Tax\Model\Calculation $taxCalculation, @@ -591,8 +584,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_orderConfig = $orderConfig; $this->_productFactory = $productFactory; - $this->_templateMailerFactory = $templateMailerFactory; - $this->_emailInfoFactory = $emailInfoFactory; + $this->_transportBuilder = $transportBuilder; $this->_orderItemCollectionFactory = $orderItemCollectionFactory; $this->_productVisibility = $productVisibility; $this->_taxCalculation = $taxCalculation; @@ -1449,38 +1441,52 @@ public function sendNewOrderEmail() $customerName = $this->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($this->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $this, + 'billing' => $this->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($this->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); // Email copies are sent as separated emails if their copy method is 'copy' if ($copyTo && $copyMethod == 'copy') { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $this, + 'billing' => $this->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $this, - 'billing' => $this->getBillingAddress(), - 'payment_html' => $paymentBlockHtml - ) - ); - $mailer->send(); - $this->setEmailSent(true); $this->_getResource()->saveAttribute($this, 'email_sent'); @@ -1518,41 +1524,55 @@ public function sendOrderUpdateEmail($notifyCustomer = true, $comment = '') $customerName = $this->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($this->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $this, + 'comment' => $comment, + 'billing' => $this->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($this->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is // 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $this, + 'comment' => $comment, + 'billing' => $this->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $this, - 'comment' => $comment, - 'billing' => $this->getBillingAddress() - ) - ); - $mailer->send(); - return $this; } @@ -2268,7 +2288,9 @@ protected function _beforeSave() // Set items count $this->setTotalItemCount($itemsCount); } - if ($this->getCustomer()) { + /** TODO refactor getCustomer usage after MAGETWO-20182 and MAGETWO-20258 are done */ + $isNewCustomer = !$this->getCustomerId() || ($this->getCustomerId() === true); + if ($isNewCustomer && $this->getCustomer()) { $this->setCustomerId($this->getCustomer()->getId()); } diff --git a/app/code/Magento/Sales/Model/Order/Address.php b/app/code/Magento/Sales/Model/Order/Address.php index db251924fbe4e..f8b4e39b2e974 100644 --- a/app/code/Magento/Sales/Model/Order/Address.php +++ b/app/code/Magento/Sales/Model/Order/Address.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\Order; + /** * Sales order address model * @@ -33,6 +35,10 @@ * @method \Magento\Sales\Model\Order\Address setParentId(int $value) * @method int getCustomerAddressId() * @method \Magento\Sales\Model\Order\Address setCustomerAddressId(int $value) + * @method \Magento\Customer\Model\Address getCustomerAddress() + * @method \Magento\Sales\Model\Order\Address setCustomerAddress(\Magento\Customer\Model\Address $value) + * @method \Magento\Customer\Service\V1\Dto\Address getCustomerAddressData() + * @method \Magento\Sales\Model\Order\Address setCustomerAddressData(\Magento\Customer\Service\V1\Dto\Address $value) * @method int getQuoteAddressId() * @method \Magento\Sales\Model\Order\Address setQuoteAddressId(int $value) * @method \Magento\Sales\Model\Order\Address setRegionId(int $value) @@ -66,8 +72,6 @@ * @method string getCompany() * @method \Magento\Sales\Model\Order\Address setCompany(string $value) */ -namespace Magento\Sales\Model\Order; - class Address extends \Magento\Customer\Model\Address\AbstractAddress { /** @@ -91,8 +95,8 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_orderFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig @@ -104,8 +108,8 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, @@ -180,6 +184,8 @@ protected function _beforeSave() // Init customer address id if customer address is assigned if ($this->getCustomerAddress()) { $this->setCustomerAddressId($this->getCustomerAddress()->getId()); + } else if ($this->getCustomerAddressData()) { + $this->setCustomerAddressId($this->getCustomerAddressData()->getId()); } return $this; diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index f36e6c94b5af4..760e63c9f186d 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -202,7 +202,7 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel protected $_cmItemCollectionFactory; /** - * @var \Magento\Core\Model\CalculatorFactory + * @var \Magento\Math\CalculatorFactory */ protected $_calculatorFactory; @@ -222,18 +222,13 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel protected $_commentCollectionFactory; /** - * @var \Magento\Email\Model\Template\MailerFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateMailerFactory; + protected $_transportBuilder; /** - * @var \Magento\Email\Model\InfoFactory - */ - protected $_emailInfoFactory; - - /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData @@ -242,19 +237,18 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel * @param \Magento\Sales\Model\Order\Creditmemo\Config $creditmemoConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory $cmItemCollectionFactory - * @param \Magento\Core\Model\CalculatorFactory $calculatorFactory + * @param \Magento\Math\CalculatorFactory $calculatorFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\Order\Creditmemo\CommentFactory $commentFactory * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Comment\CollectionFactory $commentCollectionFactory - * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory - * @param \Magento\Email\Model\InfoFactory $emailInfoFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, @@ -263,12 +257,11 @@ public function __construct( \Magento\Sales\Model\Order\Creditmemo\Config $creditmemoConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory $cmItemCollectionFactory, - \Magento\Core\Model\CalculatorFactory $calculatorFactory, + \Magento\Math\CalculatorFactory $calculatorFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Order\Creditmemo\CommentFactory $commentFactory, \Magento\Sales\Model\Resource\Order\Creditmemo\Comment\CollectionFactory $commentCollectionFactory, - \Magento\Email\Model\Template\MailerFactory $templateMailerFactory, - \Magento\Email\Model\InfoFactory $emailInfoFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -283,8 +276,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_commentFactory = $commentFactory; $this->_commentCollectionFactory = $commentCollectionFactory; - $this->_templateMailerFactory = $templateMailerFactory; - $this->_emailInfoFactory = $emailInfoFactory; + $this->_transportBuilder = $transportBuilder; parent::__construct($context, $registry, $coreLocale, $dateTime, $resource, $resourceCollection, $data); } @@ -453,7 +445,7 @@ public function roundPrice($price, $type = 'regular', $negative = false) { if ($price) { if (!isset($this->_calculators[$type])) { - $this->_calculators[$type] = $this->_calculatorFactory->create(array('store' => $this->getStore())); + $this->_calculators[$type] = $this->_calculatorFactory->create(array('scope' => $this->getStore())); } $price = $this->_calculators[$type]->deltaRound($price, $negative); } @@ -858,42 +850,58 @@ public function sendEmail($notifyCustomer = true, $comment = '') $customerName = $order->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($order->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'invoice' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($order->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'invoice' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $order, - 'creditmemo' => $this, - 'comment' => $comment, - 'billing' => $order->getBillingAddress(), - 'payment_html' => $paymentBlockHtml - ) - ); - $mailer->send(); - $this->setEmailSent(true); $this->_getResource()->saveAttribute($this, 'email_sent'); @@ -932,40 +940,57 @@ public function sendUpdateEmail($notifyCustomer = true, $comment = '') $customerName = $order->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($order->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'creditmemo' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($order->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + ) + ) + ->setTemplateVars(array( + 'order' => $order, + 'creditmemo' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $order, - 'creditmemo' => $this, - 'comment' => $comment, - 'billing' => $order->getBillingAddress() - )); - $mailer->send(); - return $this; } diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Comment.php index d08c4d1683200..e2cb433ace79b 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Comment.php @@ -55,8 +55,8 @@ class Comment extends \Magento\Sales\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -65,8 +65,8 @@ class Comment extends \Magento\Sales\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Item.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Item.php index 05c85f1695d36..ec0c89d401bc0 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Item.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Item.php @@ -106,16 +106,16 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_orderItemFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Order\ItemFactory $orderItemFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Sales\Model\Order\ItemFactory $orderItemFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index d16d3a411e8cf..dfe122079f100 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -208,7 +208,7 @@ class Invoice extends \Magento\Sales\Model\AbstractModel protected $_orderResourceFactory; /** - * @var \Magento\Core\Model\CalculatorFactory + * @var \Magento\Math\CalculatorFactory */ protected $_calculatorFactory; @@ -228,18 +228,13 @@ class Invoice extends \Magento\Sales\Model\AbstractModel protected $_commentCollectionFactory; /** - * @var \Magento\Email\Model\Template\MailerFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateMailerFactory; + protected $_transportBuilder; /** - * @var \Magento\Email\Model\InfoFactory - */ - protected $_emailInfoFactory; - - /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData @@ -248,19 +243,18 @@ class Invoice extends \Magento\Sales\Model\AbstractModel * @param \Magento\Sales\Model\Order\Invoice\Config $invoiceConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\OrderFactory $orderResourceFactory - * @param \Magento\Core\Model\CalculatorFactory $calculatorFactory + * @param \Magento\Math\CalculatorFactory $calculatorFactory * @param \Magento\Sales\Model\Resource\Order\Invoice\Item\CollectionFactory $invoiceItemCollectionFactory * @param \Magento\Sales\Model\Order\Invoice\CommentFactory $invoiceCommentFactory * @param \Magento\Sales\Model\Resource\Order\Invoice\Comment\CollectionFactory $commentCollectionFactory - * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory - * @param \Magento\Email\Model\InfoFactory $emailInfoFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, @@ -269,12 +263,11 @@ public function __construct( \Magento\Sales\Model\Order\Invoice\Config $invoiceConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\OrderFactory $orderResourceFactory, - \Magento\Core\Model\CalculatorFactory $calculatorFactory, + \Magento\Math\CalculatorFactory $calculatorFactory, \Magento\Sales\Model\Resource\Order\Invoice\Item\CollectionFactory $invoiceItemCollectionFactory, \Magento\Sales\Model\Order\Invoice\CommentFactory $invoiceCommentFactory, \Magento\Sales\Model\Resource\Order\Invoice\Comment\CollectionFactory $commentCollectionFactory, - \Magento\Email\Model\Template\MailerFactory $templateMailerFactory, - \Magento\Email\Model\InfoFactory $emailInfoFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -289,8 +282,7 @@ public function __construct( $this->_invoiceItemCollectionFactory = $invoiceItemCollectionFactory; $this->_invoiceCommentFactory = $invoiceCommentFactory; $this->_commentCollectionFactory = $commentCollectionFactory; - $this->_templateMailerFactory = $templateMailerFactory; - $this->_emailInfoFactory = $emailInfoFactory; + $this->_transportBuilder = $transportBuilder; parent::__construct($context, $registry, $coreLocale, $dateTime, $resource, $resourceCollection, $data); } @@ -600,7 +592,7 @@ public function roundPrice($price, $type = 'regular', $negative = false) { if ($price) { if (!isset($this->_rounders[$type])) { - $this->_rounders[$type] = $this->_calculatorFactory->create(array('store' => $this->getStore())); + $this->_rounders[$type] = $this->_calculatorFactory->create(array('scope' => $this->getStore())); } $price = $this->_rounders[$type]->deltaRound($price, $negative); } @@ -885,41 +877,58 @@ public function sendEmail($notifyCustomer = true, $comment = '') $customerName = $order->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($order->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'invoice' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($order->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'invoice' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $order, - 'invoice' => $this, - 'comment' => $comment, - 'billing' => $order->getBillingAddress(), - 'payment_html' => $paymentBlockHtml - )); - $mailer->send(); - $this->setEmailSent(true); $this->_getResource()->saveAttribute($this, 'email_sent'); @@ -958,41 +967,58 @@ public function sendUpdateEmail($notifyCustomer = true, $comment = '') $customerName = $order->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($order->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'invoice' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($order->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + ) + ) + ->setTemplateVars(array( + 'order' => $order, + 'invoice' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'store' => $this->getStore() + ) + ) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $order, - 'invoice' => $this, - 'comment' => $comment, - 'billing' => $order->getBillingAddress() - ) - ); - $mailer->send(); - return $this; } diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Comment.php b/app/code/Magento/Sales/Model/Order/Invoice/Comment.php index 50a5157a6be72..6462880875053 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Comment.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Comment.php @@ -55,8 +55,8 @@ class Comment extends \Magento\Sales\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -65,8 +65,8 @@ class Comment extends \Magento\Sales\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Item.php b/app/code/Magento/Sales/Model/Order/Invoice/Item.php index 65978f2f28928..30d3e4124d609 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Item.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Item.php @@ -107,16 +107,16 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_orderItemFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Order\ItemFactory $orderItemFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Sales\Model\Order\ItemFactory $orderItemFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Sales/Model/Order/Item.php b/app/code/Magento/Sales/Model/Order/Item.php index 3268e7fe886e5..95495281070a5 100644 --- a/app/code/Magento/Sales/Model/Order/Item.php +++ b/app/code/Magento/Sales/Model/Order/Item.php @@ -229,8 +229,8 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_productFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -238,8 +238,8 @@ class Item extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index 35685edb6518f..8db6ead2fe1c8 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -198,8 +198,8 @@ class Payment extends \Magento\Payment\Model\Info protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Sales\Model\Service\OrderFactory $serviceOrderFactory @@ -211,8 +211,8 @@ class Payment extends \Magento\Payment\Model\Info * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Payment\Helper\Data $paymentData, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Sales\Model\Service\OrderFactory $serviceOrderFactory, diff --git a/app/code/Magento/Sales/Model/Order/Payment/Transaction.php b/app/code/Magento/Sales/Model/Order/Payment/Transaction.php index fa482f8a0539f..1b06c6758f810 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Transaction.php @@ -161,8 +161,8 @@ class Transaction extends \Magento\Core\Model\AbstractModel protected $_dateFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Order\PaymentFactory $paymentFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Core\Model\DateFactory $dateFactory @@ -171,8 +171,8 @@ class Transaction extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Sales\Model\Order\PaymentFactory $paymentFactory, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Core\Model\DateFactory $dateFactory, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php index 52700c71af862..568e29ba47a5b 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php @@ -84,8 +84,8 @@ abstract class AbstractItems extends \Magento\Core\Model\AbstractModel protected $filterManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem , * @param \Magento\Filter\FilterManager $filterManager @@ -94,8 +94,8 @@ abstract class AbstractItems extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index e66e3689e6ef5..db590a5c9b3d7 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -39,8 +39,8 @@ class DefaultCreditmemo extends \Magento\Sales\Model\Order\Pdf\Items\AbstractIte protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -50,8 +50,8 @@ class DefaultCreditmemo extends \Magento\Sales\Model\Order\Pdf\Items\AbstractIte * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index ea9e408dc51bc..441900cabc05b 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -34,13 +34,13 @@ class DefaultInvoice extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems /** * Core string * - * @var \Magento\Core\Helper\String + * @var \Magento\Stdlib\String */ protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -50,8 +50,8 @@ class DefaultInvoice extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php index b51d13f24fcb5..08eb72a9e682d 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php @@ -39,8 +39,8 @@ class DefaultShipment extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager @@ -50,8 +50,8 @@ class DefaultShipment extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Sales/Model/Order/Shipment.php b/app/code/Magento/Sales/Model/Order/Shipment.php index 13b39a63e2d49..e85d02519d495 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Order/Shipment.php @@ -147,18 +147,13 @@ class Shipment extends \Magento\Sales\Model\AbstractModel protected $_commentCollectionFactory; /** - * @var \Magento\Email\Model\Template\MailerFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateMailerFactory; + protected $_transportBuilder; /** - * @var \Magento\Email\Model\InfoFactory - */ - protected $_emailInfoFactory; - - /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData @@ -169,15 +164,14 @@ class Shipment extends \Magento\Sales\Model\AbstractModel * @param \Magento\Sales\Model\Resource\Order\Shipment\Track\CollectionFactory $trackCollectionFactory * @param \Magento\Sales\Model\Order\Shipment\CommentFactory $commentFactory * @param \Magento\Sales\Model\Resource\Order\Shipment\Comment\CollectionFactory $commentCollectionFactory - * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory - * @param \Magento\Email\Model\InfoFactory $emailInfoFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, @@ -188,8 +182,7 @@ public function __construct( \Magento\Sales\Model\Resource\Order\Shipment\Track\CollectionFactory $trackCollectionFactory, \Magento\Sales\Model\Order\Shipment\CommentFactory $commentFactory, \Magento\Sales\Model\Resource\Order\Shipment\Comment\CollectionFactory $commentCollectionFactory, - \Magento\Email\Model\Template\MailerFactory $templateMailerFactory, - \Magento\Email\Model\InfoFactory $emailInfoFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -202,8 +195,7 @@ public function __construct( $this->_trackCollectionFactory = $trackCollectionFactory; $this->_commentFactory = $commentFactory; $this->_commentCollectionFactory = $commentCollectionFactory; - $this->_templateMailerFactory = $templateMailerFactory; - $this->_emailInfoFactory = $emailInfoFactory; + $this->_transportBuilder = $transportBuilder; parent::__construct($context, $registry, $coreLocale, $dateTime, $resource, $resourceCollection, $data); } @@ -540,43 +532,58 @@ public function sendEmail($notifyCustomer = true, $comment = '') $customerName = $order->getCustomerName(); } - /** @var $mailer \Magento\Email\Model\Template\Mailer */ - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($order->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'shipment' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($order->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'shipment' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'payment_html' => $paymentBlockHtml, + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $order, - 'shipment' => $this, - 'comment' => $comment, - 'billing' => $order->getBillingAddress(), - 'payment_html' => $paymentBlockHtml - ) - ); - $mailer->send(); - $this->setEmailSent(true); $this->_getResource()->saveAttribute($this, 'email_sent'); @@ -615,41 +622,56 @@ public function sendUpdateEmail($notifyCustomer = true, $comment = '') $customerName = $order->getCustomerName(); } - $mailer = $this->_templateMailerFactory->create(); if ($notifyCustomer) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($order->getCustomerEmail(), $customerName); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'shipment' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($order->getCustomerEmail(), $customerName); if ($copyTo && $copyMethod == 'bcc') { // Add bcc to customer email foreach ($copyTo as $email) { - $emailInfo->addBcc($email); + $this->_transportBuilder->addBcc($email); } } - $mailer->addEmailInfo($emailInfo); + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } // Email copies are sent as separated emails if their copy method is 'copy' or a customer should not be notified if ($copyTo && ($copyMethod == 'copy' || !$notifyCustomer)) { foreach ($copyTo as $email) { - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($email); - $mailer->addEmailInfo($emailInfo); + $this->_transportBuilder + ->setTemplateIdentifier($templateId) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $storeId + )) + ->setTemplateVars(array( + 'order' => $order, + 'shipment' => $this, + 'comment' => $comment, + 'billing' => $order->getBillingAddress(), + 'store' => $this->getStore() + )) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)) + ->addTo($email) + ->getTransport() + ->sendMessage(); } } - // Set all required params and send emails - $mailer->setSender($this->_coreStoreConfig->getConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $storeId)); - $mailer->setStoreId($storeId); - $mailer->setTemplateId($templateId); - $mailer->setTemplateParams(array( - 'order' => $order, - 'shipment' => $this, - 'comment' => $comment, - 'billing' => $order->getBillingAddress() - ) - ); - $mailer->send(); - return $this; } diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Comment.php b/app/code/Magento/Sales/Model/Order/Shipment/Comment.php index 9a3ca642a5782..310baef559d57 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Comment.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Comment.php @@ -55,8 +55,8 @@ class Comment extends \Magento\Sales\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -65,8 +65,8 @@ class Comment extends \Magento\Sales\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Item.php b/app/code/Magento/Sales/Model/Order/Shipment/Item.php index 480a0bf1fa5f2..9be2d395b0c7b 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Item.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Item.php @@ -65,16 +65,16 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_orderItemFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Sales\Model\Order\ItemFactory $orderItemFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Sales\Model\Order\ItemFactory $orderItemFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Order/Shipment/Track.php index 9a16ef629bcc2..fc03636c548b4 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Track.php @@ -75,8 +75,8 @@ class Track extends \Magento\Sales\Model\AbstractModel protected $_shipmentFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -86,8 +86,8 @@ class Track extends \Magento\Sales\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sales/Model/Order/Status.php b/app/code/Magento/Sales/Model/Order/Status.php index e349ce87f5817..ab381556aab2f 100644 --- a/app/code/Magento/Sales/Model/Order/Status.php +++ b/app/code/Magento/Sales/Model/Order/Status.php @@ -34,16 +34,16 @@ class Status extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Sales/Model/Order/Status/History.php b/app/code/Magento/Sales/Model/Order/Status/History.php index 51005bc149de1..b595e72ca1a5b 100644 --- a/app/code/Magento/Sales/Model/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Order/Status/History.php @@ -63,8 +63,8 @@ class History extends \Magento\Sales\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -73,8 +73,8 @@ class History extends \Magento\Sales\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index d93d1bca627b6..f7c75f0be7b4d 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -18,12 +18,16 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model; + +use Magento\Sales\Model\Quote\Address; +use Magento\Customer\Service\V1\Dto\Address as AddressDto; +use Magento\Customer\Service\V1\Dto\Customer as CustomerDto; + /** * Quote model * @@ -34,106 +38,102 @@ * sales_quote_delete_before * sales_quote_delete_after * - * @method \Magento\Sales\Model\Resource\Quote _getResource() - * @method \Magento\Sales\Model\Resource\Quote getResource() - * @method \Magento\Sales\Model\Quote setStoreId(int $value) + * @method Quote setStoreId(int $value) * @method string getCreatedAt() - * @method \Magento\Sales\Model\Quote setCreatedAt(string $value) + * @method Quote setCreatedAt(string $value) * @method string getUpdatedAt() - * @method \Magento\Sales\Model\Quote setUpdatedAt(string $value) + * @method Quote setUpdatedAt(string $value) * @method string getConvertedAt() - * @method \Magento\Sales\Model\Quote setConvertedAt(string $value) + * @method Quote setConvertedAt(string $value) * @method int getIsActive() - * @method \Magento\Sales\Model\Quote setIsActive(int $value) - * @method \Magento\Sales\Model\Quote setIsVirtual(int $value) + * @method Quote setIsActive(int $value) + * @method Quote setIsVirtual(int $value) * @method int getIsMultiShipping() - * @method \Magento\Sales\Model\Quote setIsMultiShipping(int $value) + * @method Quote setIsMultiShipping(int $value) * @method int getItemsCount() - * @method \Magento\Sales\Model\Quote setItemsCount(int $value) + * @method Quote setItemsCount(int $value) * @method float getItemsQty() - * @method \Magento\Sales\Model\Quote setItemsQty(float $value) + * @method Quote setItemsQty(float $value) * @method int getOrigOrderId() - * @method \Magento\Sales\Model\Quote setOrigOrderId(int $value) + * @method Quote setOrigOrderId(int $value) * @method float getStoreToBaseRate() - * @method \Magento\Sales\Model\Quote setStoreToBaseRate(float $value) + * @method Quote setStoreToBaseRate(float $value) * @method float getStoreToQuoteRate() - * @method \Magento\Sales\Model\Quote setStoreToQuoteRate(float $value) + * @method Quote setStoreToQuoteRate(float $value) * @method string getBaseCurrencyCode() - * @method \Magento\Sales\Model\Quote setBaseCurrencyCode(string $value) + * @method Quote setBaseCurrencyCode(string $value) * @method string getStoreCurrencyCode() - * @method \Magento\Sales\Model\Quote setStoreCurrencyCode(string $value) + * @method Quote setStoreCurrencyCode(string $value) * @method string getQuoteCurrencyCode() - * @method \Magento\Sales\Model\Quote setQuoteCurrencyCode(string $value) + * @method Quote setQuoteCurrencyCode(string $value) * @method float getGrandTotal() - * @method \Magento\Sales\Model\Quote setGrandTotal(float $value) + * @method Quote setGrandTotal(float $value) * @method float getBaseGrandTotal() - * @method \Magento\Sales\Model\Quote setBaseGrandTotal(float $value) - * @method \Magento\Sales\Model\Quote setCheckoutMethod(string $value) + * @method Quote setBaseGrandTotal(float $value) + * @method Quote setCheckoutMethod(string $value) * @method int getCustomerId() - * @method \Magento\Sales\Model\Quote setCustomerId(int $value) - * @method \Magento\Sales\Model\Quote setCustomerTaxClassId(int $value) - * @method \Magento\Sales\Model\Quote setCustomerGroupId(int $value) + * @method Quote setCustomerId(int $value) + * @method Quote setCustomerTaxClassId(int $value) + * @method Quote setCustomerGroupId(int $value) * @method string getCustomerEmail() - * @method \Magento\Sales\Model\Quote setCustomerEmail(string $value) + * @method Quote setCustomerEmail(string $value) * @method string getCustomerPrefix() - * @method \Magento\Sales\Model\Quote setCustomerPrefix(string $value) + * @method Quote setCustomerPrefix(string $value) * @method string getCustomerFirstname() - * @method \Magento\Sales\Model\Quote setCustomerFirstname(string $value) + * @method Quote setCustomerFirstname(string $value) * @method string getCustomerMiddlename() - * @method \Magento\Sales\Model\Quote setCustomerMiddlename(string $value) + * @method Quote setCustomerMiddlename(string $value) * @method string getCustomerLastname() - * @method \Magento\Sales\Model\Quote setCustomerLastname(string $value) + * @method Quote setCustomerLastname(string $value) * @method string getCustomerSuffix() - * @method \Magento\Sales\Model\Quote setCustomerSuffix(string $value) + * @method Quote setCustomerSuffix(string $value) * @method string getCustomerDob() - * @method \Magento\Sales\Model\Quote setCustomerDob(string $value) + * @method Quote setCustomerDob(string $value) * @method string getCustomerNote() - * @method \Magento\Sales\Model\Quote setCustomerNote(string $value) + * @method Quote setCustomerNote(string $value) * @method int getCustomerNoteNotify() - * @method \Magento\Sales\Model\Quote setCustomerNoteNotify(int $value) + * @method Quote setCustomerNoteNotify(int $value) * @method int getCustomerIsGuest() - * @method \Magento\Sales\Model\Quote setCustomerIsGuest(int $value) + * @method Quote setCustomerIsGuest(int $value) * @method string getRemoteIp() - * @method \Magento\Sales\Model\Quote setRemoteIp(string $value) + * @method Quote setRemoteIp(string $value) * @method string getAppliedRuleIds() - * @method \Magento\Sales\Model\Quote setAppliedRuleIds(string $value) + * @method Quote setAppliedRuleIds(string $value) * @method string getReservedOrderId() - * @method \Magento\Sales\Model\Quote setReservedOrderId(string $value) + * @method Quote setReservedOrderId(string $value) * @method string getPasswordHash() - * @method \Magento\Sales\Model\Quote setPasswordHash(string $value) + * @method Quote setPasswordHash(string $value) * @method string getCouponCode() - * @method \Magento\Sales\Model\Quote setCouponCode(string $value) + * @method Quote setCouponCode(string $value) * @method string getGlobalCurrencyCode() - * @method \Magento\Sales\Model\Quote setGlobalCurrencyCode(string $value) + * @method Quote setGlobalCurrencyCode(string $value) * @method float getBaseToGlobalRate() - * @method \Magento\Sales\Model\Quote setBaseToGlobalRate(float $value) + * @method Quote setBaseToGlobalRate(float $value) * @method float getBaseToQuoteRate() - * @method \Magento\Sales\Model\Quote setBaseToQuoteRate(float $value) + * @method Quote setBaseToQuoteRate(float $value) * @method string getCustomerTaxvat() - * @method \Magento\Sales\Model\Quote setCustomerTaxvat(string $value) + * @method Quote setCustomerTaxvat(string $value) * @method string getCustomerGender() - * @method \Magento\Sales\Model\Quote setCustomerGender(string $value) + * @method Quote setCustomerGender(string $value) * @method float getSubtotal() - * @method \Magento\Sales\Model\Quote setSubtotal(float $value) + * @method Quote setSubtotal(float $value) * @method float getBaseSubtotal() - * @method \Magento\Sales\Model\Quote setBaseSubtotal(float $value) + * @method Quote setBaseSubtotal(float $value) * @method float getSubtotalWithDiscount() - * @method \Magento\Sales\Model\Quote setSubtotalWithDiscount(float $value) + * @method Quote setSubtotalWithDiscount(float $value) * @method float getBaseSubtotalWithDiscount() - * @method \Magento\Sales\Model\Quote setBaseSubtotalWithDiscount(float $value) + * @method Quote setBaseSubtotalWithDiscount(float $value) * @method int getIsChanged() - * @method \Magento\Sales\Model\Quote setIsChanged(int $value) + * @method Quote setIsChanged(int $value) * @method int getTriggerRecollect() - * @method \Magento\Sales\Model\Quote setTriggerRecollect(int $value) + * @method Quote setTriggerRecollect(int $value) * @method string getExtShippingInfo() - * @method \Magento\Sales\Model\Quote setExtShippingInfo(string $value) + * @method Quote setExtShippingInfo(string $value) * @method int getGiftMessageId() - * @method \Magento\Sales\Model\Quote setGiftMessageId(int $value) + * @method Quote setGiftMessageId(int $value) * @method bool|null getIsPersistent() - * @method \Magento\Sales\Model\Quote setIsPersistent(bool $value) + * @method Quote setIsPersistent(bool $value) */ -namespace Magento\Sales\Model; - class Quote extends \Magento\Core\Model\AbstractModel { /** @@ -275,18 +275,27 @@ class Quote extends \Magento\Core\Model\AbstractModel protected $_quotePaymentCollectionFactory; /** - * @var \Magento\RecurringProfile\Model\Profile + * @var \Magento\Object\Copy */ - protected $_recurringProfileFactory; + protected $_objectCopyService; /** - * @var \Magento\Object\Copy + * @var CustomerDto */ - protected $_objectCopyService; + protected $_customerData; + + /** @var \Magento\Customer\Model\Converter */ + protected $_converter; + + /** @var \Magento\Customer\Service\V1\CustomerAddressService */ + protected $_addressService; + + /** @var \Magento\Customer\Model\Address\Converter */ + protected $_addressConverter; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig @@ -302,15 +311,17 @@ class Quote extends \Magento\Core\Model\AbstractModel * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Sales\Model\Quote\PaymentFactory $quotePaymentFactory * @param \Magento\Sales\Model\Resource\Quote\Payment\CollectionFactory $quotePaymentCollectionFactory - * @param \Magento\RecurringProfile\Model\ProfileFactory $recurringProfileFactory * @param \Magento\Object\Copy $objectCopyService + * @param \Magento\Customer\Model\Converter $converter + * @param \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService + * @param \Magento\Customer\Model\Address\Converter $addressConverter * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Sales\Helper\Data $salesData, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, @@ -326,8 +337,10 @@ public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Sales\Model\Quote\PaymentFactory $quotePaymentFactory, \Magento\Sales\Model\Resource\Quote\Payment\CollectionFactory $quotePaymentCollectionFactory, - \Magento\RecurringProfile\Model\ProfileFactory $recurringProfileFactory, \Magento\Object\Copy $objectCopyService, + \Magento\Customer\Model\Converter $converter, + \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService, + \Magento\Customer\Model\Address\Converter $addressConverter, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -347,8 +360,10 @@ public function __construct( $this->_productFactory = $productFactory; $this->_quotePaymentFactory = $quotePaymentFactory; $this->_quotePaymentCollectionFactory = $quotePaymentCollectionFactory; - $this->_recurringProfileFactory = $recurringProfileFactory; $this->_objectCopyService = $objectCopyService; + $this->_converter = $converter; + $this->_addressService = $addressService; + $this->_addressConverter = $addressConverter; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -386,8 +401,8 @@ public function getStore() /** * Declare quote store model * - * @param \Magento\Core\Model\Store $store - * @return \Magento\Sales\Model\Quote + * @param \Magento\Core\Model\Store $store + * @return $this */ public function setStore(\Magento\Core\Model\Store $store) { @@ -416,7 +431,7 @@ public function getSharedStoreIds() /** * Prepare data before save * - * @return \Magento\Sales\Model\Quote + * @return $this */ protected function _beforeSave() { @@ -469,7 +484,7 @@ protected function _beforeSave() /** * Save related items * - * @return \Magento\Sales\Model\Quote + * @return $this */ protected function _afterSave() { @@ -493,10 +508,11 @@ protected function _afterSave() * Loading quote data by customer * * @param \Magento\Customer\Model\Customer|int $customer - * @return \Magento\Sales\Model\Quote + * @return $this */ public function loadByCustomer($customer) { + /* @TODO: remove this if after external usages of loadByCustomer are refactored in MAGETWO-19935 */ if ($customer instanceof \Magento\Customer\Model\Customer) { $customerId = $customer->getId(); } else { @@ -511,7 +527,7 @@ public function loadByCustomer($customer) * Loading only active quote * * @param int $quoteId - * @return \Magento\Sales\Model\Quote + * @return $this */ public function loadActive($quoteId) { @@ -524,7 +540,7 @@ public function loadActive($quoteId) * Loading quote by identifier * * @param int $quoteId - * @return \Magento\Sales\Model\Quote + * @return $this */ public function loadByIdWithoutStore($quoteId) { @@ -536,27 +552,33 @@ public function loadByIdWithoutStore($quoteId) /** * Assign customer model object data to quote * - * @param \Magento\Customer\Model\Customer $customer - * @return \Magento\Sales\Model\Quote + * @param CustomerDto|\Magento\Customer\Model\Customer $customer + * @return $this */ - public function assignCustomer(\Magento\Customer\Model\Customer $customer) + public function assignCustomer($customer) { + /* @TODO: refactor input type hint after external usages of assignCustomer are refactored in MAGETWO-19930 */ return $this->assignCustomerWithAddressChange($customer); } /** * Assign customer model to quote with billing and shipping address change * - * @param \Magento\Customer\Model\Customer $customer - * @param \Magento\Sales\Model\Quote\Address $billingAddress - * @param \Magento\Sales\Model\Quote\Address $shippingAddress - * @return \Magento\Sales\Model\Quote + * @param CustomerDto|\Magento\Customer\Model\Customer $customer + * @param Address $billingAddress + * @param Address $shippingAddress + * @return $this */ public function assignCustomerWithAddressChange( - \Magento\Customer\Model\Customer $customer, - \Magento\Sales\Model\Quote\Address $billingAddress = null, - \Magento\Sales\Model\Quote\Address $shippingAddress = null + $customer, + Address $billingAddress = null, + Address $shippingAddress = null ) { + /* @TODO: refactor this once all the usages of assignCustomerWithAddressChange are refactored MAGETWO-19930 */ + if ($customer instanceof CustomerDto) { + $customer = $this->_converter->createCustomerModel($customer); + } + if ($customer->getId()) { $this->setCustomer($customer); @@ -590,10 +612,11 @@ public function assignCustomerWithAddressChange( * Define customer object * * @param \Magento\Customer\Model\Customer $customer - * @return \Magento\Sales\Model\Quote + * @return $this */ public function setCustomer(\Magento\Customer\Model\Customer $customer) { + /* @TODO: Remove the method after all external usages are refactored in MAGETWO-19930 */ $this->_customer = $customer; $this->setCustomerId($customer->getId()); $this->_objectCopyService->copyFieldsetToTarget('customer_account', 'to_quote', $customer, $this); @@ -607,6 +630,10 @@ public function setCustomer(\Magento\Customer\Model\Customer $customer) */ public function getCustomer() { + /** + * @TODO: Remove the method after all external usages are refactored in MAGETWO-19930 + * _customer and _customerFactory variables should be eliminated as well + */ if (null === $this->_customer) { $this->_customer = $this->_customerFactory->create(); $customerId = $this->getCustomerId(); @@ -620,6 +647,102 @@ public function getCustomer() return $this->_customer; } + /** + * Retrieve customer data object + * + * @return CustomerDto + */ + public function getCustomerData() + { + /* @TODO: remove this code in favor of setCustomerData usage MAGETWO-19930 */ + $customerModel = $this->getCustomer(); + return $this->_converter->createCustomerFromModel($customerModel); + } + + /** + * Set customer data object + * + * @param CustomerDto $customerData + * @return $this + */ + public function setCustomerData(CustomerDto $customerData) + { + /* @TODO: remove model usage in favor of DTO in scope of MAGETWO-19930 */ + $customer = $this->_customerFactory->create(); + $customer->setData($customerData->getAttributes()); + $customer->setId($customerData->getCustomerId()); + $this->setCustomer($customer); + return $this; + } + + /** + * Substitute customer addresses + * + * @param AddressDto[] $addresses + * @return $this + */ + public function setCustomerAddressData(array $addresses) + { + $this->getCustomer()->getAddressesCollection()->removeAllItems(); + foreach ($addresses as $address) { + $this->addCustomerAddressData($address); + } + + return $this; + } + + /** + * Add address to the customer, created out of a DTO + * + * TODO refactor in scope of MAGETWO-19930 + * + * @param AddressDto $address + * @return $this + */ + public function addCustomerAddressData(AddressDto $address) + { + $this->getCustomer()->addAddress($this->_addressConverter->createAddressModel($address)); + + return $this; + } + + /** + * Get DTO addresses of the customer + * + * TODO: Refactor to use addressDto property is used insead of customer model MAGETWO-19930 + * + * @return AddressDto[] + */ + public function getCustomerAddressData() + { + $customer = $this->getCustomerData(); + $addresses = $this->getCustomer()->getAddresses(); + $addressDtos = []; + foreach ($addresses as $address) { + $addressDtos[] = $this->_addressConverter->createAddressFromModel( + $address, + $customer->getDefaultBilling(), + $customer->getDefaultShipping() + ); + } + return $addressDtos; + } + + /** + * Update customer data object + * + * @param CustomerDto $customerData + * @return $this + */ + public function updateCustomerData(CustomerDto $customerData) + { + $customer = $this->getCustomer(); + /* @TODO: remove this code in favor of customer DTO usage MAGETWO-19930 */ + $this->_converter->updateCustomerModel($customer, $customerData); + $this->setCustomer($customer); + return $this; + } + /** * Retrieve customer group id * @@ -632,6 +755,7 @@ public function getCustomerGroupId() } elseif ($this->getCustomerId()) { return $this->getCustomer()->getGroupId(); } else { + /** TODO: Magento\Customer\Model\Group usage should be eliminated in scope of MAGETWO-21105 */ return \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID; } } @@ -646,6 +770,10 @@ public function getCustomerTaxClassId() * we need to retrieve from db every time to get the correct tax class */ //if (!$this->getData('customer_group_id') && !$this->getData('customer_tax_class_id')) { + /** + * TODO: Magento\Customer\Model\GroupFactory usage should be eliminated in scope of MAGETWO-21105 + * _customerGroupFactory should be removed as well + */ $classId = $this->_customerGroupFactory->create()->getTaxClassId($this->getCustomerGroupId()); $this->setCustomerTaxClassId($classId); //} @@ -677,7 +805,7 @@ public function getAddressesCollection() * Retrieve quote address by type * * @param string $type - * @return \Magento\Sales\Model\Quote\Address + * @return Address */ protected function _getAddressByType($type) { @@ -695,21 +823,21 @@ protected function _getAddressByType($type) /** * Retrieve quote billing address * - * @return \Magento\Sales\Model\Quote\Address + * @return Address */ public function getBillingAddress() { - return $this->_getAddressByType(\Magento\Sales\Model\Quote\Address::TYPE_BILLING); + return $this->_getAddressByType(Address::TYPE_BILLING); } /** * Retrieve quote shipping address * - * @return \Magento\Sales\Model\Quote\Address + * @return Address */ public function getShippingAddress() { - return $this->_getAddressByType(\Magento\Sales\Model\Quote\Address::TYPE_SHIPPING); + return $this->_getAddressByType(Address::TYPE_SHIPPING); } /** @@ -719,7 +847,7 @@ public function getAllShippingAddresses() { $addresses = array(); foreach ($this->getAddressesCollection() as $address) { - if ($address->getAddressType() == \Magento\Sales\Model\Quote\Address::TYPE_SHIPPING + if ($address->getAddressType() == Address::TYPE_SHIPPING && !$address->isDeleted() ) { $addresses[] = $address; @@ -745,7 +873,7 @@ public function getAllAddresses() /** * * @param int $addressId - * @return \Magento\Sales\Model\Quote\Address + * @return Address */ public function getAddressById($addressId) { @@ -772,13 +900,16 @@ public function getAddressByCustomerAddressId($addressId) } /** + * Get quote address by customer address ID. + * * @param int|string $addressId - * @return bool + * @return \Magento\Sales\Model\Quote\Address|bool */ public function getShippingAddressByCustomerAddressId($addressId) { + /** @var \Magento\Sales\Model\Quote\Address $address */ foreach ($this->getAddressesCollection() as $address) { - if (!$address->isDeleted() && $address->getAddressType() == \Magento\Sales\Model\Quote\Address::TYPE_SHIPPING + if (!$address->isDeleted() && $address->getAddressType() == Address::TYPE_SHIPPING && $address->getCustomerAddressId() == $addressId ) { return $address; @@ -805,7 +936,7 @@ public function removeAddress($addressId) /** * Leave no more than one billing and one shipping address, fill them with default data * - * @return \Magento\Sales\Model\Quote + * @return $this */ public function removeAllAddresses() { @@ -840,10 +971,10 @@ public function removeAllAddresses() } /** - * @param \Magento\Sales\Model\Quote\Address $address + * @param Address $address * @return $this */ - public function addAddress(\Magento\Sales\Model\Quote\Address $address) + public function addAddress(Address $address) { $address->setQuote($this); if (!$address->getId()) { @@ -853,17 +984,17 @@ public function addAddress(\Magento\Sales\Model\Quote\Address $address) } /** - * @param \Magento\Sales\Model\Quote\Address $address - * @return \Magento\Sales\Model\Quote + * @param Address $address + * @return $this */ - public function setBillingAddress(\Magento\Sales\Model\Quote\Address $address) + public function setBillingAddress(Address $address) { $old = $this->getBillingAddress(); if (!empty($old)) { $old->addData($address->getData()); } else { - $this->addAddress($address->setAddressType(\Magento\Sales\Model\Quote\Address::TYPE_BILLING)); + $this->addAddress($address->setAddressType(Address::TYPE_BILLING)); } return $this; } @@ -871,29 +1002,29 @@ public function setBillingAddress(\Magento\Sales\Model\Quote\Address $address) /** * Set shipping address * - * @param \Magento\Sales\Model\Quote\Address $address - * @return \Magento\Sales\Model\Quote + * @param Address $address + * @return $this */ - public function setShippingAddress(\Magento\Sales\Model\Quote\Address $address) + public function setShippingAddress(Address $address) { if ($this->getIsMultiShipping()) { - $this->addAddress($address->setAddressType(\Magento\Sales\Model\Quote\Address::TYPE_SHIPPING)); + $this->addAddress($address->setAddressType(Address::TYPE_SHIPPING)); } else { $old = $this->getShippingAddress(); if (!empty($old)) { $old->addData($address->getData()); } else { - $this->addAddress($address->setAddressType(\Magento\Sales\Model\Quote\Address::TYPE_SHIPPING)); + $this->addAddress($address->setAddressType(Address::TYPE_SHIPPING)); } } return $this; } /** - * @param \Magento\Sales\Model\Quote\Address $address + * @param Address $address * @return $this */ - public function addShippingAddress(\Magento\Sales\Model\Quote\Address $address) + public function addShippingAddress(Address $address) { $this->setShippingAddress($address); return $this; @@ -936,7 +1067,7 @@ public function getAllItems() /** * Get array of all items what can be display directly * - * @return array + * @return \Magento\Sales\Model\Quote\Item[] */ public function getAllVisibleItems() { @@ -1008,7 +1139,7 @@ public function getItemById($itemId) * Delete quote item. If it does not have identifier then it will be only removed from collection * * @param \Magento\Sales\Model\Quote\Item $item - * @return \Magento\Sales\Model\Quote + * @return $this */ public function deleteItem(\Magento\Sales\Model\Quote\Item $item) { @@ -1038,7 +1169,7 @@ public function deleteItem(\Magento\Sales\Model\Quote\Item $item) * Remove quote item by item identifier * * @param int $itemId - * @return \Magento\Sales\Model\Quote + * @return $this */ public function removeItem($itemId) { @@ -1071,7 +1202,7 @@ public function removeItem($itemId) /** * Mark all quote items as deleted (empty quote) * - * @return \Magento\Sales\Model\Quote + * @return $this */ public function removeAllItems() { @@ -1089,7 +1220,7 @@ public function removeAllItems() * Adding new item to quote * * @param \Magento\Sales\Model\Quote\Item $item - * @return \Magento\Sales\Model\Quote + * @return $this * @throws \Magento\Core\Exception */ public function addItem(\Magento\Sales\Model\Quote\Item $item) @@ -1497,7 +1628,7 @@ public function removePayment() /** * Collect totals * - * @return \Magento\Sales\Model\Quote + * @return $this */ public function collectTotals() { @@ -1558,7 +1689,7 @@ public function collectTotals() /** * Collect items qty * - * @return \Magento\Sales\Model\Quote + * @return $this */ protected function _collectItemsQtys() { @@ -1624,7 +1755,7 @@ public function getTotals() $sortedTotals = array(); foreach ($this->getBillingAddress()->getTotalCollector()->getRetrievers() as $total) { - /* @var $total \Magento\Sales\Model\Quote\Address\Total\AbstractTotal */ + /* @var $total Address\Total\AbstractTotal */ if (isset($totals[$total->getCode()])) { $sortedTotals[$total->getCode()] = $totals[$total->getCode()]; } @@ -1693,7 +1824,7 @@ public function getErrors() * Sets flag, whether this quote has some error associated with it. * * @param bool $flag - * @return \Magento\Sales\Model\Quote + * @return $this */ protected function _setHasError($flag) { @@ -1707,7 +1838,7 @@ protected function _setHasError($flag) * It's recommended to use addErrorInfo() instead - to be able to remove error statuses later. * * @param bool $flag - * @return \Magento\Sales\Model\Quote + * @return $this * @see addErrorInfo() */ public function setHasError($flag) @@ -1724,7 +1855,7 @@ public function setHasError($flag) * Clears list of errors, associated with this quote. * Also automatically removes error-flag from oneself. * - * @return \Magento\Sales\Model\Quote + * @return $this */ protected function _clearErrorInfo() { @@ -1742,7 +1873,7 @@ protected function _clearErrorInfo() * @param int|null $code Error code, unique for origin, that sets it * @param string|null $message Error message * @param \Magento\Object|null $additionalData Any additional data, that caller would like to store - * @return \Magento\Sales\Model\Quote + * @return $this */ public function addErrorInfo($type = 'error', $origin = null, $code = null, $message = null, $additionalData = null) { @@ -1767,7 +1898,7 @@ public function addErrorInfo($type = 'error', $origin = null, $code = null, $mes * * @param string $type An internal error type ('error', 'qty', etc.), passed then to adding messages routine * @param array $params - * @return \Magento\Sales\Model\Quote + * @return $this */ public function removeErrorInfosByParams($type, $params) { @@ -1810,7 +1941,7 @@ public function removeErrorInfosByParams($type, $params) * * @param string $type * @param string $text - * @return \Magento\Sales\Model\Quote + * @return $this */ public function removeMessageByText($type, $text) { @@ -1839,7 +1970,7 @@ public function removeMessageByText($type, $text) /** * Generate new increment order id and associate it with current quote * - * @return \Magento\Sales\Model\Quote + * @return $this */ public function reserveOrderId() { @@ -1885,7 +2016,7 @@ public function validateMinimumAmount($multishipping = false) } else { $baseTotal = 0; foreach ($addresses as $address) { - /* @var $address \Magento\Sales\Model\Quote\Address */ + /* @var $address Address */ $baseTotal += $address->getBaseSubtotalWithDiscount(); } if ($baseTotal < $minAmount) { @@ -1894,7 +2025,7 @@ public function validateMinimumAmount($multishipping = false) } } else { foreach ($addresses as $address) { - /* @var $address \Magento\Sales\Model\Quote\Address */ + /* @var $address Address */ if (!$address->validateMinimumAmount()) { return false; } @@ -1958,10 +2089,10 @@ public function hasVirtualItems() /** * Merge quotes * - * @param \Magento\Sales\Model\Quote $quote - * @return \Magento\Sales\Model\Quote + * @param Quote $quote + * @return $this */ - public function merge(\Magento\Sales\Model\Quote $quote) + public function merge(Quote $quote) { $this->_eventManager->dispatch($this->_eventPrefix . '_merge_before', array( $this->_eventObject => $this, @@ -2011,21 +2142,6 @@ public function merge(\Magento\Sales\Model\Quote $quote) return $this; } - /** - * Whether there are recurring items - * - * @return bool - */ - public function hasRecurringItems() - { - foreach ($this->getAllVisibleItems() as $item) { - if ($item->getProduct() && $item->getProduct()->isRecurring()) { - return true; - } - } - return false; - } - /** * Getter whether quote has nominal items * Can bypass treating virtual items as nominal @@ -2061,33 +2177,6 @@ public function isNominal() return true; } - /** - * Create recurring payment profiles basing on the current items - * - * @return array - * @throws \Exception - */ - public function prepareRecurringPaymentProfiles() - { - if (!$this->getTotalsCollectedFlag()) { - // Whoops! Make sure nominal totals must be calculated here. - throw new \Exception('Quote totals must be collected before this operation.'); - } - - $result = array(); - foreach ($this->getAllVisibleItems() as $item) { - $product = $item->getProduct(); - if (is_object($product) && ($product->isRecurring()) - && $profile = $this->_recurringProfileFactory->create()->importProduct($product) - ) { - $profile->importQuote($this); - $profile->importQuoteItem($item); - $result[] = $profile; - } - } - return $result; - } - /** * @return $this */ @@ -2114,7 +2203,7 @@ protected function _validateCouponCode() /** * Trigger collect totals after loading, if required * - * @return \Magento\Sales\Model\Quote + * @return $this */ protected function _afterLoad() { @@ -2126,7 +2215,7 @@ protected function _afterLoad() } /** - * Return quote checkout method code + * Return checkout method code * * @param boolean $originalMethod if true return defined method from beginning * @return string @@ -2142,7 +2231,7 @@ public function getCheckoutMethod($originalMethod = false) /** * Prevent quote from saving * - * @return \Magento\Sales\Model\Quote + * @return $this */ public function preventSaving() { @@ -2153,7 +2242,7 @@ public function preventSaving() /** * Save quote with prevention checking * - * @return \Magento\Sales\Model\Quote + * @return $this */ public function save() { diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php index 9634616584820..6bf990d660951 100644 --- a/app/code/Magento/Sales/Model/Quote/Address.php +++ b/app/code/Magento/Sales/Model/Quote/Address.php @@ -24,118 +24,115 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\Quote; + +use Magento\Customer\Service\V1\Dto\AddressBuilder as CustomerAddressBuilder; +use Magento\Customer\Service\V1\Dto\Address as AddressDto; +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; + /** * Sales Quote address model * - * @method \Magento\Sales\Model\Resource\Quote\Address _getResource() - * @method \Magento\Sales\Model\Resource\Quote\Address getResource() * @method int getQuoteId() - * @method \Magento\Sales\Model\Quote\Address setQuoteId(int $value) + * @method Address setQuoteId(int $value) * @method string getCreatedAt() - * @method \Magento\Sales\Model\Quote\Address setCreatedAt(string $value) + * @method Address setCreatedAt(string $value) * @method string getUpdatedAt() - * @method \Magento\Sales\Model\Quote\Address setUpdatedAt(string $value) + * @method Address setUpdatedAt(string $value) * @method int getCustomerId() - * @method \Magento\Sales\Model\Quote\Address setCustomerId(int $value) + * @method Address setCustomerId(int $value) * @method int getSaveInAddressBook() - * @method \Magento\Sales\Model\Quote\Address setSaveInAddressBook(int $value) + * @method Address setSaveInAddressBook(int $value) * @method int getCustomerAddressId() - * @method \Magento\Sales\Model\Quote\Address setCustomerAddressId(int $value) + * @method Address setCustomerAddressId(int $value) + * @method \Magento\Customer\Model\Address getCustomerAddress() + * @method Address setCustomerAddress(\Magento\Customer\Model\Address $value) * @method string getAddressType() - * @method \Magento\Sales\Model\Quote\Address setAddressType(string $value) + * @method Address setAddressType(string $value) * @method string getEmail() - * @method \Magento\Sales\Model\Quote\Address setEmail(string $value) - * @method string getPrefix() - * @method \Magento\Sales\Model\Quote\Address setPrefix(string $value) - * @method string getFirstname() - * @method \Magento\Sales\Model\Quote\Address setFirstname(string $value) - * @method string getMiddlename() - * @method \Magento\Sales\Model\Quote\Address setMiddlename(string $value) - * @method string getLastname() - * @method \Magento\Sales\Model\Quote\Address setLastname(string $value) - * @method string getSuffix() - * @method \Magento\Sales\Model\Quote\Address setSuffix(string $value) + * @method Address setEmail(string $value) + * @method Address setPrefix(string $value) + * @method Address setFirstname(string $value) + * @method Address setMiddlename(string $value) + * @method Address setLastname(string $value) + * @method Address setSuffix(string $value) * @method string getCompany() - * @method \Magento\Sales\Model\Quote\Address setCompany(string $value) - * @method string getCity() - * @method \Magento\Sales\Model\Quote\Address setCity(string $value) - * @method \Magento\Sales\Model\Quote\Address setRegion(string $value) - * @method \Magento\Sales\Model\Quote\Address setRegionId(int $value) - * @method string getPostcode() - * @method \Magento\Sales\Model\Quote\Address setPostcode(string $value) - * @method string getCountryId() - * @method \Magento\Sales\Model\Quote\Address setCountryId(string $value) - * @method string getTelephone() - * @method \Magento\Sales\Model\Quote\Address setTelephone(string $value) + * @method Address setCompany(string $value) + * @method Address setCity(string $value) + * @method Address setRegion(string $value) + * @method Address setRegionId(int $value) + * @method Address setPostcode(string $value) + * @method Address setCountryId(string $value) + * @method Address setTelephone(string $value) * @method string getFax() - * @method \Magento\Sales\Model\Quote\Address setFax(string $value) + * @method Address setFax(string $value) * @method int getSameAsBilling() - * @method \Magento\Sales\Model\Quote\Address setSameAsBilling(int $value) + * @method Address setSameAsBilling(int $value) * @method int getFreeShipping() - * @method \Magento\Sales\Model\Quote\Address setFreeShipping(int $value) + * @method Address setFreeShipping(int $value) * @method int getCollectShippingRates() - * @method \Magento\Sales\Model\Quote\Address setCollectShippingRates(int $value) + * @method Address setCollectShippingRates(int $value) * @method string getShippingMethod() - * @method \Magento\Sales\Model\Quote\Address setShippingMethod(string $value) + * @method Address setShippingMethod(string $value) * @method string getShippingDescription() - * @method \Magento\Sales\Model\Quote\Address setShippingDescription(string $value) + * @method Address setShippingDescription(string $value) * @method float getWeight() - * @method \Magento\Sales\Model\Quote\Address setWeight(float $value) + * @method Address setWeight(float $value) * @method float getSubtotal() - * @method \Magento\Sales\Model\Quote\Address setSubtotal(float $value) + * @method Address setSubtotal(float $value) * @method float getBaseSubtotal() - * @method \Magento\Sales\Model\Quote\Address setBaseSubtotal(float $value) - * @method \Magento\Sales\Model\Quote\Address setSubtotalWithDiscount(float $value) - * @method \Magento\Sales\Model\Quote\Address setBaseSubtotalWithDiscount(float $value) + * @method Address setBaseSubtotal(float $value) + * @method Address setSubtotalWithDiscount(float $value) + * @method Address setBaseSubtotalWithDiscount(float $value) * @method float getTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setTaxAmount(float $value) + * @method Address setTaxAmount(float $value) * @method float getBaseTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setBaseTaxAmount(float $value) + * @method Address setBaseTaxAmount(float $value) * @method float getShippingAmount() * @method float getBaseShippingAmount() * @method float getShippingTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setShippingTaxAmount(float $value) + * @method Address setShippingTaxAmount(float $value) * @method float getBaseShippingTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setBaseShippingTaxAmount(float $value) + * @method Address setBaseShippingTaxAmount(float $value) * @method float getDiscountAmount() - * @method \Magento\Sales\Model\Quote\Address setDiscountAmount(float $value) + * @method Address setDiscountAmount(float $value) * @method float getBaseDiscountAmount() - * @method \Magento\Sales\Model\Quote\Address setBaseDiscountAmount(float $value) + * @method Address setBaseDiscountAmount(float $value) * @method float getGrandTotal() - * @method \Magento\Sales\Model\Quote\Address setGrandTotal(float $value) + * @method Address setGrandTotal(float $value) * @method float getBaseGrandTotal() - * @method \Magento\Sales\Model\Quote\Address setBaseGrandTotal(float $value) + * @method Address setBaseGrandTotal(float $value) * @method string getCustomerNotes() - * @method \Magento\Sales\Model\Quote\Address setCustomerNotes(string $value) + * @method Address setCustomerNotes(string $value) * @method string getDiscountDescription() - * @method \Magento\Sales\Model\Quote\Address setDiscountDescription(string $value) + * @method Address setDiscountDescription(string $value) * @method null|array getDiscountDescriptionArray() - * @method \Magento\Sales\Model\Quote\Address setDiscountDescriptionArray(array $value) + * @method Address setDiscountDescriptionArray(array $value) * @method float getShippingDiscountAmount() - * @method \Magento\Sales\Model\Quote\Address setShippingDiscountAmount(float $value) + * @method Address setShippingDiscountAmount(float $value) * @method float getBaseShippingDiscountAmount() - * @method \Magento\Sales\Model\Quote\Address setBaseShippingDiscountAmount(float $value) + * @method Address setBaseShippingDiscountAmount(float $value) * @method float getSubtotalInclTax() - * @method \Magento\Sales\Model\Quote\Address setSubtotalInclTax(float $value) + * @method Address setSubtotalInclTax(float $value) * @method float getBaseSubtotalTotalInclTax() - * @method \Magento\Sales\Model\Quote\Address setBaseSubtotalTotalInclTax(float $value) + * @method Address setBaseSubtotalTotalInclTax(float $value) * @method int getGiftMessageId() - * @method \Magento\Sales\Model\Quote\Address setGiftMessageId(int $value) + * @method Address setGiftMessageId(int $value) * @method float getHiddenTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setHiddenTaxAmount(float $value) + * @method Address setHiddenTaxAmount(float $value) * @method float getBaseHiddenTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setBaseHiddenTaxAmount(float $value) + * @method Address setBaseHiddenTaxAmount(float $value) * @method float getShippingHiddenTaxAmount() - * @method \Magento\Sales\Model\Quote\Address setShippingHiddenTaxAmount(float $value) + * @method Address setShippingHiddenTaxAmount(float $value) * @method float getBaseShippingHiddenTaxAmnt() - * @method \Magento\Sales\Model\Quote\Address setBaseShippingHiddenTaxAmnt(float $value) + * @method Address setBaseShippingHiddenTaxAmnt(float $value) * @method float getShippingInclTax() - * @method \Magento\Sales\Model\Quote\Address setShippingInclTax(float $value) + * @method Address setShippingInclTax(float $value) * @method float getBaseShippingInclTax() - * @method \Magento\Sales\Model\Quote\Address setBaseShippingInclTax(float $value) + * @method \Magento\SalesRule\Model\Rule[] getCartFixedRules() + * @method int[] getAppliedRuleIds() + * @method Address setBaseShippingInclTax(float $value) */ -namespace Magento\Sales\Model\Quote; - class Address extends \Magento\Customer\Model\Address\AbstractAddress { const RATES_FETCH = 1; @@ -250,8 +247,22 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_addressTotalFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @var CustomerAddressBuilder + */ + protected $_customerAddressBuilder; + + /** + * @var CustomerAddressServiceInterface + */ + protected $_customerAdressService; + /** + * @var \Magento\Customer\Model\Address\Converter + */ + private $addressConverter; + + /** + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig @@ -269,13 +280,16 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param \Magento\Sales\Model\Quote\Address\TotalFactory $addressTotalFactory * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory + * @param CustomerAddressBuilder $customerAddressBuilder + * @param CustomerAddressServiceInterface $customerAddressService + * @param \Magento\Customer\Model\Address\Converter $addressConverter * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, @@ -293,6 +307,9 @@ public function __construct( \Magento\Sales\Model\Quote\Address\TotalFactory $addressTotalFactory, \Magento\Object\Copy $objectCopyService, \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory, + CustomerAddressBuilder $customerAddressBuilder, + CustomerAddressServiceInterface $customerAddressService, + \Magento\Customer\Model\Address\Converter $addressConverter, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -309,6 +326,8 @@ public function __construct( $this->_addressTotalFactory = $addressTotalFactory; $this->_objectCopyService = $objectCopyService; $this->_carrierFactory = $carrierFactory; + $this->_customerAddressBuilder = $customerAddressBuilder; + $this->_customerAdressService = $customerAddressService; parent::__construct( $context, $registry, @@ -321,6 +340,7 @@ public function __construct( $resourceCollection, $data ); + $this->addressConverter = $addressConverter; } /** @@ -359,8 +379,8 @@ protected function _populateBeforeSaveData() /** * Init customer address id if customer address is assigned */ - if ($this->getCustomerAddress()) { - $this->setCustomerAddressId($this->getCustomerAddress()->getId()); + if ($this->getCustomerAddressData()) { + $this->setCustomerAddressId($this->getCustomerAddressData()->getId()); } if (!$this->getId()) { @@ -397,10 +417,24 @@ protected function _isNotRegisteredCustomer() */ protected function _isDefaultShippingNullOrSameAsBillingAddress() { - $customer = $this->getQuote()->getCustomer(); - return !$customer->getDefaultShippingAddress() - || $customer->getDefaultBillingAddress() && $customer->getDefaultShippingAddress() - && $customer->getDefaultBillingAddress()->getId() == $customer->getDefaultShippingAddress()->getId(); + $customerData = $this->getQuote()->getCustomerData(); + $customerId = $customerData->getCustomerId(); + $defaultBillingAddress = null; + $defaultShippingAddress = null; + + if ($customerId) { + /* we should load data from the service once customer is saved */ + $defaultBillingAddress = $this->_customerAdressService->getDefaultBillingAddress($customerId); + $defaultShippingAddress = $this->_customerAdressService->getDefaultShippingAddress($customerId); + } else { + /* we should load data from the quote if customer is not saved yet */ + $defaultBillingAddress = $customerData->getDefaultBilling(); + $defaultShippingAddress = $customerData->getDefaultShipping(); + } + + return !$defaultShippingAddress + || $defaultBillingAddress && $defaultShippingAddress + && $defaultBillingAddress->getId() == $defaultShippingAddress->getId(); } /** @@ -446,15 +480,20 @@ public function getQuote() /** * Import quote address data from customer address object * - * @param \Magento\Customer\Model\Address $address - * @return \Magento\Sales\Model\Quote\Address + * @deprecated Use \Magento\Sales\Model\Quote\Address::importCustomerAddressData() instead + * @param \Magento\Customer\Model\Address $address + * @return \Magento\Sales\Model\Quote\Address */ public function importCustomerAddress(\Magento\Customer\Model\Address $address) { + /** + * TODO: Remove this method when all dependencies are refactored to use + * importCustomerAddressData() - MAGETWO-20858 + */ $this->_objectCopyService->copyFieldsetToTarget('customer_address', 'to_quote_address', $address, $this); $email = null; if ($address->hasEmail()) { - $email = $address->getEmail(); + $email = $address->getEmail(); } elseif ($address->getCustomer()) { $email = $address->getCustomer()->getEmail(); } @@ -464,13 +503,45 @@ public function importCustomerAddress(\Magento\Customer\Model\Address $address) return $this; } + /** + * Import quote address data from customer address DTO. + * + * @param \Magento\Customer\Service\V1\Dto\Address $address + * @return \Magento\Sales\Model\Quote\Address + */ + public function importCustomerAddressData(\Magento\Customer\Service\V1\Dto\Address $address) + { + $this->_objectCopyService->copyFieldsetToTarget( + 'customer_address', + 'to_quote_address', + $address->getAttributes(), + $this + ); + $region = $this->getRegion(); + if (isset($region['region_id']) && isset($region['region'])) { + $this->setRegionId($region['region_id']); + $this->setRegion($region['region']); + } + $quote = $this->getQuote(); + if ($address->getCustomerId() && (!empty($quote) && ($address->getCustomerId() == $quote->getCustomerId()))) { + $customer = $quote->getCustomerData(); + $this->setEmail($customer->getEmail()); + } + return $this; + } + /** * Export data to customer address object * + * @deprecated Use \Magento\Sales\Model\Quote\Address::exportCustomerAddressData() instead * @return \Magento\Customer\Model\Address */ public function exportCustomerAddress() { + /** + * TODO: Remove this method when all dependencies are refactored to use exportCustomerAddressData() + * _addressFactory variable should be removed in scope of MAGETWO-21105 as well + */ $address = $this->_addressFactory->create(); $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_quote_address', 'to_customer_address', $this, $address @@ -478,6 +549,24 @@ public function exportCustomerAddress() return $address; } + /** + * Export data to customer address DTO. + * + * @return \Magento\Customer\Service\V1\Dto\Address + */ + public function exportCustomerAddressData() + { + $customerAddressData = $this->_objectCopyService->getDataFromFieldset( + 'sales_convert_quote_address', + 'to_customer_address', + $this + ); + $customerAddressDataWithRegion = []; + $customerAddressDataWithRegion['region']['region'] = $customerAddressData['region']; + $customerAddressData = array_merge($customerAddressData, $customerAddressDataWithRegion); + return $this->_customerAddressBuilder->populateWithArray($customerAddressData)->create(); + } + /** * Import address data from order address * @@ -1340,4 +1429,37 @@ public function getSubtotalWithDiscount() { return $this->getSubtotal() + $this->getDiscountAmount(); } + + /** + * Keep customer address + * @todo refactor in scope of MAGETWO-20857 + * + * @param AddressDto $address + * @return $this + */ + public function setCustomerAddressData(AddressDto $address) + { + return $this->setCustomerAddress($this->addressConverter->createAddressModel($address)); + } + + /** + * Get previously set customer address + * @todo refactor in scope of MAGETWO-20857 + * + * @return AddressDto|null + */ + public function getCustomerAddressData() + { + $address = $this->getCustomerAddress(); + + if ($address) { + return $this->addressConverter->createAddressFromModel( + $address, + $address->getIsDefaultBilling(), + $address->getIsDefaultShipping() + ); + } + + return null; + } } diff --git a/app/code/Magento/Sales/Model/Quote/Item.php b/app/code/Magento/Sales/Model/Quote/Item.php index 515dfb21b48c1..03d7a137fefd2 100644 --- a/app/code/Magento/Sales/Model/Quote/Item.php +++ b/app/code/Magento/Sales/Model/Quote/Item.php @@ -201,8 +201,8 @@ class Item extends \Magento\Sales\Model\Quote\Item\AbstractItem protected $_itemOptionFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Sales\Model\Status\ListFactory $statusListFactory * @param \Magento\Core\Model\LocaleInterface $locale @@ -214,8 +214,8 @@ class Item extends \Magento\Sales\Model\Quote\Item\AbstractItem * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Sales\Model\Status\ListFactory $statusListFactory, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php b/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php index 8ef248d317937..1090550d98753 100644 --- a/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php +++ b/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\Quote\Item; + /** * Quote item abstract model * @@ -34,12 +36,23 @@ * - custom_price - new price that can be declared by user and recalculated during calculation process * - original_custom_price - original defined value of custom price without any convertion * - * @category Magento - * @package Magento_Sales - * @author Magento Core Team + * @method float getDiscountAmount() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setDiscountAmount(float $amount) + * @method float getBaseDiscountAmount() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setBaseDiscountAmount(float $amount) + * @method float getDiscountPercent() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setDiscountPercent() + * @method float getOriginalDiscountAmount() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setOriginalDiscountAmount() + * @method float getBaseOriginalDiscountAmount() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setBaseOriginalDiscountAmount() + * @method float getDiscountCalculationPrice() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setDiscountCalculationPrice() + * @method float getBaseDiscountCalculationPrice() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setBaseDiscountCalculationPrice($price) + * @method int[] getAppliedRuleIds() + * @method \Magento\Sales\Model\Quote\Item\AbstractItem setAppliedRuleIds(array $ruleIds) */ -namespace Magento\Sales\Model\Quote\Item; - abstract class AbstractItem extends \Magento\Core\Model\AbstractModel implements \Magento\Catalog\Model\Product\Configuration\Item\ItemInterface { @@ -60,16 +73,16 @@ abstract class AbstractItem extends \Magento\Core\Model\AbstractModel protected $_productFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -150,7 +163,6 @@ protected function _beforeSave() return $this; } - /** * Set parent item * diff --git a/app/code/Magento/Sales/Model/Resource/Order/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Collection.php index 699d699cc8483..5634f8e9acda4 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Collection.php @@ -230,6 +230,24 @@ public function addAttributeToSearchFilter($attributes, $condition = null) return $this; } + /** + * Add filter by specified billing agreements + * + * @param int|array $agreements + * @return \Magento\Sales\Model\Resource\Order\Collection + */ + public function addBillingAgreementsFilter($agreements) + { + $agreements = (is_array($agreements)) ? $agreements : array($agreements); + $this->getSelect() + ->joinInner( + array('sbao' => $this->getTable('sales_billing_agreement_order')), + 'main_table.entity_id = sbao.order_id', + array()) + ->where('sbao.agreement_id IN(?)', $agreements); + return $this; + } + /** * Add filter by specified recurring profile id(s) * diff --git a/app/code/Magento/Sales/Model/Resource/Order/Grid/StatusesArray.php b/app/code/Magento/Sales/Model/Resource/Order/Grid/StatusesArray.php index 1fab8d5cb91fc..08831e298b5c5 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Grid/StatusesArray.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Grid/StatusesArray.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Model\Resource\Order\Grid; -class StatusesArray implements \Magento\Core\Model\Option\ArrayInterface +class StatusesArray implements \Magento\Option\ArrayInterface { /** * @var \Magento\Sales\Model\Resource\Order\Status\CollectionFactory diff --git a/app/code/Magento/Sales/Model/Resource/Sale/Collection.php b/app/code/Magento/Sales/Model/Resource/Sale/Collection.php index 90a44fbb5dc4b..7db5eaf18c9d6 100644 --- a/app/code/Magento/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Sale/Collection.php @@ -44,11 +44,9 @@ class Collection extends \Magento\Data\Collection\Db ); /** - * Customer model - * - * @var \Magento\Customer\Model\Customer + * @var int */ - protected $_customer; + protected $_customerId; /** * Order state value @@ -106,12 +104,12 @@ public function __construct( /** * Set filter by customer * - * @param \Magento\Customer\Model\Customer $customer + * @param int $customerId * @return \Magento\Sales\Model\Resource\Sale\Collection */ - public function setCustomerFilter(\Magento\Customer\Model\Customer $customer) + public function setCustomerFilter($customerId) { - $this->_customer = $customer; + $this->_customerId = (int)$customerId; return $this; } @@ -136,7 +134,7 @@ public function addStoreFilter($storeIds) public function setOrderStateFilter($state, $exclude = false) { $this->_orderStateCondition = ($exclude) ? 'NOT IN' : 'IN'; - $this->_orderStateValue = (!is_array($state)) ? array($state) : $state; + $this->_state = (!is_array($state)) ? array($state) : $state; return $this; } @@ -161,11 +159,11 @@ protected function _beforeLoad() ) ->group('sales.store_id'); - if ($this->_customer instanceof \Magento\Customer\Model\Customer) { - $this->addFieldToFilter('sales.customer_id', $this->_customer->getId()); + if ($this->_customerId) { + $this->addFieldToFilter('sales.customer_id', $this->_customerId); } - if (!is_null($this->_orderStateValue)) { + if (!is_null($this->_state)) { $condition = ''; switch ($this->_orderStateCondition) { case 'IN' : @@ -175,7 +173,7 @@ protected function _beforeLoad() $condition = 'nin'; break; } - $this->addFieldToFilter('state', array($condition => $this->_orderStateValue)); + $this->addFieldToFilter('state', array($condition => $this->_state)); } $this->_eventManager->dispatch('sales_sale_collection_query_before', array('collection' => $this)); diff --git a/app/code/Magento/Sales/Model/Service/Quote.php b/app/code/Magento/Sales/Model/Service/Quote.php index 9f71b42a1728b..32bc1f1bad11b 100644 --- a/app/code/Magento/Sales/Model/Service/Quote.php +++ b/app/code/Magento/Sales/Model/Service/Quote.php @@ -18,17 +18,22 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Sales * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\Service; + +use Magento\Customer\Service\V1\CustomerServiceInterface; +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface; +use Magento\Customer\Service\V1\Dto\AddressBuilder; +use Magento\Customer\Service\V1\Dto\Customer as CustomerDto; +use Magento\Customer\Service\V1\Dto\Response\CreateCustomerAccountResponse; + /** * Quote submit service model */ -namespace Magento\Sales\Model\Service; - class Quote { /** @@ -52,13 +57,6 @@ class Quote */ protected $_orderData = array(); - /** - * List of recurring payment profiles that may have been generated before placing the order - * - * @var array - */ - protected $_recurringPaymentProfiles = array(); - /** * Order that may be created during submission * @@ -90,6 +88,31 @@ class Quote */ protected $_transactionFactory; + /** + * @var CustomerServiceInterface + */ + protected $_customerService; + + /** + * @var CustomerAccountServiceInterface + */ + protected $_customerAccountService; + + /** + * @var CustomerAddressServiceInterface + */ + protected $_customerAddressService; + + /** + * @var AddressBuilder + */ + protected $_customerAddressBuilder; + + /** + * @var CreateCustomerAccountResponse + */ + protected $_createCustomerResponse; + /** * Class constructor * @@ -98,19 +121,31 @@ class Quote * @param \Magento\Sales\Model\Convert\QuoteFactory $convertQuoteFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Resource\TransactionFactory $transactionFactory + * @param CustomerServiceInterface $customerService + * @param CustomerAccountServiceInterface $customerAccountService + * @param CustomerAddressServiceInterface $customerAddressService + * @param AddressBuilder $customerAddressBuilder */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Quote $quote, \Magento\Sales\Model\Convert\QuoteFactory $convertQuoteFactory, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Resource\TransactionFactory $transactionFactory + \Magento\Core\Model\Resource\TransactionFactory $transactionFactory, + CustomerServiceInterface $customerService, + CustomerAccountServiceInterface $customerAccountService, + CustomerAddressServiceInterface $customerAddressService, + AddressBuilder $customerAddressBuilder ) { $this->_eventManager = $eventManager; $this->_quote = $quote; $this->_convertor = $convertQuoteFactory->create(); $this->_customerSession = $customerSession; $this->_transactionFactory = $transactionFactory; + $this->_customerService = $customerService; + $this->_customerAccountService = $customerAccountService; + $this->_customerAddressService = $customerAddressService; + $this->_customerAddressBuilder = $customerAddressBuilder; } /** @@ -150,6 +185,7 @@ public function setOrderData(array $data) /** * Submit the quote. Quote submit process will create the order based on quote data * + * @deprecated * @return \Magento\Sales\Model\Order * @throws \Exception */ @@ -234,6 +270,154 @@ public function submitOrder() $item->setItemId(null); } + $this->_eventManager->dispatch('sales_model_service_quote_submit_failure', array( + 'order' => $order, + 'quote' => $quote + )); + throw $e; + } + $this->_eventManager->dispatch('sales_model_service_quote_submit_after', array( + 'order' => $order, + 'quote' => $quote + )); + $this->_order = $order; + return $order; + } + + /** + * Submit the quote. Quote submit process will create the order based on quote data + * + * @return \Magento\Sales\Model\Order + * @throws \Exception + */ + public function submitOrderWithDto() + { + $this->_deleteNominalItems(); + $this->_validate(); + $quote = $this->_quote; + $isVirtual = $quote->isVirtual(); + + $transaction = $this->_transactionFactory->create(); + + $originalCustomerDto = null; + $customerDto = null; + if (!$quote->getCustomerIsGuest()) { + $customerDto = $quote->getCustomerData(); + $addresses = $quote->getCustomerAddressData(); + if ($customerDto->getCustomerId()) { + //cache the original customer data for rollback if needed + $originalCustomerDto = $this->_customerService->getCustomer($customerDto->getCustomerId()); + $originalAddresses = $this->_customerAddressService->getAddresses($customerDto->getCustomerId()); + //Save updated data + $this->_customerService->saveCustomer($customerDto); + $this->_customerAddressService->saveAddresses($customerDto->getCustomerId(), $addresses); + } else { //for new customers + $this->_createCustomerResponse = $this->_customerAccountService->createAccount( + $customerDto, + $addresses, + null, + '', + '', + $quote->getStoreId() + ); + $customerDto = $this->_customerService->getCustomer($this->_createCustomerResponse->getCustomerId()); + $addresses = $this->_customerAddressService->getAddresses( + $this->_createCustomerResponse->getCustomerId() + ); + //Update quote address information + foreach ($addresses as $address) { + if ($address->isDefaultBilling()) { + $quote->getBillingAddress()->setCustomerAddressData($address); + } else if ($address->isDefaultShipping()) { + $quote->getShippingAddress()->setCustomerAddressData($address); + } + } + if ($quote->getShippingAddress() && $quote->getShippingAddress()->getSameAsBilling()) { + $quote->getShippingAddress()->setCustomerAddressData( + $quote->getBillingAddress()->getCustomerAddressData()); + } + } + + $quote->setCustomerData($customerDto)->setCustomerAddressData($addresses); + } + $transaction->addObject($quote); + + $quote->reserveOrderId(); + if ($isVirtual) { + $order = $this->_convertor->addressToOrder($quote->getBillingAddress()); + } else { + $order = $this->_convertor->addressToOrder($quote->getShippingAddress()); + } + $order->setBillingAddress($this->_convertor->addressToOrderAddress($quote->getBillingAddress())); + if ($quote->getBillingAddress()->getCustomerAddressData()) { + $order->getBillingAddress()->setCustomerAddressData($quote->getBillingAddress()->getCustomerAddressData()); + } + if (!$isVirtual) { + $order->setShippingAddress($this->_convertor->addressToOrderAddress($quote->getShippingAddress())); + if ($quote->getShippingAddress()->getCustomerAddressData()) { + $order->getShippingAddress()->setCustomerAddressData( + $quote->getShippingAddress()->getCustomerAddressData()); + } + } + $order->setPayment($this->_convertor->paymentToOrderPayment($quote->getPayment())); + + foreach ($this->_orderData as $key => $value) { + $order->setData($key, $value); + } + + foreach ($quote->getAllItems() as $item) { + $orderItem = $this->_convertor->itemToOrderItem($item); + if ($item->getParentItem()) { + $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId())); + } + $order->addItem($orderItem); + } + + if ($customerDto) { + $order->setCustomerId($customerDto->getCustomerId()); + } + $order->setQuote($quote); + + $transaction->addObject($order); + $transaction->addCommitCallback(array($order, 'place')); + $transaction->addCommitCallback(array($order, 'save')); + + /** + * We can use configuration data for declare new order status + */ + $this->_eventManager->dispatch('checkout_type_onepage_save_order', array( + 'order' => $order, + 'quote' => $quote + )); + $this->_eventManager->dispatch('sales_model_service_quote_submit_before', array( + 'order' => $order, + 'quote' => $quote + )); + try { + $transaction->save(); + $this->_inactivateQuote(); + $this->_eventManager->dispatch('sales_model_service_quote_submit_success', array( + 'order' => $order, + 'quote' => $quote + )); + } catch (\Exception $e) { + if ($originalCustomerDto) { //Restore original customer data if existing customer was updated + $this->_customerService->saveCustomer($originalCustomerDto); + $this->_customerAddressService->saveAddresses($customerDto->getCustomerId(), $originalAddresses); + } else if ($customerDto->getCustomerId()) { // Delete if new customer created + $this->_customerService->deleteCustomer($customerDto->getCustomerId()); + $order->setCustomerId(null); + $quote->setCustomerData(new CustomerDto([])); + } + + //reset order ID's on exception, because order not saved + $order->setId(null); + /** @var $item \Magento\Sales\Model\Order\Item */ + foreach ($order->getItemsCollection() as $item) { + $item->setOrderId(null); + $item->setItemId(null); + } + $this->_eventManager->dispatch('sales_model_service_quote_submit_failure', array( 'order' => $order, 'quote' => $quote @@ -256,7 +440,7 @@ public function submitOrder() public function submitNominalItems() { $this->_validate(); - $this->_submitRecurringPaymentProfiles(); + $this->_eventManager->dispatch('sales_model_service_quote_submit_nominal_items', ['quote' => $this->_quote]); $this->_inactivateQuote(); $this->_deleteNominalItems(); } @@ -286,13 +470,27 @@ public function submitAll() } /** - * Return recurring payment profiles - * - * @return array + * Submit all available items + * All created items will be set to the object */ - public function getRecurringPaymentProfiles() + public function submitAllWithDto() { - return $this->_recurringPaymentProfiles; + // don't allow submitNominalItems() to inactivate quote + $inactivateQuoteOld = $this->_shouldInactivateQuote; + $this->_shouldInactivateQuote = false; + try { + $this->submitNominalItems(); + $this->_shouldInactivateQuote = $inactivateQuoteOld; + } catch (\Exception $e) { + $this->_shouldInactivateQuote = $inactivateQuoteOld; + throw $e; + } + // no need to submit the order if there are no normal items remained + if (!$this->_quote->getAllVisibleItems()) { + $this->_inactivateQuote(); + return; + } + $this->submitOrderWithDto(); } /** @@ -305,6 +503,16 @@ public function getOrder() return $this->_order; } + /** + * Get response when CustomerAccountService was invoked to create a new customer account + * + * @return CreateCustomerAccountResponse + */ + public function getCreateCustomerResponse() + { + return $this->_createCustomerResponse; + } + /** * Inactivate quote * @@ -355,23 +563,6 @@ protected function _validate() return $this; } - /** - * Submit recurring payment profiles - * - * @throws \Magento\Core\Exception - */ - protected function _submitRecurringPaymentProfiles() - { - $profiles = $this->_quote->prepareRecurringPaymentProfiles(); - foreach ($profiles as $profile) { - if (!$profile->isValid()) { - throw new \Magento\Core\Exception($profile->getValidationErrors()); - } - $profile->submit(); - } - $this->_recurringPaymentProfiles = $profiles; - } - /** * Get rid of all nominal items */ diff --git a/app/code/Magento/Sales/etc/adminhtml/events.xml b/app/code/Magento/Sales/etc/adminhtml/events.xml index 15b1da6be0fd3..14208c0c5334d 100644 --- a/app/code/Magento/Sales/etc/adminhtml/events.xml +++ b/app/code/Magento/Sales/etc/adminhtml/events.xml @@ -42,7 +42,7 @@ - + diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index 878e5c67a2c3b..237b770b2afe3 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -325,8 +325,8 @@ - - + + @@ -670,8 +670,8 @@ - - + + @@ -875,8 +875,8 @@ - - + + diff --git a/app/code/Magento/Sales/etc/frontend/page_types.xml b/app/code/Magento/Sales/etc/frontend/page_types.xml index a67bb6fdeda7a..8c69b1e6622be 100644 --- a/app/code/Magento/Sales/etc/frontend/page_types.xml +++ b/app/code/Magento/Sales/etc/frontend/page_types.xml @@ -44,6 +44,4 @@ - - diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index b1b4d2dfdc809..6f7a570a72044 100755 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -51,7 +51,6 @@ - diff --git a/app/code/Magento/Sales/etc/sales.xml b/app/code/Magento/Sales/etc/sales.xml index e488d13dc6b3a..176c8cbd3f4d5 100644 --- a/app/code/Magento/Sales/etc/sales.xml +++ b/app/code/Magento/Sales/etc/sales.xml @@ -33,8 +33,6 @@ - - diff --git a/app/code/Magento/Sales/i18n/de_DE.csv b/app/code/Magento/Sales/i18n/de_DE.csv index 8722d77720de0..ee82e2390ccc6 100644 --- a/app/code/Magento/Sales/i18n/de_DE.csv +++ b/app/code/Magento/Sales/i18n/de_DE.csv @@ -184,7 +184,7 @@ "Customer My Account Order Invoice View","Kundenbestellung My Account Ansicht der Rechnung" "Customer My Account Order Shipment View","Kundenbestellung My Account Ansicht der Lieferung" "Customer My Account Order View","Kundenbestellung My Account Ansicht" -"Customer\'s Current Activities","Aktuelle Aktionen des Kunden" +"Customer's Current Activities","Aktuelle Aktionen des Kunden" "Customs Value","Zollwert" "Date","Datum" "Default Status","Standardstatus" @@ -317,7 +317,7 @@ "Key","Schlüssel" "Last Name","Nachname des Kunden" "Last Ordered Items","Zuletzte bestellte Artikel" -"Last status can\'t be unassigned from state.","Letzter Status kann vom Zustand nicht entfernt werden." +"Last status can't be unassigned from state.","Letzter Status kann vom Zustand nicht entfernt werden." "Length","Länge" "Link to the New Order","Link zu neuer Bestellung" "Link to the Previous Order","Link zu vorheriger Bestellung" @@ -802,8 +802,8 @@ "Unknown Status","Unbekannter Status" "Unsupported transaction type ""%s"".","Nicht unterstützter Transaktionstyp ""%s""." "Update Changes","Änderungen aktualisieren" -"Update Items and Qty\'s","Artikel und Mengen aktualisieren" -"Update Qty\'s","Anzahl aktualisieren" +"Update Items and Qty's","Artikel und Mengen aktualisieren" +"Update Qty's","Anzahl aktualisieren" "Updated","Aktualisiert am" "Updated:","Aktualisiert:" "Use Aggregated Data (beta)","Gesamtdaten (Beta) verwenden" @@ -826,7 +826,7 @@ "Wrong quote item id to update configuration.","Falsche Angebotskennnummer zur Aktualisierung der Konfiguration." "Wrong state: ""%s"".","Falscher Zustand: ""%s""." "Yes","Ja" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","Sie können ein Eingabefeld leer lassen, wenn Sie keine Geschenkmitteilung für die gesamte Bestellung hinzufügen möchten." +"You can leave a box blank if you don't wish to add a gift message for whole order","Sie können ein Eingabefeld leer lassen, wenn Sie keine Geschenkmitteilung für die gesamte Bestellung hinzufügen möchten." "You have placed no orders.","Sie haben keine Bestellungen aufgegeben." "You will be redirected to the payment system website.","Sie werden zu der Zahlungssystem-Website weitergeleitet." "Your credit card will be charged for","Ihre Kreditkarte wird belastet mit" diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index 8a2e9ffcc2eca..4877505928262 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -185,7 +185,7 @@ "Customer My Account Order Invoice View","Customer My Account Order Invoice View" "Customer My Account Order Shipment View","Customer My Account Order Shipment View" "Customer My Account Order View","Customer My Account Order View" -"Customer\'s Current Activities","Customer\'s Current Activities" +"Customer's Current Activities","Customer's Current Activities" "Customs Value","Customs Value" "Date","Date" "Default Status","Default Status" @@ -319,7 +319,7 @@ "Key","Key" "Last Name","Last Name" "Last Ordered Items","Last Ordered Items" -"Last status can\'t be unassigned from state.","Last status can\'t be unassigned from state." +"Last status can't be unassigned from state.","Last status can't be unassigned from state." "Length","Length" "Link to the New Order","Link to the New Order" "Link to the Previous Order","Link to the Previous Order" @@ -805,8 +805,8 @@ "Unknown Status","Unknown Status" "Unsupported transaction type ""%s"".","Unsupported transaction type ""%s""." "Update Changes","Update Changes" -"Update Items and Qty\'s","Update Items and Qty\'s" -"Update Qty\'s","Update Qty\'s" +"Update Items and Qty's","Update Items and Qty's" +"Update Qty's","Update Qty's" "Updated","Updated" "Updated:","Updated:" "Use Aggregated Data (beta)","Use Aggregated Data (beta)" @@ -829,7 +829,7 @@ "Wrong quote item id to update configuration.","Wrong quote item id to update configuration." "Wrong state: ""%s"".","Wrong state: ""%s""." "Yes","Yes" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","You can leave a box blank if you don\'t wish to add a gift message for whole order" +"You can leave a box blank if you don't wish to add a gift message for whole order","You can leave a box blank if you don't wish to add a gift message for whole order" "You have placed no orders.","You have placed no orders." "You will be redirected to the payment system website.","You will be redirected to the payment system website." "Your credit card will be charged for","Your credit card will be charged for" diff --git a/app/code/Magento/Sales/i18n/es_ES.csv b/app/code/Magento/Sales/i18n/es_ES.csv index 03b03053b27fb..2d3fd7df75db4 100644 --- a/app/code/Magento/Sales/i18n/es_ES.csv +++ b/app/code/Magento/Sales/i18n/es_ES.csv @@ -184,7 +184,7 @@ "Customer My Account Order Invoice View","Vista de la factura del pedido de «mi cuenta» del cliente" "Customer My Account Order Shipment View","Vista del envío del pedido de «mi cuenta» del cliente" "Customer My Account Order View","Vista del pedido de «mi cuenta» del cliente" -"Customer\'s Current Activities","Actividades actuales del cliente" +"Customer's Current Activities","Actividades actuales del cliente" "Customs Value","Valor en Aduana" "Date","Fecha" "Default Status","Estado por defecto" @@ -317,7 +317,7 @@ "Key","Clave" "Last Name","Apellido del cliente" "Last Ordered Items","Últimos Artículos Pedidos" -"Last status can\'t be unassigned from state.","El último estado no puede estar sin asignar desde estado." +"Last status can't be unassigned from state.","El último estado no puede estar sin asignar desde estado." "Length","Longitud" "Link to the New Order","Enlace al Nuevo Pedido" "Link to the Previous Order","Enlace al Pedido Anterior" @@ -803,8 +803,8 @@ No hay etiquetas de envío para las %s seleccionadas. [[[if %s is feminine]]]" "Unknown Status","Estados desconocidos" "Unsupported transaction type ""%s"".","Tipo de transacción no admitida""%s""." "Update Changes","Actualizar Cambios" -"Update Items and Qty\'s","Actualizar artículos y cantidades" -"Update Qty\'s","Actualizar Cantidad/es" +"Update Items and Qty's","Actualizar artículos y cantidades" +"Update Qty's","Actualizar Cantidad/es" "Updated","Hora de actualización" "Updated:","Actualizado:" "Use Aggregated Data (beta)","Utilizar datos agregados (beta)" @@ -827,7 +827,7 @@ No hay etiquetas de envío para las %s seleccionadas. [[[if %s is feminine]]]" "Wrong quote item id to update configuration.","Número identificativo del artículo incorrecto para actualizar la configuración." "Wrong state: ""%s"".","Estado incorrecto: ""%s""." "Yes","Sí" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","Puedes dejar un campo en blanco si no deseas añadir un mensaje de regalo con el pedido" +"You can leave a box blank if you don't wish to add a gift message for whole order","Puedes dejar un campo en blanco si no deseas añadir un mensaje de regalo con el pedido" "You have placed no orders.","No has hecho ningún pedido." "You will be redirected to the payment system website.","Usted será redirigido a la página web del sistema de pago." "Your credit card will be charged for","Se cargará en tu tarjeta de crédito" diff --git a/app/code/Magento/Sales/i18n/fr_FR.csv b/app/code/Magento/Sales/i18n/fr_FR.csv index 49ac8d5789db8..a0665240cfce7 100644 --- a/app/code/Magento/Sales/i18n/fr_FR.csv +++ b/app/code/Magento/Sales/i18n/fr_FR.csv @@ -184,7 +184,7 @@ "Customer My Account Order Invoice View","Client Mon Compte Commande Facture Affichage" "Customer My Account Order Shipment View","Client Mon Compte Commande Livraison Affichage" "Customer My Account Order View","Client Mon Compte Commande Affichage" -"Customer\'s Current Activities","Activités en cours du client" +"Customer's Current Activities","Activités en cours du client" "Customs Value","Valeurs personnalisées" "Date","Date" "Default Status","État pas défaut" @@ -317,7 +317,7 @@ "Key","Clé" "Last Name","Nom du client" "Last Ordered Items","Derniers articles commandés" -"Last status can\'t be unassigned from state.","Le dernier statut ne peut pas être retiré de l'État." +"Last status can't be unassigned from state.","Le dernier statut ne peut pas être retiré de l'État." "Length","Longueur" "Link to the New Order","Lien vers la nouvelle commande" "Link to the Previous Order","Lien vers la commande précédente" @@ -802,8 +802,8 @@ "Unknown Status","Statut inconnu" "Unsupported transaction type ""%s"".","Type de transaction inconnu ""%s""." "Update Changes","Mettre à jour les changements" -"Update Items and Qty\'s","Mettre à jour les articles et quantités" -"Update Qty\'s","Mettre à jour la/les Qté(s)" +"Update Items and Qty's","Mettre à jour les articles et quantités" +"Update Qty's","Mettre à jour la/les Qté(s)" "Updated","Mis à jour à" "Updated:","Mis à jour :" "Use Aggregated Data (beta)","Utiliser données agrégées (beta)" @@ -826,7 +826,7 @@ "Wrong quote item id to update configuration.","L'identification du produit sélectionné est incorrecte et la configuration ne peut pas être mise à jour." "Wrong state: ""%s"".","État incorrect : ""%s""." "Yes","oui" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","Vous pouvez laisser une case vide si vous ne voulez pas ajouter un message de cadeau pour l'ensemble de la commande" +"You can leave a box blank if you don't wish to add a gift message for whole order","Vous pouvez laisser une case vide si vous ne voulez pas ajouter un message de cadeau pour l'ensemble de la commande" "You have placed no orders.","Vous n'avez pas de commande." "You will be redirected to the payment system website.","Vous allez être redirigé vers le site de paiement en ligne." "Your credit card will be charged for","Votre carte de crédit sera débitée pour" diff --git a/app/code/Magento/Sales/i18n/nl_NL.csv b/app/code/Magento/Sales/i18n/nl_NL.csv index 1c4961b60378b..d881fdfbc9635 100644 --- a/app/code/Magento/Sales/i18n/nl_NL.csv +++ b/app/code/Magento/Sales/i18n/nl_NL.csv @@ -184,7 +184,7 @@ "Customer My Account Order Invoice View","Klant mijn rekening bestelling factuur weergave" "Customer My Account Order Shipment View","Klant mijn rekening bestelling verzending weergave" "Customer My Account Order View","Klant mijn rekening bestelling weergave" -"Customer\'s Current Activities","Recente bezigheden van de klant" +"Customer's Current Activities","Recente bezigheden van de klant" "Customs Value","Douanewaarde" "Date","Datum" "Default Status","Standaard Status" @@ -317,7 +317,7 @@ "Key","sleutel" "Last Name","Klant Achternaam" "Last Ordered Items","laatst bestelde items" -"Last status can\'t be unassigned from state.","Laatste status kan niet vanuit staat herbenoemd worden." +"Last status can't be unassigned from state.","Laatste status kan niet vanuit staat herbenoemd worden." "Length","Lengte" "Link to the New Order","link naar de nieuwe bestelling" "Link to the Previous Order","link naar de vorige bestelling" @@ -802,8 +802,8 @@ "Unknown Status","Onbekende Status" "Unsupported transaction type ""%s"".","Niet ondersteund transactie type ""%s""." "Update Changes","Bijwerken Veranderingen" -"Update Items and Qty\'s","aanpassen items en hoeveelheden" -"Update Qty\'s","Aantal(en) bijwerken" +"Update Items and Qty's","aanpassen items en hoeveelheden" +"Update Qty's","Aantal(en) bijwerken" "Updated","Geüpdate op" "Updated:","Bijgewerkt:" "Use Aggregated Data (beta)","Gebruik Verzamelde Data (beta)" @@ -826,7 +826,7 @@ "Wrong quote item id to update configuration.","Verkeerde quote artikel id voor update configuratie." "Wrong state: ""%s"".","Verkeerde status: ""%s""." "Yes","Ja" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","U kunt een doos leeg laten als u geen cadeauboodschap voor de hele bestelling wilt toevoegen" +"You can leave a box blank if you don't wish to add a gift message for whole order","U kunt een doos leeg laten als u geen cadeauboodschap voor de hele bestelling wilt toevoegen" "You have placed no orders.","U heeft geen bestellingen geplaatst." "You will be redirected to the payment system website.","U zal worden omgeleid naar de website van het betalingssysteem." "Your credit card will be charged for","Uw creditcard zal in rekening gebracht worden voor" diff --git a/app/code/Magento/Sales/i18n/pt_BR.csv b/app/code/Magento/Sales/i18n/pt_BR.csv index 1db1b6174aa40..5c6df9024fb19 100644 --- a/app/code/Magento/Sales/i18n/pt_BR.csv +++ b/app/code/Magento/Sales/i18n/pt_BR.csv @@ -184,7 +184,7 @@ "Customer My Account Order Invoice View","Ver Faturamento do Pedido do Cliente" "Customer My Account Order Shipment View","Ver Pedidos Pagos do Cliente" "Customer My Account Order View","Ver Pedido do Cliente" -"Customer\'s Current Activities","Atividades Atuais do Cliente" +"Customer's Current Activities","Atividades Atuais do Cliente" "Customs Value","Valores Aduaneiros" "Date","Data" "Default Status","Status Padrão" @@ -317,7 +317,7 @@ "Key","Senha" "Last Name","Último Nome do Cliente" "Last Ordered Items","Últimos itens pedidos" -"Last status can\'t be unassigned from state.","O último estado não pode ser revertido." +"Last status can't be unassigned from state.","O último estado não pode ser revertido." "Length","Comprimento" "Link to the New Order","Link para o Novo Pedido" "Link to the Previous Order","Link para o Pedido Anterior" @@ -802,8 +802,8 @@ "Unknown Status","Status desconhecido" "Unsupported transaction type ""%s"".","O tipo de transação ""%s"" não é suportado." "Update Changes","Atualizar alterações" -"Update Items and Qty\'s","Atualizar Itens e Quantidades" -"Update Qty\'s","Atualizar qtde." +"Update Items and Qty's","Atualizar Itens e Quantidades" +"Update Qty's","Atualizar qtde." "Updated","Atualizado Em" "Updated:","Atualizado:" "Use Aggregated Data (beta)","Usar dados agregados (beta)" @@ -826,7 +826,7 @@ "Wrong quote item id to update configuration.","ID da cotação do item errada para atualizar configuração." "Wrong state: ""%s"".","Estado inadequado: ""%s""." "Yes","Sim" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","Você pode deixar um quadro em branco se não desejar adicionar uma mensagem pessoal para todo o pedido" +"You can leave a box blank if you don't wish to add a gift message for whole order","Você pode deixar um quadro em branco se não desejar adicionar uma mensagem pessoal para todo o pedido" "You have placed no orders.","Não há pedidos feitos." "You will be redirected to the payment system website.","Você será redirecionado para o site de sistema de pagamentos." "Your credit card will be charged for","O seu cartão de crédito será cobrado por" diff --git a/app/code/Magento/Sales/i18n/zh_CN.csv b/app/code/Magento/Sales/i18n/zh_CN.csv index 535be8dcca5f8..a4b95be64c352 100644 --- a/app/code/Magento/Sales/i18n/zh_CN.csv +++ b/app/code/Magento/Sales/i18n/zh_CN.csv @@ -184,7 +184,7 @@ "Customer My Account Order Invoice View","客户我的帐户订单发票视图" "Customer My Account Order Shipment View","客户我的帐户订单发货视图" "Customer My Account Order View","客户我的帐户订单视图" -"Customer\'s Current Activities","客户的当前活动" +"Customer's Current Activities","客户的当前活动" "Customs Value","自定义值" "Date","日期" "Default Status","默认状态" @@ -317,7 +317,7 @@ "Key","密钥" "Last Name","客户姓氏" "Last Ordered Items","上次订购的商品" -"Last status can\'t be unassigned from state.","上次状态无法被取消分配。" +"Last status can't be unassigned from state.","上次状态无法被取消分配。" "Length","长度" "Link to the New Order","链接到新订单" "Link to the Previous Order","连接到前一订单" @@ -802,8 +802,8 @@ "Unknown Status","位置状态" "Unsupported transaction type ""%s"".","不支持的交易类型""%s""。" "Update Changes","更新更改" -"Update Items and Qty\'s","更新项目与数量" -"Update Qty\'s","更新数量" +"Update Items and Qty's","更新项目与数量" +"Update Qty's","更新数量" "Updated","更新于" "Updated:","更新时间:" "Use Aggregated Data (beta)","使用聚合数据(测试版)" @@ -826,7 +826,7 @@ "Wrong quote item id to update configuration.","更新配置的报价项目ID错误。" "Wrong state: ""%s"".","州错误:""%s""" "Yes","是" -"You can leave a box blank if you don\'t wish to add a gift message for whole order","如果不希望为整个订单添加礼品信息,即可在这里留空" +"You can leave a box blank if you don't wish to add a gift message for whole order","如果不希望为整个订单添加礼品信息,即可在这里留空" "You have placed no orders.","您没有下订单。" "You will be redirected to the payment system website.","您将被重定向到支付系统网站。" "Your credit card will be charged for","您的信用卡将被收取" diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php index a688a137a2d8f..ec9ee97ec9ad1 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php @@ -35,18 +35,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php index b0f66bc8acf08..b1725fcc90abc 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php @@ -49,7 +49,7 @@ class Actions /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Config\Source\Yesno $sourceYesno * @param \Magento\Rule\Block\Actions $ruleActions @@ -58,7 +58,7 @@ class Actions */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Config\Source\Yesno $sourceYesno, \Magento\Rule\Block\Actions $ruleActions, diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php index 8eda9026e69ea..8bebe422b7108 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php @@ -44,7 +44,7 @@ class Conditions /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Rule\Block\Conditions $conditions * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset @@ -52,7 +52,7 @@ class Conditions */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Rule\Block\Conditions $conditions, \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php index 91ba7cbf264fe..47369de617bf8 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php @@ -40,18 +40,18 @@ class Coupons /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\View\Element\Context $context * @param array $data */ public function __construct( \Magento\View\Element\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php index 3be37751cffbc..7c4f41896ea79 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php @@ -46,14 +46,14 @@ class Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\SalesRule\Helper\Coupon $salesRuleCoupon * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\SalesRule\Helper\Coupon $salesRuleCoupon, array $data = array() diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php index 35da87ab0f25f..55fba8af09fb9 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -39,7 +39,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -52,14 +52,14 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\SalesRule\Model\Resource\Coupon\CollectionFactory $salesRuleCoupon - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\SalesRule\Model\Resource\Coupon\CollectionFactory $salesRuleCoupon, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php index 8e6a54f6d0624..111f2fd2e4409 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php @@ -54,7 +54,7 @@ class Main /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\SalesRule\Model\RuleFactory $salesRule * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup @@ -63,7 +63,7 @@ class Main */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\SalesRule\Model\RuleFactory $salesRule, \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup, diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php index f7c88fa3de781..38e4b7b519282 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php @@ -31,7 +31,7 @@ class Quote extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -47,13 +47,13 @@ class Quote extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\Response\Http\FileFactory $fileFactory * @param \Magento\Core\Filter\Date $dateFilter */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\Response\Http\FileFactory $fileFactory, \Magento\Core\Filter\Date $dateFilter ) { diff --git a/app/code/Magento/SalesRule/Model/Coupon.php b/app/code/Magento/SalesRule/Model/Coupon.php index 36b685d215248..248a12c482460 100644 --- a/app/code/Magento/SalesRule/Model/Coupon.php +++ b/app/code/Magento/SalesRule/Model/Coupon.php @@ -24,6 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\SalesRule\Model; /** * SalesRule Coupon Model @@ -46,13 +47,7 @@ * @method \Magento\SalesRule\Model\Coupon setIsPrimary(int $value) * @method int getType() * @method \Magento\SalesRule\Model\Coupon setType(int $value) - * - * @category Magento - * @package Magento_SalesRule - * @author Magento Core Team */ -namespace Magento\SalesRule\Model; - class Coupon extends \Magento\Core\Model\AbstractModel { /** diff --git a/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php b/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php index e86ccc31a389e..bae822660e9cb 100644 --- a/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php +++ b/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php @@ -74,8 +74,8 @@ class Massgenerator extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\SalesRule\Helper\Coupon $salesRuleCoupon * @param \Magento\SalesRule\Model\CouponFactory $couponFactory * @param \Magento\Core\Model\Date $date @@ -85,8 +85,8 @@ class Massgenerator extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\SalesRule\Helper\Coupon $salesRuleCoupon, \Magento\SalesRule\Model\CouponFactory $couponFactory, \Magento\Core\Model\Date $date, diff --git a/app/code/Magento/SalesRule/Model/Quote/Discount.php b/app/code/Magento/SalesRule/Model/Quote/Discount.php index fa4f2e7788466..9e3d5bd6ad412 100644 --- a/app/code/Magento/SalesRule/Model/Quote/Discount.php +++ b/app/code/Magento/SalesRule/Model/Quote/Discount.php @@ -93,6 +93,7 @@ public function collect(\Magento\Sales\Model\Quote\Address $address) $address->setDiscountDescription(array()); + $items = $this->_calculator->sortItemsByPriority($items); foreach ($items as $item) { if ($item->getNoDiscount()) { $item->setDiscountAmount(0); diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php b/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php index 0e108fc7da061..842b37aae9d19 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php @@ -114,20 +114,33 @@ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = $this->addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now); $select = $this->getSelect(); + $connection = $this->getConnection(); if (strlen($couponCode)) { $select->joinLeft( array('rule_coupons' => $this->getTable('salesrule_coupon')), - 'main_table.rule_id = rule_coupons.rule_id ', + $connection->quoteInto( + 'main_table.rule_id = rule_coupons.rule_id AND main_table.coupon_type != ?', + \Magento\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON + ), array('code') ); - $select->where('(main_table.coupon_type = ? ', \Magento\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON) - ->orWhere('(main_table.coupon_type = ? AND rule_coupons.type = 0', - \Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO) - ->orWhere('main_table.coupon_type = ? AND main_table.use_auto_generation = 1 ' . - 'AND rule_coupons.type = 1', \Magento\SalesRule\Model\Rule::COUPON_TYPE_SPECIFIC) - ->orWhere('main_table.coupon_type = ? AND main_table.use_auto_generation = 0 ' . - 'AND rule_coupons.type = 0)', \Magento\SalesRule\Model\Rule::COUPON_TYPE_SPECIFIC) - ->where('rule_coupons.code = ?)', $couponCode); + $select->where('main_table.coupon_type = ? ', \Magento\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON); + $orWhereConditions = array( + $connection->quoteInto( + '(main_table.coupon_type = ? AND rule_coupons.type = 0)', + \Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO + ), + $connection->quoteInto( + '(main_table.coupon_type = ? AND main_table.use_auto_generation = 1 AND rule_coupons.type = 1)', + \Magento\SalesRule\Model\Rule::COUPON_TYPE_SPECIFIC + ), + $connection->quoteInto( + '(main_table.coupon_type = ? AND main_table.use_auto_generation = 0 AND rule_coupons.type = 0)', + \Magento\SalesRule\Model\Rule::COUPON_TYPE_SPECIFIC + ), + ); + $orWhereCondition = implode(' OR ', $orWhereConditions); + $select->orWhere('(' . $orWhereCondition . ') AND rule_coupons.code = ?', $couponCode); } else { $this->addFieldToFilter('main_table.coupon_type', \Magento\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON); } diff --git a/app/code/Magento/SalesRule/Model/Rule.php b/app/code/Magento/SalesRule/Model/Rule.php index 7b23e8c21db22..7e3999295553a 100644 --- a/app/code/Magento/SalesRule/Model/Rule.php +++ b/app/code/Magento/SalesRule/Model/Rule.php @@ -24,6 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\SalesRule\Model; /** * Shopping Cart Rule data model @@ -81,13 +82,9 @@ * @method \Magento\SalesRule\Model\Rule setUseAutoGeneration(int $value) * @method string getCouponCode() * @method \Magento\SalesRule\Model\Rule setCouponCode(string $value) - * - * @category Magento - * @package Magento_SalesRule - * @author Magento Core Team + * @method int getRuleId() + * @method \Magento\SalesRule\Model\Rule setRuleId(int $ruleId) */ -namespace Magento\SalesRule\Model; - class Rule extends \Magento\Rule\Model\AbstractModel { /** @@ -208,8 +205,8 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\SalesRule\Model\CouponFactory $couponFactory @@ -223,8 +220,8 @@ class Rule extends \Magento\Rule\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\SalesRule\Model\CouponFactory $couponFactory, diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/AbstractDiscount.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/AbstractDiscount.php new file mode 100644 index 0000000000000..05eef8ffe185d --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/AbstractDiscount.php @@ -0,0 +1,70 @@ +validator = $validator; + $this->discountFactory = $discountDataFactory; + } + + /** + * @param \Magento\SalesRule\Model\Rule $rule + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param float $qty + * @return \Magento\SalesRule\Model\Rule\Action\Discount\Data + */ + abstract public function calculate($rule, $item, $qty); + + /** + * @param float $qty + * @param \Magento\SalesRule\Model\Rule $rule + * @return float + */ + public function fixQuantity($qty, $rule) + { + return $qty; + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/BuyXGetY.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/BuyXGetY.php new file mode 100644 index 0000000000000..02ee578653ceb --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/BuyXGetY.php @@ -0,0 +1,69 @@ +discountFactory->create(); + + $itemPrice = $this->validator->getItemPrice($item); + $baseItemPrice = $this->validator->getItemBasePrice($item); + $itemOriginalPrice = $this->validator->getItemOriginalPrice($item); + $baseItemOriginalPrice = $this->validator->getItemBaseOriginalPrice($item); + + $x = $rule->getDiscountStep(); + $y = $rule->getDiscountAmount(); + if (!$x || $y > $x) { + return $discountData; + } + $buyAndDiscountQty = $x + $y; + + $fullRuleQtyPeriod = floor($qty / $buyAndDiscountQty); + $freeQty = $qty - $fullRuleQtyPeriod * $buyAndDiscountQty; + + $discountQty = $fullRuleQtyPeriod * $y; + if ($freeQty > $x) { + $discountQty += $freeQty - $x; + } + + $discountData->setAmount($discountQty * $itemPrice); + $discountData->setBaseAmount($discountQty * $baseItemPrice); + $discountData->setOriginalAmount($discountQty * $itemOriginalPrice); + $discountData->setBaseOriginalAmount($discountQty * $baseItemOriginalPrice); + + return $discountData; + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ByFixed.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ByFixed.php new file mode 100644 index 0000000000000..cfba0e29828bf --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ByFixed.php @@ -0,0 +1,63 @@ +discountFactory->create(); + + $quoteAmount = $item->getQuote()->getStore()->convertPrice($rule->getDiscountAmount()); + $discountData->setAmount($qty * $quoteAmount); + $discountData->setBaseAmount($qty * $rule->getDiscountAmount()); + + return $discountData; + } + + /** + * @param float $qty + * @param \Magento\SalesRule\Model\Rule $rule + * @return float + */ + public function fixQuantity($qty, $rule) + { + $step = $rule->getDiscountStep(); + if ($step) { + $qty = floor($qty / $step) * $step; + } + + return $qty; + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ByPercent.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ByPercent.php new file mode 100644 index 0000000000000..8c869917594f2 --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ByPercent.php @@ -0,0 +1,94 @@ +getDiscountAmount()); + $discountData = $this->_calculate($rule, $item, $qty, $rulePercent); + + return $discountData; + } + + /** + * @param float $qty + * @param \Magento\SalesRule\Model\Rule $rule + * @return float + */ + public function fixQuantity($qty, $rule) + { + $step = $rule->getDiscountStep(); + if ($step) { + $qty = floor($qty / $step) * $step; + } + + return $qty; + } + + /** + * @param \Magento\SalesRule\Model\Rule $rule + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param float $qty + * @param $rulePercent + * @return Data + */ + protected function _calculate($rule, $item, $qty, $rulePercent) + { + /** @var \Magento\SalesRule\Model\Rule\Action\Discount\Data $discountData */ + $discountData = $this->discountFactory->create(); + + $itemPrice = $this->validator->getItemPrice($item); + $baseItemPrice = $this->validator->getItemBasePrice($item); + $itemOriginalPrice = $this->validator->getItemOriginalPrice($item); + $baseItemOriginalPrice = $this->validator->getItemBaseOriginalPrice($item); + + $_rulePct = $rulePercent / 100; + $discountData->setAmount(($qty * $itemPrice - $item->getDiscountAmount()) * $_rulePct); + $discountData->setBaseAmount(($qty * $baseItemPrice - $item->getBaseDiscountAmount()) * $_rulePct); + $discountData->setOriginalAmount( + ($qty * $itemOriginalPrice - $item->getDiscountAmount()) * $_rulePct + ); + $discountData->setBaseOriginalAmount( + ($qty * $baseItemOriginalPrice - $item->getDiscountAmount()) * $_rulePct + ); + + if (!$rule->getDiscountQty() || $rule->getDiscountQty() > $qty) { + $discountPercent = min(100, $item->getDiscountPercent() + $rulePercent); + $item->setDiscountPercent($discountPercent); + } + + return $discountData; + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CalculatorFactory.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CalculatorFactory.php new file mode 100644 index 0000000000000..bd86e1a57a43c --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CalculatorFactory.php @@ -0,0 +1,70 @@ + 'Magento\SalesRule\Model\Rule\Action\Discount\ToPercent', + \Magento\SalesRule\Model\Rule::BY_PERCENT_ACTION => 'Magento\SalesRule\Model\Rule\Action\Discount\ByPercent', + \Magento\SalesRule\Model\Rule::TO_FIXED_ACTION => 'Magento\SalesRule\Model\Rule\Action\Discount\ToFixed', + \Magento\SalesRule\Model\Rule::BY_FIXED_ACTION => 'Magento\SalesRule\Model\Rule\Action\Discount\ByFixed', + \Magento\SalesRule\Model\Rule::CART_FIXED_ACTION => 'Magento\SalesRule\Model\Rule\Action\Discount\CartFixed', + \Magento\SalesRule\Model\Rule::BUY_X_GET_Y_ACTION => 'Magento\SalesRule\Model\Rule\Action\Discount\BuyXGetY', + ); + + /** + * @param \Magento\ObjectManager $objectManager + * @param array $discountRules + */ + public function __construct(\Magento\ObjectManager $objectManager, array $discountRules = array()) + { + $this->classByType = array_merge($this->classByType, $discountRules); + $this->_objectManager = $objectManager; + } + + /** + * @param string $type + * @return \Magento\SalesRule\Model\Rule\Action\Discount\DiscountInterface + * @throws \InvalidArgumentException + */ + public function create($type) + { + if (!isset($this->classByType[$type])) { + throw new \InvalidArgumentException($type . ' is unknown type'); + } + + return $this->_objectManager->create($this->classByType[$type]); + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php new file mode 100644 index 0000000000000..2d3c5d3d3cdcf --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php @@ -0,0 +1,128 @@ +discountFactory->create(); + + $ruleTotals = $this->validator->getRuleItemTotalsInfo($rule->getId()); + + $quote = $item->getQuote(); + $address = $item->getAddress(); + + $itemPrice = $this->validator->getItemPrice($item); + $baseItemPrice = $this->validator->getItemBasePrice($item); + $itemOriginalPrice = $this->validator->getItemOriginalPrice($item); + $baseItemOriginalPrice = $this->validator->getItemBaseOriginalPrice($item); + + /** + * prevent applying whole cart discount for every shipping order, but only for first order + */ + if ($quote->getIsMultiShipping()) { + $usedForAddressId = $this->getCartFixedRuleUsedForAddress($rule->getId()); + if ($usedForAddressId && $usedForAddressId != $address->getId()) { + return $discountData; + } else { + $this->setCartFixedRuleUsedForAddress($rule->getId(), $address->getId()); + } + } + $cartRules = $address->getCartFixedRules(); + if (!isset($cartRules[$rule->getId()])) { + $cartRules[$rule->getId()] = $rule->getDiscountAmount(); + } + + if ($cartRules[$rule->getId()] > 0) { + $store = $quote->getStore(); + if ($ruleTotals['items_count'] <= 1) { + $quoteAmount = $store->convertPrice($cartRules[$rule->getId()]); + $baseDiscountAmount = min($baseItemPrice * $qty, $cartRules[$rule->getId()]); + } else { + $discountRate = $baseItemPrice * $qty / $ruleTotals['base_items_price']; + $maximumItemDiscount = $rule->getDiscountAmount() * $discountRate; + $quoteAmount = $store->convertPrice($maximumItemDiscount); + + $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); + $this->validator->decrementRuleItemTotalsCount($rule->getId()); + } + + $baseDiscountAmount = $store->roundPrice($baseDiscountAmount); + + $cartRules[$rule->getId()] -= $baseDiscountAmount; + + $discountData->setAmount($store->roundPrice(min($itemPrice * $qty, $quoteAmount))); + $discountData->setBaseAmount($baseDiscountAmount); + $discountData->setOriginalAmount(min($itemOriginalPrice * $qty, $quoteAmount)); + $discountData->setBaseOriginalAmount($store->roundPrice($baseItemOriginalPrice)); + } + $address->setCartFixedRules($cartRules); + + return $discountData; + } + + /** + * Set information about usage cart fixed rule by quote address + * + * @param int $ruleId + * @param int $itemId + * @return void + */ + protected function setCartFixedRuleUsedForAddress($ruleId, $itemId) + { + $this->_cartFixedRuleUsedForAddress[$ruleId] = $itemId; + } + + /** + * Retrieve information about usage cart fixed rule by quote address + * + * @param int $ruleId + * @return int|null + */ + protected function getCartFixedRuleUsedForAddress($ruleId) + { + if (isset($this->_cartFixedRuleUsedForAddress[$ruleId])) { + return $this->_cartFixedRuleUsedForAddress[$ruleId]; + } + return null; + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/Data.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/Data.php new file mode 100644 index 0000000000000..ab2b25a029f23 --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/Data.php @@ -0,0 +1,134 @@ +setAmount(0); + $this->setBaseAmount(0); + $this->setOriginalAmount(0); + $this->setBaseOriginalAmount(0); + } + + /** + * @param float $amount + * @return $this + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } + + /** + * @return float + */ + public function getAmount() + { + return $this->amount; + } + + /** + * @param float $baseAmount + * @return $this + */ + public function setBaseAmount($baseAmount) + { + $this->baseAmount = $baseAmount; + return $this; + } + + /** + * @return float + */ + public function getBaseAmount() + { + return $this->baseAmount; + } + + /** + * @param float $originalAmount + * @return $this + */ + public function setOriginalAmount($originalAmount) + { + $this->originalAmount = $originalAmount; + return $this; + } + + /** + * Get discount for original price + * + * @return float + */ + public function getOriginalAmount() + { + return $this->originalAmount; + } + + /** + * @param float $baseOriginalAmount + * @return $this + */ + public function setBaseOriginalAmount($baseOriginalAmount) + { + $this->baseOriginalAmount = $baseOriginalAmount; + return $this; + } + + /** + * Get discount for original price + * + * @return float + */ + public function getBaseOriginalAmount() + { + return $this->baseOriginalAmount; + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/DiscountInterface.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/DiscountInterface.php new file mode 100644 index 0000000000000..62005361ca1e1 --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/DiscountInterface.php @@ -0,0 +1,45 @@ +discountFactory->create(); + + $store = $item->getQuote()->getStore(); + + $itemPrice = $this->validator->getItemPrice($item); + $baseItemPrice = $this->validator->getItemBasePrice($item); + $itemOriginalPrice = $this->validator->getItemOriginalPrice($item); + $baseItemOriginalPrice = $this->validator->getItemBaseOriginalPrice($item); + + $quoteAmount = $store->convertPrice($rule->getDiscountAmount()); + + $discountData->setAmount($qty * ($itemPrice - $quoteAmount)); + $discountData->setBaseAmount($qty * ($baseItemPrice - $rule->getDiscountAmount())); + $discountData->setOriginalAmount($qty * ($itemOriginalPrice - $quoteAmount)); + $discountData->setBaseOriginalAmount($qty * ($baseItemOriginalPrice - $rule->getDiscountAmount())); + + return $discountData; + + } +} diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ToPercent.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ToPercent.php new file mode 100644 index 0000000000000..e1fe609f52f9d --- /dev/null +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/ToPercent.php @@ -0,0 +1,44 @@ +getDiscountAmount()); + $discountData = $this->_calculate($rule, $item, $qty, $rulePercent); + + return $discountData; + } +} diff --git a/app/code/Magento/SalesRule/Model/System/Config/Source/Coupon/Format.php b/app/code/Magento/SalesRule/Model/System/Config/Source/Coupon/Format.php index 1ce3047cf280d..00255b0476806 100644 --- a/app/code/Magento/SalesRule/Model/System/Config/Source/Coupon/Format.php +++ b/app/code/Magento/SalesRule/Model/System/Config/Source/Coupon/Format.php @@ -33,7 +33,7 @@ */ namespace Magento\SalesRule\Model\System\Config\Source\Coupon; -class Format implements \Magento\Core\Model\Option\ArrayInterface +class Format implements \Magento\Option\ArrayInterface { /** * Sales rule coupon diff --git a/app/code/Magento/SalesRule/Model/Validator.php b/app/code/Magento/SalesRule/Model/Validator.php index 3c75516e831eb..9a36d3423fcac 100644 --- a/app/code/Magento/SalesRule/Model/Validator.php +++ b/app/code/Magento/SalesRule/Model/Validator.php @@ -24,18 +24,20 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\SalesRule\Model; /** * SalesRule Validator Model * * Allows dispatching before and after events for each controller action * - * @category Magento - * @package Magento_SalesRule - * @author Magento Core Team + * @method mixed getCouponCode() + * @method \Magento\SalesRule\Model\Validator setCouponCode($code) + * @method mixed getWebsiteId() + * @method \Magento\SalesRule\Model\Validator setWebsiteId($id) + * @method mixed getCustomerGroupId() + * @method \Magento\SalesRule\Model\Validator setCustomerGroupId($id) */ -namespace Magento\SalesRule\Model; - class Validator extends \Magento\Core\Model\AbstractModel { /** @@ -63,13 +65,6 @@ class Validator extends \Magento\Core\Model\AbstractModel */ protected $_rulesItemTotals = array(); - /** - * Store information about addresses which cart fixed rule applied for - * - * @var array - */ - protected $_cartFixedRuleUsedForAddress = array(); - /** * Skip action rules validation flag * @@ -104,25 +99,39 @@ class Validator extends \Magento\Core\Model\AbstractModel protected $_customerFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @var \Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory + */ + protected $calculatorFactory; + + /** + * Defines if rule with stop further rules is already applied + * + * @var bool + */ + protected $_stopFurtherRules = false; + + /** + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\SalesRule\Model\Resource\Coupon\UsageFactory $usageFactory * @param \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\SalesRule\Model\CouponFactory $couponFactory * @param \Magento\SalesRule\Model\Rule\CustomerFactory $customerFactory + * @param \Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory $calculatorFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\SalesRule\Model\Resource\Coupon\UsageFactory $usageFactory, \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory, \Magento\Tax\Helper\Data $taxData, \Magento\SalesRule\Model\CouponFactory $couponFactory, \Magento\SalesRule\Model\Rule\CustomerFactory $customerFactory, + \Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory $calculatorFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -132,6 +141,7 @@ public function __construct( $this->_taxData = $taxData; $this->_couponFactory = $couponFactory; $this->_customerFactory = $customerFactory; + $this->calculatorFactory = $calculatorFactory; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -190,6 +200,7 @@ protected function _canProcessRule($rule, $address) if ($rule->getCouponType() != \Magento\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON) { $couponCode = $address->getQuote()->getCouponCode(); if (strlen($couponCode)) { + /** @var \Magento\SalesRule\Model\Coupon $coupon */ $coupon = $this->_couponFactory->create(); $coupon->load($couponCode, 'code'); if ($coupon->getId()) { @@ -335,228 +346,22 @@ public function reset(\Magento\Sales\Model\Quote\Address $address) /** * Quote item discount calculation process * - * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item - * @return \Magento\SalesRule\Model\Validator + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return \Magento\SalesRule\Model\Validator */ public function process(\Magento\Sales\Model\Quote\Item\AbstractItem $item) { $item->setDiscountAmount(0); $item->setBaseDiscountAmount(0); $item->setDiscountPercent(0); - $quote = $item->getQuote(); - $address = $item->getAddress(); - - $itemPrice = $this->_getItemPrice($item); - $baseItemPrice = $this->_getItemBasePrice($item); - $itemOriginalPrice = $this->_getItemOriginalPrice($item); - $baseItemOriginalPrice = $this->_getItemBaseOriginalPrice($item); + $itemPrice = $this->getItemPrice($item); if ($itemPrice < 0) { return $this; } - $appliedRuleIds = array(); - foreach ($this->_getRules() as $rule) { - /* @var $rule \Magento\SalesRule\Model\Rule */ - if (!$this->_canProcessRule($rule, $address)) { - continue; - } - - if (!$this->_skipActionsValidation && !$rule->getActions()->validate($item)) { - continue; - } - - $qty = $this->_getItemQty($item, $rule); - $rulePercent = min(100, $rule->getDiscountAmount()); - - $discountAmount = 0; - $baseDiscountAmount = 0; - //discount for original price - $originalDiscountAmount = 0; - $baseOriginalDiscountAmount = 0; - - switch ($rule->getSimpleAction()) { - case \Magento\SalesRule\Model\Rule::TO_PERCENT_ACTION: - $rulePercent = max(0, 100-$rule->getDiscountAmount()); - //no break; - case \Magento\SalesRule\Model\Rule::BY_PERCENT_ACTION: - $step = $rule->getDiscountStep(); - if ($step) { - $qty = floor($qty/$step)*$step; - } - $_rulePct = $rulePercent/100; - $discountAmount = ($qty*$itemPrice - $item->getDiscountAmount()) * $_rulePct; - $baseDiscountAmount= ($qty*$baseItemPrice - $item->getBaseDiscountAmount()) * $_rulePct; - //get discount for original price - $originalDiscountAmount = ($qty*$itemOriginalPrice - $item->getDiscountAmount()) * $_rulePct; - $baseOriginalDiscountAmount= ($qty*$baseItemOriginalPrice - $item->getDiscountAmount()) * $_rulePct; - - if (!$rule->getDiscountQty() || $rule->getDiscountQty()>$qty) { - $discountPercent = min(100, $item->getDiscountPercent()+$rulePercent); - $item->setDiscountPercent($discountPercent); - } - break; - case \Magento\SalesRule\Model\Rule::TO_FIXED_ACTION: - $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount()); - $discountAmount = $qty*($itemPrice-$quoteAmount); - $baseDiscountAmount= $qty*($baseItemPrice-$rule->getDiscountAmount()); - //get discount for original price - $originalDiscountAmount = $qty*($itemOriginalPrice-$quoteAmount); - $baseOriginalDiscountAmount= $qty*($baseItemOriginalPrice-$rule->getDiscountAmount()); - break; - - case \Magento\SalesRule\Model\Rule::BY_FIXED_ACTION: - $step = $rule->getDiscountStep(); - if ($step) { - $qty = floor($qty/$step)*$step; - } - $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount()); - $discountAmount = $qty*$quoteAmount; - $baseDiscountAmount = $qty*$rule->getDiscountAmount(); - break; - - case \Magento\SalesRule\Model\Rule::CART_FIXED_ACTION: - if (empty($this->_rulesItemTotals[$rule->getId()])) { - throw new \Magento\Core\Exception(__('Item totals are not set for the rule.')); - } - - /** - * prevent applying whole cart discount for every shipping order, but only for first order - */ - if ($quote->getIsMultiShipping()) { - $usedForAddressId = $this->getCartFixedRuleUsedForAddress($rule->getId()); - if ($usedForAddressId && $usedForAddressId != $address->getId()) { - break; - } else { - $this->setCartFixedRuleUsedForAddress($rule->getId(), $address->getId()); - } - } - $cartRules = $address->getCartFixedRules(); - if (!isset($cartRules[$rule->getId()])) { - $cartRules[$rule->getId()] = $rule->getDiscountAmount(); - } - - if ($cartRules[$rule->getId()] > 0) { - if ($this->_rulesItemTotals[$rule->getId()]['items_count'] <= 1) { - $quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]); - $baseDiscountAmount = min($baseItemPrice * $qty, $cartRules[$rule->getId()]); - } else { - $discountRate = $baseItemPrice * $qty / - $this->_rulesItemTotals[$rule->getId()]['base_items_price']; - $maximumItemDiscount = $rule->getDiscountAmount() * $discountRate; - $quoteAmount = $quote->getStore()->convertPrice($maximumItemDiscount); - - $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); - $this->_rulesItemTotals[$rule->getId()]['items_count']--; - } - - $discountAmount = min($itemPrice * $qty, $quoteAmount); - $discountAmount = $quote->getStore()->roundPrice($discountAmount); - $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); - - //get discount for original price - $originalDiscountAmount = min($itemOriginalPrice * $qty, $quoteAmount); - $baseOriginalDiscountAmount = $quote->getStore()->roundPrice($baseItemOriginalPrice); - - $cartRules[$rule->getId()] -= $baseDiscountAmount; - } - $address->setCartFixedRules($cartRules); - - break; - - case \Magento\SalesRule\Model\Rule::BUY_X_GET_Y_ACTION: - $x = $rule->getDiscountStep(); - $y = $rule->getDiscountAmount(); - if (!$x || $y > $x) { - break; - } - $buyAndDiscountQty = $x + $y; - - $fullRuleQtyPeriod = floor($qty / $buyAndDiscountQty); - $freeQty = $qty - $fullRuleQtyPeriod * $buyAndDiscountQty; - - $discountQty = $fullRuleQtyPeriod * $y; - if ($freeQty > $x) { - $discountQty += $freeQty - $x; - } - - $discountAmount = $discountQty * $itemPrice; - $baseDiscountAmount= $discountQty * $baseItemPrice; - //get discount for original price - $originalDiscountAmount = $discountQty * $itemOriginalPrice; - $baseOriginalDiscountAmount= $discountQty * $baseItemOriginalPrice; - break; - } - - $result = new \Magento\Object(array( - 'discount_amount' => $discountAmount, - 'base_discount_amount' => $baseDiscountAmount, - )); - $this->_eventManager->dispatch('salesrule_validator_process', array( - 'rule' => $rule, - 'item' => $item, - 'address' => $address, - 'quote' => $quote, - 'qty' => $qty, - 'result' => $result, - )); - - $discountAmount = $result->getDiscountAmount(); - $baseDiscountAmount = $result->getBaseDiscountAmount(); - - $percentKey = $item->getDiscountPercent(); - /** - * Process "delta" rounding - */ - if ($percentKey) { - $delta = isset($this->_roundingDeltas[$percentKey]) ? $this->_roundingDeltas[$percentKey] : 0; - $baseDelta = isset($this->_baseRoundingDeltas[$percentKey]) - ? $this->_baseRoundingDeltas[$percentKey] - : 0; - $discountAmount+= $delta; - $baseDiscountAmount+=$baseDelta; - - $this->_roundingDeltas[$percentKey] = $discountAmount - - $quote->getStore()->roundPrice($discountAmount); - $this->_baseRoundingDeltas[$percentKey] = $baseDiscountAmount - - $quote->getStore()->roundPrice($baseDiscountAmount); - $discountAmount = $quote->getStore()->roundPrice($discountAmount); - $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); - } else { - $discountAmount = $quote->getStore()->roundPrice($discountAmount); - $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); - } - - /** - * We can't use row total here because row total not include tax - * Discount can be applied on price included tax - */ - - $itemDiscountAmount = $item->getDiscountAmount(); - $itemBaseDiscountAmount = $item->getBaseDiscountAmount(); - - $discountAmount = min($itemDiscountAmount + $discountAmount, $itemPrice * $qty); - $baseDiscountAmount = min($itemBaseDiscountAmount + $baseDiscountAmount, $baseItemPrice * $qty); - - $item->setDiscountAmount($discountAmount); - $item->setBaseDiscountAmount($baseDiscountAmount); - - $item->setOriginalDiscountAmount($originalDiscountAmount); - $item->setBaseOriginalDiscountAmount($baseOriginalDiscountAmount); - - $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId(); - - $this->_maintainAddressCouponCode($address, $rule); - $this->_addDiscountDescription($address, $rule); - - if ($rule->getStopRulesProcessing()) { - break; - } - } - - $item->setAppliedRuleIds(join(',',$appliedRuleIds)); - $address->setAppliedRuleIds($this->mergeIds($address->getAppliedRuleIds(), $appliedRuleIds)); - $quote->setAppliedRuleIds($this->mergeIds($quote->getAppliedRuleIds(), $appliedRuleIds)); + $appliedRuleIds = $this->applyRules($item); + $this->setAppliedRuleIds($item, $appliedRuleIds); return $this; } @@ -674,32 +479,6 @@ public function mergeIds($a1, $a2, $asString = true) return $a; } - /** - * Set information about usage cart fixed rule by quote address - * - * @param int $ruleId - * @param int $itemId - * @return void - */ - public function setCartFixedRuleUsedForAddress($ruleId, $itemId) - { - $this->_cartFixedRuleUsedForAddress[$ruleId] = $itemId; - } - - /** - * Retrieve information about usage cart fixed rule by quote address - * - * @param int $ruleId - * @return int|null - */ - public function getCartFixedRuleUsedForAddress($ruleId) - { - if (isset($this->_cartFixedRuleUsedForAddress[$ruleId])) { - return $this->_cartFixedRuleUsedForAddress[$ruleId]; - } - return null; - } - /** * Calculate quote totals for each rule and save results * @@ -732,19 +511,20 @@ public function initTotals($items, \Magento\Sales\Model\Quote\Address $address) continue; } $qty = $this->_getItemQty($item, $rule); - $ruleTotalItemsPrice += $this->_getItemPrice($item) * $qty; - $ruleTotalBaseItemsPrice += $this->_getItemBasePrice($item) * $qty; + $ruleTotalItemsPrice += $this->getItemPrice($item) * $qty; + $ruleTotalBaseItemsPrice += $this->getItemBasePrice($item) * $qty; $validItemsCount++; } $this->_rulesItemTotals[$rule->getId()] = array( - 'items_price' => $ruleTotalItemsPrice, + 'items_price' => $ruleTotalItemsPrice, 'base_items_price' => $ruleTotalBaseItemsPrice, - 'items_count' => $validItemsCount, + 'items_count' => $validItemsCount, ); } } + $this->_stopFurtherRules = false; return $this; } @@ -802,11 +582,11 @@ protected function _addDiscountDescription($address, $rule) * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item * @return float */ - protected function _getItemPrice($item) + public function getItemPrice($item) { $price = $item->getDiscountCalculationPrice(); $calcPrice = $item->getCalculationPrice(); - return ($price !== null) ? $price : $calcPrice; + return $price === null ? $calcPrice : $price; } /** @@ -815,7 +595,7 @@ protected function _getItemPrice($item) * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item * @return float */ - protected function _getItemOriginalPrice($item) + public function getItemOriginalPrice($item) { return $this->_taxData->getPrice($item, $item->getOriginalPrice(), true); } @@ -826,7 +606,7 @@ protected function _getItemOriginalPrice($item) * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item * @return float */ - protected function _getItemBasePrice($item) + public function getItemBasePrice($item) { $price = $item->getDiscountCalculationPrice(); return ($price !== null) ? $item->getBaseDiscountCalculationPrice() : $item->getBaseCalculationPrice(); @@ -838,7 +618,7 @@ protected function _getItemBasePrice($item) * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item * @return float */ - protected function _getItemBaseOriginalPrice($item) + public function getItemBaseOriginalPrice($item) { return $this->_taxData->getPrice($item, $item->getBaseOriginalPrice(), true); } @@ -853,7 +633,8 @@ protected function _getItemBaseOriginalPrice($item) protected function _getItemQty($item, $rule) { $qty = $item->getTotalQty(); - return $rule->getDiscountQty() ? min($qty, $rule->getDiscountQty()) : $qty; + $discountQty = $rule->getDiscountQty(); + return $discountQty ? min($qty, $discountQty) : $qty; } /** @@ -878,6 +659,252 @@ public function prepareDescription($address, $separator=', ') return $this; } + /** + * Return items list sorted by possibility to apply prioritized rules + * + * @param array $items + * @return array $items + */ + public function sortItemsByPriority($items) + { + $itemsSorted = array(); + /** @var $rule \Magento\SalesRule\Model\Rule */ + foreach ($this->_getRules() as $rule) { + foreach ($items as $itemKey => $itemValue) { + if ($rule->getActions()->validate($itemValue)) { + unset($items[$itemKey]); + array_push($itemsSorted, $itemValue); + } + } + } + + if (!empty($itemsSorted)) { + $items = array_merge($itemsSorted, $items); + } + + return $items; + } + + /** + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param int[] $appliedRuleIds + * @return $this + */ + protected function setAppliedRuleIds(\Magento\Sales\Model\Quote\Item\AbstractItem $item, array $appliedRuleIds) + { + $address = $item->getAddress(); + $quote = $item->getQuote(); + + $item->setAppliedRuleIds(join(',', $appliedRuleIds)); + $address->setAppliedRuleIds($this->mergeIds($address->getAppliedRuleIds(), $appliedRuleIds)); + $quote->setAppliedRuleIds($this->mergeIds($quote->getAppliedRuleIds(), $appliedRuleIds)); + + return $this; + } + + /** + * Fire event to allow overwriting of discount amounts + * + * @param \Magento\SalesRule\Model\Rule\Action\Discount\Data $discountData + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param \Magento\SalesRule\Model\Rule $rule + * @param float $qty + * @return $this + */ + protected function eventFix( + \Magento\SalesRule\Model\Rule\Action\Discount\Data $discountData, + \Magento\Sales\Model\Quote\Item\AbstractItem $item, + \Magento\SalesRule\Model\Rule $rule, + $qty + ) { + $quote = $item->getQuote(); + $address = $item->getAddress(); + + $this->_eventManager->dispatch('salesrule_validator_process', array( + 'rule' => $rule, + 'item' => $item, + 'address' => $address, + 'quote' => $quote, + 'qty' => $qty, + 'result' => $discountData, + )); + + return $this; + } + + /** + * Process "delta" rounding + * + * @param \Magento\SalesRule\Model\Rule\Action\Discount\Data + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return $this + */ + protected function deltaRoundingFix( + \Magento\SalesRule\Model\Rule\Action\Discount\Data $discountData, + \Magento\Sales\Model\Quote\Item\AbstractItem $item + ) { + $store = $item->getQuote()->getStore(); + $discountAmount = $discountData->getAmount(); + $baseDiscountAmount = $discountData->getBaseAmount(); + + //TODO Seems \Magento\Sales\Model\Quote\Item\AbstractItem::getDiscountPercent() returns float value + //that can not be used as array index + $percentKey = $item->getDiscountPercent(); + if ($percentKey) { + $delta = isset($this->_roundingDeltas[$percentKey]) ? $this->_roundingDeltas[$percentKey] : 0; + $baseDelta = isset($this->_baseRoundingDeltas[$percentKey]) ? $this->_baseRoundingDeltas[$percentKey] : 0; + + $discountAmount += $delta; + $baseDiscountAmount += $baseDelta; + + $this->_roundingDeltas[$percentKey] = $discountAmount - $store->roundPrice($discountAmount); + $this->_baseRoundingDeltas[$percentKey] = $baseDiscountAmount - $store->roundPrice($baseDiscountAmount); + } + + $discountData->setAmount($store->roundPrice($discountAmount)); + $discountData->setBaseAmount($store->roundPrice($baseDiscountAmount)); + + return $this; + } + + /** + * @param Rule\Action\Discount\Data $discountData + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param float $qty + */ + protected function minFix( + \Magento\SalesRule\Model\Rule\Action\Discount\Data $discountData, + \Magento\Sales\Model\Quote\Item\AbstractItem $item, + $qty + ) { + $itemPrice = $this->getItemPrice($item); + $baseItemPrice = $this->getItemBasePrice($item); + + $itemDiscountAmount = $item->getDiscountAmount(); + $itemBaseDiscountAmount = $item->getBaseDiscountAmount(); + + $discountAmount = min($itemDiscountAmount + $discountData->getAmount(), $itemPrice * $qty); + $baseDiscountAmount = min($itemBaseDiscountAmount + $discountData->getBaseAmount(), $baseItemPrice * $qty); + + $discountData->setAmount($discountAmount); + $discountData->setBaseAmount($baseDiscountAmount); + } + + /** + * @param int $key + * @return array + * @throws \Magento\Core\Exception + */ + public function getRuleItemTotalsInfo($key) + { + if (empty($this->_rulesItemTotals[$key])) { + throw new \Magento\Core\Exception(__('Item totals are not set for the rule.')); + } + + return $this->_rulesItemTotals[$key]; + } + + /** + * @param int $key + * @return $this + */ + public function decrementRuleItemTotalsCount($key) + { + $this->_rulesItemTotals[$key]['items_count']--; + + return $this; + } + + /** + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return array + */ + protected function applyRules($item) + { + $address = $item->getAddress(); + + $appliedRuleIds = array(); + /* @var $rule \Magento\SalesRule\Model\Rule */ + foreach ($this->_getRules() as $rule) { + if ($this->_stopFurtherRules) { + break; + } + if (!$this->_canProcessRule($rule, $address)) { + continue; + } + if (!$this->_skipActionsValidation && !$rule->getActions()->validate($item)) { + continue; + } + + $this->applyRule($item, $rule, $address); + $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId(); + + if ($rule->getStopRulesProcessing()) { + $this->_stopFurtherRules = true; + break; + } + } + + return $appliedRuleIds; + } + + /** + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param \Magento\SalesRule\Model\Rule $rule + * @param \Magento\Sales\Model\Quote\Address $address + * @return $this + */ + protected function applyRule($item, $rule, $address) + { + $discountData = $this->getDiscountData($item, $rule); + $this->setDiscountData($discountData, $item); + + $this->_maintainAddressCouponCode($address, $rule); + $this->_addDiscountDescription($address, $rule); + + return $this; + } + + /** + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @param \Magento\SalesRule\Model\Rule $rule + * @return Rule\Action\Discount\Data + */ + protected function getDiscountData($item, $rule) + { + $qty = $this->_getItemQty($item, $rule); + + $discountCalculator = $this->calculatorFactory->create($rule->getSimpleAction()); + $qty = $discountCalculator->fixQuantity($qty, $rule); + $discountData = $discountCalculator->calculate($rule, $item, $qty); + + $this->eventFix($discountData, $item, $rule, $qty); + $this->deltaRoundingFix($discountData, $item); + + /** + * We can't use row total here because row total not include tax + * Discount can be applied on price included tax + */ + + $this->minFix($discountData, $item, $qty); + + return $discountData; + } + + /** + * @param Rule\Action\Discount\Data $discountData + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return $this + */ + protected function setDiscountData($discountData, $item) + { + $item->setDiscountAmount($discountData->getAmount()); + $item->setBaseDiscountAmount($discountData->getBaseAmount()); + $item->setOriginalDiscountAmount($discountData->getOriginalAmount()); + $item->setBaseOriginalDiscountAmount($discountData->getBaseOriginalAmount()); + + return $this; + } } diff --git a/app/code/Magento/SalesRule/i18n/de_DE.csv b/app/code/Magento/SalesRule/i18n/de_DE.csv index 5e755c29b7916..1285fcf7e800f 100644 --- a/app/code/Magento/SalesRule/i18n/de_DE.csv +++ b/app/code/Magento/SalesRule/i18n/de_DE.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","X kaufen, Y kostenlos bekommen (Rabattbetrag ist Y)" "By Fixed value","Nach festen Wert" "By Percentage","Nach Prozent" -"Can\'t acquire coupon.","Kann Gutschein nicht erwerben." +"Can't acquire coupon.","Kann Gutschein nicht erwerben." "Cart Attribute","Warenkorbattribut" "Catalog","Katalog" "Code Format","Kennung -Format" diff --git a/app/code/Magento/SalesRule/i18n/en_US.csv b/app/code/Magento/SalesRule/i18n/en_US.csv index b3179f57c269b..a4ae3c0ca9c0c 100644 --- a/app/code/Magento/SalesRule/i18n/en_US.csv +++ b/app/code/Magento/SalesRule/i18n/en_US.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","Buy X get Y free (discount amount is Y)" "By Fixed value","By Fixed value" "By Percentage","By Percentage" -"Can\'t acquire coupon.","Can\'t acquire coupon." +"Can't acquire coupon.","Can't acquire coupon." "Cart Attribute","Cart Attribute" "Catalog","Catalog" "Code Format","Code Format" diff --git a/app/code/Magento/SalesRule/i18n/es_ES.csv b/app/code/Magento/SalesRule/i18n/es_ES.csv index 2861c268af52d..d33f536fd0e48 100644 --- a/app/code/Magento/SalesRule/i18n/es_ES.csv +++ b/app/code/Magento/SalesRule/i18n/es_ES.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","Compre X y llévese Y gratis (la cantidad descontada es Y)" "By Fixed value","Por valor Fijo" "By Percentage","Por Porcentaje" -"Can\'t acquire coupon.","No se puede adquirir el cupón." +"Can't acquire coupon.","No se puede adquirir el cupón." "Cart Attribute","Atributos del Carro" "Catalog","Catálogo" "Code Format","Código de formato" diff --git a/app/code/Magento/SalesRule/i18n/fr_FR.csv b/app/code/Magento/SalesRule/i18n/fr_FR.csv index 16eac88ad688e..78e03a34d4b40 100644 --- a/app/code/Magento/SalesRule/i18n/fr_FR.csv +++ b/app/code/Magento/SalesRule/i18n/fr_FR.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","Achetez X et obtenez Y gratuitement (le montant de la remise est Y)" "By Fixed value","par valeur fixe" "By Percentage","par pourcentage" -"Can\'t acquire coupon.","ne peut pas obtenir le coupon" +"Can't acquire coupon.","ne peut pas obtenir le coupon" "Cart Attribute","Attribut du panier" "Catalog","Catalogue" "Code Format","Format du code" diff --git a/app/code/Magento/SalesRule/i18n/nl_NL.csv b/app/code/Magento/SalesRule/i18n/nl_NL.csv index 9759e2de84e8f..aa261b79e2c13 100644 --- a/app/code/Magento/SalesRule/i18n/nl_NL.csv +++ b/app/code/Magento/SalesRule/i18n/nl_NL.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","Koop X, krijg Y gratis (kortingsbedrag is Y)" "By Fixed value","Bij gefixeerde waarde" "By Percentage","Bij percentage" -"Can\'t acquire coupon.","Kan geen kortingsbon verkrijgen" +"Can't acquire coupon.","Kan geen kortingsbon verkrijgen" "Cart Attribute","Winkelwagen attribuut" "Catalog","Catalogus" "Code Format","Code Formaat" diff --git a/app/code/Magento/SalesRule/i18n/pt_BR.csv b/app/code/Magento/SalesRule/i18n/pt_BR.csv index 62d46394dc69d..b581f2eca9045 100644 --- a/app/code/Magento/SalesRule/i18n/pt_BR.csv +++ b/app/code/Magento/SalesRule/i18n/pt_BR.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","Compre X obtenha Y grátis (valor do desconto é Y)" "By Fixed value","Por Valor Fixo" "By Percentage","Por Percentagem" -"Can\'t acquire coupon.","Não é possível adquirir cupons." +"Can't acquire coupon.","Não é possível adquirir cupons." "Cart Attribute","Atributo do Carrinho" "Catalog","Catálogo" "Code Format","Formato do código" diff --git a/app/code/Magento/SalesRule/i18n/zh_CN.csv b/app/code/Magento/SalesRule/i18n/zh_CN.csv index 15dcb3295f426..651790cbcf276 100644 --- a/app/code/Magento/SalesRule/i18n/zh_CN.csv +++ b/app/code/Magento/SalesRule/i18n/zh_CN.csv @@ -18,7 +18,7 @@ "Buy X get Y free (discount amount is Y)","购买 X 即可免费获得 Y(折扣额是Y)" "By Fixed value","由固定值" "By Percentage","按百分比" -"Can\'t acquire coupon.","无法获取代金券。" +"Can't acquire coupon.","无法获取代金券。" "Cart Attribute","购物车属性" "Catalog","分类" "Code Format","代码格式" diff --git a/app/code/Magento/Sendfriend/Block/Send.php b/app/code/Magento/Sendfriend/Block/Send.php index 730f12990a98b..fe1de681205c3 100644 --- a/app/code/Magento/Sendfriend/Block/Send.php +++ b/app/code/Magento/Sendfriend/Block/Send.php @@ -44,7 +44,7 @@ class Send extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -57,14 +57,14 @@ class Send extends \Magento\View\Element\Template * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sendfriend\Helper\Data $sendfriendData - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Sendfriend\Helper\Data $sendfriendData, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_customerSession = $customerSession; diff --git a/app/code/Magento/Sendfriend/Controller/Product.php b/app/code/Magento/Sendfriend/Controller/Product.php index e318cf9579f1a..2238f753fc587 100644 --- a/app/code/Magento/Sendfriend/Controller/Product.php +++ b/app/code/Magento/Sendfriend/Controller/Product.php @@ -40,7 +40,7 @@ class Product extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,12 +51,12 @@ class Product extends \Magento\App\Action\Action /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Sendfriend/Model/Sendfriend.php b/app/code/Magento/Sendfriend/Model/Sendfriend.php index 0050b74b0aa04..3bb859ffbab9a 100644 --- a/app/code/Magento/Sendfriend/Model/Sendfriend.php +++ b/app/code/Magento/Sendfriend/Model/Sendfriend.php @@ -100,9 +100,9 @@ class Sendfriend extends \Magento\Core\Model\AbstractModel protected $_catalogImage = null; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateFactory; + protected $_transportBuilder; /** * @var \Magento\Core\Model\StoreManagerInterface @@ -115,10 +115,10 @@ class Sendfriend extends \Magento\Core\Model\AbstractModel protected $_escaper; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Email\Model\TemplateFactory $templateFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\TranslateInterface $translate * @param \Magento\Catalog\Helper\Image $catalogImage * @param \Magento\Sendfriend\Helper\Data $sendfriendData @@ -128,10 +128,10 @@ class Sendfriend extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Email\Model\TemplateFactory $templateFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\TranslateInterface $translate, \Magento\Catalog\Helper\Image $catalogImage, \Magento\Sendfriend\Helper\Data $sendfriendData, @@ -141,7 +141,7 @@ public function __construct( array $data = array() ) { $this->_storeManager = $storeManager; - $this->_templateFactory = $templateFactory; + $this->_transportBuilder = $transportBuilder; $this->_translate = $translate; $this->_catalogImage = $catalogImage; $this->_sendfriendData = $sendfriendData; @@ -159,16 +159,6 @@ protected function _construct() $this->_init('Magento\Sendfriend\Model\Resource\Sendfriend'); } - /** - * Retrieve Data Helper - * - * @return \Magento\Sendfriend\Helper\Data - */ - protected function _getHelper() - { - return $this->_sendfriendData; - } - /** * @return $this * @throws CoreException @@ -181,12 +171,8 @@ public function send() ); } - /* @var $translate \Magento\TranslateInterface */ - $translate = $this->_translate; - $translate->setTranslateInline(false); - - /* @var $mailTemplate \Magento\Email\Model\Template */ - $mailTemplate = $this->_templateFactory->create(); + $translate = $this->_translate->getTranslateInline(); + $this->_translate->setTranslateInline(false); $message = nl2br(htmlspecialchars($this->getSender()->getMessage())); $sender = array( @@ -194,19 +180,16 @@ public function send() 'email' => $this->_escaper->escapeHtml($this->getSender()->getEmail()) ); - $mailTemplate->setDesignConfig(array( - 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), - )); - foreach ($this->getRecipients()->getEmails() as $k => $email) { $name = $this->getRecipients()->getNames($k); - $mailTemplate->sendTransactional( - $this->getTemplate(), - $sender, - $email, - $name, - array( + $this->_transportBuilder + ->setTemplateIdentifier($this->_sendfriendData->getEmailTemplate()) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => $this->_storeManager->getStore()->getId(), + )) + ->setFrom($sender) + ->setTemplateVars(array( 'name' => $name, 'email' => $email, 'product_name' => $this->getProduct()->getName(), @@ -214,13 +197,13 @@ public function send() 'message' => $message, 'sender_name' => $sender['name'], 'sender_email' => $sender['email'], - 'product_image' => $this->_catalogImage->init($this->getProduct(), - 'small_image')->resize(75), - ) - ); + 'product_image' => $this->_catalogImage->init($this->getProduct(), 'small_image')->resize(75), + )) + ->addTo($email, $name); + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); } - - $translate->setTranslateInline(true); + $this->_translate->setTranslateInline($translate); $this->_incrementSentCount(); return $this; @@ -459,17 +442,7 @@ public function getSender() */ public function getMaxSendsToFriend() { - return $this->_getHelper()->getMaxEmailPerPeriod(); - } - - /** - * Get current Email "Send to friend" template - * - * @return string - */ - public function getTemplate() - { - return $this->_getHelper()->getEmailTemplate(); + return $this->_sendfriendData->getMaxEmailPerPeriod(); } /** @@ -479,7 +452,7 @@ public function getTemplate() */ public function getMaxRecipients() { - return $this->_getHelper()->getMaxRecipients(); + return $this->_sendfriendData->getMaxRecipients(); } /** @@ -489,7 +462,7 @@ public function getMaxRecipients() */ public function canEmailToFriend() { - return $this->_getHelper()->isEnabled(); + return $this->_sendfriendData->isEnabled(); } /** @@ -514,7 +487,7 @@ public function getSentCount($useCache = true) return $this->_sentCount; } - switch ($this->_getHelper()->getLimitBy()) { + switch ($this->_sendfriendData->getLimitBy()) { case \Magento\Sendfriend\Helper\Data::CHECK_COOKIE: return $this->_sentCount = $this->_sentCountByCookies(false); case \Magento\Sendfriend\Helper\Data::CHECK_IP: @@ -531,7 +504,7 @@ public function getSentCount($useCache = true) */ protected function _incrementSentCount() { - switch ($this->_getHelper()->getLimitBy()) { + switch ($this->_sendfriendData->getLimitBy()) { case \Magento\Sendfriend\Helper\Data::CHECK_COOKIE: return $this->_sentCount = $this->_sentCountByCookies(true); case \Magento\Sendfriend\Helper\Data::CHECK_IP: @@ -549,7 +522,7 @@ protected function _incrementSentCount() */ protected function _sentCountByCookies($increment = false) { - $cookie = $this->_getHelper()->getCookieName(); + $cookie = $this->_sendfriendData->getCookieName(); $time = time(); $newTimes = array(); @@ -562,7 +535,7 @@ protected function _sentCountByCookies($increment = false) if ($oldTimes) { $oldTimes = explode(',', $oldTimes); foreach ($oldTimes as $oldTime) { - $periodTime = $time - $this->_getHelper()->getPeriod(); + $periodTime = $time - $this->_sendfriendData->getPeriod(); if (is_numeric($oldTime) AND $oldTime >= $periodTime) { $newTimes[] = $oldTime; } @@ -587,7 +560,7 @@ protected function _sentCountByCookies($increment = false) protected function _sentCountByIp($increment = false) { $time = time(); - $period = $this->_getHelper()->getPeriod(); + $period = $this->_sendfriendData->getPeriod(); $websiteId = $this->getWebsiteId(); if ($increment) { diff --git a/app/code/Magento/Sendfriend/etc/module.xml b/app/code/Magento/Sendfriend/etc/module.xml index d9f8318e8a84d..a1f0517bbbdcc 100755 --- a/app/code/Magento/Sendfriend/etc/module.xml +++ b/app/code/Magento/Sendfriend/etc/module.xml @@ -32,7 +32,6 @@ - diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Create.php b/app/code/Magento/Shipping/Block/Adminhtml/Create.php index e0ed79e89bc14..81dba3872c7f7 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Create.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Create.php @@ -33,18 +33,18 @@ class Create extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php b/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php index dd82d2d1102e4..450df2cc2a742 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php @@ -45,7 +45,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory * @param array $data @@ -53,7 +53,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Data $salesData, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = array() diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php index fe122f5804454..155d0f3968ab2 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php @@ -36,7 +36,7 @@ class Packaging extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -54,7 +54,7 @@ class Packaging extends \Magento\Backend\Block\Template * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Size $sourceSizeModel - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory * @param array $data */ @@ -62,7 +62,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Size $sourceSizeModel, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = array() ) { diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php index f993c0947bca8..6aef0e43c2a35 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php @@ -33,7 +33,7 @@ class Grid extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -45,13 +45,13 @@ class Grid extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_shipmentItemFactory = $shipmentItemFactory; diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking.php index 9d8afc2ba72ba..c5fed22f1159b 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking.php @@ -32,7 +32,7 @@ class Tracking extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -44,13 +44,13 @@ class Tracking extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Shipping\Model\Config $shippingConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Shipping\Model\Config $shippingConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_shippingConfig = $shippingConfig; diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking/View.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking/View.php index 130ffdcb60f43..aa4d44d0f2213 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking/View.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Tracking/View.php @@ -37,14 +37,14 @@ class View extends \Magento\Shipping\Block\Adminhtml\Order\Tracking /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Shipping\Model\Config $shippingConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Shipping\Model\Config $shippingConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = array() ) { diff --git a/app/code/Magento/Shipping/Block/Adminhtml/View.php b/app/code/Magento/Shipping/Block/Adminhtml/View.php index de93eb281b44f..499445e64ede6 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/View.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/View.php @@ -35,18 +35,18 @@ class View extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Shipping/Block/Adminhtml/View/Comments.php b/app/code/Magento/Shipping/Block/Adminhtml/View/Comments.php index 65bccdf34806c..b8d324aa7321a 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/View/Comments.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/View/Comments.php @@ -39,18 +39,18 @@ class Comments extends \Magento\Backend\Block\Text\ListText /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Shipping/Block/Adminhtml/View/Form.php b/app/code/Magento/Shipping/Block/Adminhtml/View/Form.php index b7a1ac3b5977a..b2597b9c34ff8 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/View/Form.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/View/Form.php @@ -42,14 +42,14 @@ class Form extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Admin $adminHelper * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Sales\Helper\Admin $adminHelper, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = array() diff --git a/app/code/Magento/Shipping/Block/Items.php b/app/code/Magento/Shipping/Block/Items.php index 079c92af58f65..b873369e9393e 100644 --- a/app/code/Magento/Shipping/Block/Items.php +++ b/app/code/Magento/Shipping/Block/Items.php @@ -38,18 +38,18 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Shipping/Block/Order/Shipment.php b/app/code/Magento/Shipping/Block/Order/Shipment.php index 70fdbb5819dce..af03a6df2b9e7 100644 --- a/app/code/Magento/Shipping/Block/Order/Shipment.php +++ b/app/code/Magento/Shipping/Block/Order/Shipment.php @@ -38,7 +38,7 @@ class Shipment extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -54,14 +54,14 @@ class Shipment extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() diff --git a/app/code/Magento/Shipping/Block/Tracking/Link.php b/app/code/Magento/Shipping/Block/Tracking/Link.php index 43849379fbf7e..4a31dd3f8fc04 100644 --- a/app/code/Magento/Shipping/Block/Tracking/Link.php +++ b/app/code/Magento/Shipping/Block/Tracking/Link.php @@ -32,7 +32,7 @@ class Link extends \Magento\View\Element\Html\Link /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -45,13 +45,13 @@ class Link extends \Magento\View\Element\Html\Link /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Shipping\Helper\Data $shippingData * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Shipping\Helper\Data $shippingData, array $data = array() ) { diff --git a/app/code/Magento/Shipping/Block/Tracking/Popup.php b/app/code/Magento/Shipping/Block/Tracking/Popup.php index 2c3b9861adc57..cb45869b5654e 100644 --- a/app/code/Magento/Shipping/Block/Tracking/Popup.php +++ b/app/code/Magento/Shipping/Block/Tracking/Popup.php @@ -30,18 +30,18 @@ class Popup extends \Magento\View\Element\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_registry; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_registry = $registry; diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php index 7b4e9d6f31aee..e9a4b36fa455a 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php @@ -37,7 +37,7 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -54,13 +54,13 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\App\Response\Http\FileFactory $fileFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\App\Response\Http\FileFactory $fileFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Shipping\Model\CarrierFactory $carrierFactory ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Shipping/Controller/Tracking.php b/app/code/Magento/Shipping/Controller/Tracking.php index 2a6448525a142..fcdaa78b23de9 100644 --- a/app/code/Magento/Shipping/Controller/Tracking.php +++ b/app/code/Magento/Shipping/Controller/Tracking.php @@ -33,7 +33,7 @@ class Tracking extends \Magento\App\Action\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -49,13 +49,13 @@ class Tracking extends \Magento\App\Action\Action /** * @param \Magento\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Shipping\Model\InfoFactory $shippingInfoFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory */ public function __construct( \Magento\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Shipping\Model\InfoFactory $shippingInfoFactory, \Magento\Sales\Model\OrderFactory $orderFactory ) { diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index 2f54abd895bb4..23119d0651082 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -108,13 +108,13 @@ abstract class AbstractCarrier extends \Magento\Object implements AbstractCarrie /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, array $data = array() ) { parent::__construct($data); diff --git a/app/code/Magento/Shipping/Model/Carrier/Flatrate.php b/app/code/Magento/Shipping/Model/Carrier/Flatrate.php index 0fb8de29fb6ae..3cea194f4c1b5 100644 --- a/app/code/Magento/Shipping/Model/Carrier/Flatrate.php +++ b/app/code/Magento/Shipping/Model/Carrier/Flatrate.php @@ -59,7 +59,7 @@ class Flatrate /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -67,7 +67,7 @@ class Flatrate public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = array() diff --git a/app/code/Magento/Shipping/Model/Carrier/Freeshipping.php b/app/code/Magento/Shipping/Model/Carrier/Freeshipping.php index 9a330ffcdafed..344a64c78fe56 100644 --- a/app/code/Magento/Shipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/Shipping/Model/Carrier/Freeshipping.php @@ -62,7 +62,7 @@ class Freeshipping /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -70,7 +70,7 @@ class Freeshipping public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = array() diff --git a/app/code/Magento/Shipping/Model/Carrier/Pickup.php b/app/code/Magento/Shipping/Model/Carrier/Pickup.php index 167b01edc50cf..01b843db44a7b 100644 --- a/app/code/Magento/Shipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/Shipping/Model/Carrier/Pickup.php @@ -55,7 +55,7 @@ class Pickup /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -63,7 +63,7 @@ class Pickup public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = array() diff --git a/app/code/Magento/Shipping/Model/Carrier/Tablerate.php b/app/code/Magento/Shipping/Model/Carrier/Tablerate.php index 2fd6ed85c55db..636f35432d168 100644 --- a/app/code/Magento/Shipping/Model/Carrier/Tablerate.php +++ b/app/code/Magento/Shipping/Model/Carrier/Tablerate.php @@ -67,7 +67,7 @@ class Tablerate /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory * @param \Magento\Shipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory @@ -76,7 +76,7 @@ class Tablerate public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory, \Magento\Shipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory, diff --git a/app/code/Magento/Shipping/Model/Config/Backend/Tablerate.php b/app/code/Magento/Shipping/Model/Config/Backend/Tablerate.php index 8bcb8d301cc7d..243232767d080 100644 --- a/app/code/Magento/Shipping/Model/Config/Backend/Tablerate.php +++ b/app/code/Magento/Shipping/Model/Config/Backend/Tablerate.php @@ -40,8 +40,8 @@ class Tablerate extends \Magento\Core\Model\Config\Value protected $_tablerateFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Shipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory @@ -50,8 +50,8 @@ class Tablerate extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Shipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory, diff --git a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php index 7832b20ca79a1..be3a33cafcc7f 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php @@ -26,7 +26,7 @@ namespace Magento\Shipping\Model\Config\Source; -class Allmethods implements \Magento\Core\Model\Option\ArrayInterface +class Allmethods implements \Magento\Option\ArrayInterface { /** * Core store config diff --git a/app/code/Magento/Shipping/Model/Config/Source/Allspecificcountries.php b/app/code/Magento/Shipping/Model/Config/Source/Allspecificcountries.php index 1f3aaaec00615..feaf53d0ee5a5 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Allspecificcountries.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Allspecificcountries.php @@ -25,7 +25,7 @@ */ namespace Magento\Shipping\Model\Config\Source; -class Allspecificcountries implements \Magento\Core\Model\Option\ArrayInterface +class Allspecificcountries implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Shipping/Model/Config/Source/Flatrate.php b/app/code/Magento/Shipping/Model/Config/Source/Flatrate.php index b2dde6dc4c4b0..b8f20ba036c05 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Flatrate.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Flatrate.php @@ -25,7 +25,7 @@ */ namespace Magento\Shipping\Model\Config\Source; -class Flatrate implements \Magento\Core\Model\Option\ArrayInterface +class Flatrate implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Shipping/Model/Config/Source/Tablerate.php b/app/code/Magento/Shipping/Model/Config/Source/Tablerate.php index f6242e9ce2ac5..b8baf119b6dfd 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Tablerate.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Tablerate.php @@ -27,7 +27,7 @@ namespace Magento\Shipping\Model\Config\Source; -class Tablerate implements \Magento\Core\Model\Option\ArrayInterface +class Tablerate implements \Magento\Option\ArrayInterface { /** * @var \Magento\Shipping\Model\Carrier\Tablerate diff --git a/app/code/Magento/Shipping/Model/Order/Track.php b/app/code/Magento/Shipping/Model/Order/Track.php index 414d8020286b3..a40c2944bc3ae 100644 --- a/app/code/Magento/Shipping/Model/Order/Track.php +++ b/app/code/Magento/Shipping/Model/Order/Track.php @@ -55,8 +55,8 @@ class Track extends \Magento\Sales\Model\Order\Shipment\Track protected $_carrierFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -69,8 +69,8 @@ class Track extends \Magento\Sales\Model\Order\Shipment\Track * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Shipping/Model/Source/HandlingAction.php b/app/code/Magento/Shipping/Model/Source/HandlingAction.php index 25d53ba532f55..f1f7c9cf1a6a5 100644 --- a/app/code/Magento/Shipping/Model/Source/HandlingAction.php +++ b/app/code/Magento/Shipping/Model/Source/HandlingAction.php @@ -25,7 +25,7 @@ */ namespace Magento\Shipping\Model\Source; -class HandlingAction implements \Magento\Core\Model\Option\ArrayInterface +class HandlingAction implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Shipping/Model/Source/HandlingType.php b/app/code/Magento/Shipping/Model/Source/HandlingType.php index a1e9eae8ba2b5..6a4563360e5e2 100644 --- a/app/code/Magento/Shipping/Model/Source/HandlingType.php +++ b/app/code/Magento/Shipping/Model/Source/HandlingType.php @@ -25,7 +25,7 @@ */ namespace Magento\Shipping\Model\Source; -class HandlingType implements \Magento\Core\Model\Option\ArrayInterface +class HandlingType implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php b/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php index 417ce2f625171..c553ee27d82f9 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php @@ -35,18 +35,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php index e2fce6380a130..8435c71b6a30a 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php @@ -39,14 +39,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $systemStore, array $data = array() diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php index 13bf5b94ca369..be4bd0b57077b 100644 --- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php +++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php @@ -35,17 +35,17 @@ class Sitemap extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Sitemap/Model/Config/Source/Frequency.php b/app/code/Magento/Sitemap/Model/Config/Source/Frequency.php index 73b9926ce18f8..6131677628db8 100644 --- a/app/code/Magento/Sitemap/Model/Config/Source/Frequency.php +++ b/app/code/Magento/Sitemap/Model/Config/Source/Frequency.php @@ -25,7 +25,7 @@ */ namespace Magento\Sitemap\Model\Config\Source; -class Frequency implements \Magento\Core\Model\Option\ArrayInterface +class Frequency implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Sitemap/Model/Observer.php b/app/code/Magento/Sitemap/Model/Observer.php index 475d0b3e1cac4..a10e7711a5d0b 100644 --- a/app/code/Magento/Sitemap/Model/Observer.php +++ b/app/code/Magento/Sitemap/Model/Observer.php @@ -70,31 +70,39 @@ class Observer protected $_collectionFactory; /** - * @var \Magento\Email\Model\TemplateFactory + * @var \Magento\Mail\Template\TransportBuilder */ - protected $_templateFactory; + protected $_transportBuilder; /** * @var \Magento\TranslateInterface */ protected $_translateModel; + /** + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Sitemap\Model\Resource\Sitemap\CollectionFactory $collectionFactory + * @param Resource\Sitemap\CollectionFactory $collectionFactory * @param \Magento\TranslateInterface $translateModel - * @param \Magento\Email\Model\TemplateFactory $templateFactory + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sitemap\Model\Resource\Sitemap\CollectionFactory $collectionFactory, \Magento\TranslateInterface $translateModel, - \Magento\Email\Model\TemplateFactory $templateFactory + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Mail\Template\TransportBuilder $transportBuilder ) { $this->_coreStoreConfig = $coreStoreConfig; $this->_collectionFactory = $collectionFactory; $this->_translateModel = $translateModel; - $this->_templateFactory = $templateFactory; + $this->_storeManager = $storeManager; + $this->_transportBuilder = $transportBuilder; } /** @@ -126,20 +134,24 @@ public function scheduledGenerateSitemaps($schedule) } if ($errors && $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT)) { + $translate = $this->_translateModel->getTranslateInline(); $this->_translateModel->setTranslateInline(false); - $emailTemplate = $this->_templateFactory->create(); - /* @var $emailTemplate \Magento\Email\Model\Template */ - $emailTemplate->setDesignConfig(array('area' => 'backend')) - ->sendTransactional( - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_TEMPLATE), - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_IDENTITY), - $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT), - null, - array('warnings' => join("\n", $errors)) - ); - - $this->_translateModel->setTranslateInline(true); + $this->_transportBuilder + ->setTemplateIdentifier( + $this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_TEMPLATE) + ) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_ADMIN, + 'store' => $this->_storeManager->getStore()->getId(), + )) + ->setTemplateVars(array('warnings' => join("\n", $errors))) + ->setFrom($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_IDENTITY)) + ->addTo($this->_coreStoreConfig->getConfig(self::XML_PATH_ERROR_RECIPIENT)); + $transport = $this->_transportBuilder->getTransport(); + $transport->sendMessage(); + + $this->_translateModel->setTranslateInline($translate); } } } diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index 342ef3c14f75a..8d6484828958c 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -156,8 +156,8 @@ class Sitemap extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Escaper $escaper * @param \Magento\Sitemap\Helper\Data $sitemapData * @param \Magento\App\Filesystem $filesystem @@ -173,8 +173,8 @@ class Sitemap extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Escaper $escaper, \Magento\Sitemap\Helper\Data $sitemapData, \Magento\App\Filesystem $filesystem, diff --git a/app/code/Magento/Sitemap/Model/Source/Product/Image/IncludeImage.php b/app/code/Magento/Sitemap/Model/Source/Product/Image/IncludeImage.php index 285fde19c972a..05e572c0cd26a 100644 --- a/app/code/Magento/Sitemap/Model/Source/Product/Image/IncludeImage.php +++ b/app/code/Magento/Sitemap/Model/Source/Product/Image/IncludeImage.php @@ -32,7 +32,7 @@ */ namespace Magento\Sitemap\Model\Source\Product\Image; -class IncludeImage implements \Magento\Core\Model\Option\ArrayInterface +class IncludeImage implements \Magento\Option\ArrayInterface { /**#@+ * Add Images into Sitemap possible values diff --git a/app/code/Magento/Sitemap/etc/module.xml b/app/code/Magento/Sitemap/etc/module.xml index 689b8c319fa1f..729467a211525 100755 --- a/app/code/Magento/Sitemap/etc/module.xml +++ b/app/code/Magento/Sitemap/etc/module.xml @@ -34,7 +34,6 @@ - diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php index f849a18be72c7..b3b5dd45bd581 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php @@ -82,7 +82,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Directory\Model\RegionFactory $regionFactory * @param \Magento\Directory\Model\Config\Source\Country $country @@ -94,7 +94,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\Config\Source\Country $country, diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php index 383d32d0b461e..29546335b6301 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php @@ -35,18 +35,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php index 0da1fc646b0b6..57f3836b3446a 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php @@ -40,17 +40,17 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic * @var \Magento\Data\Form\FormKey */ protected $formKey; - + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Tax\Model\Calculation\RateFactory $rateFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Tax\Model\Calculation\RateFactory $rateFactory, array $data = array() diff --git a/app/code/Magento/Tax/Controller/Adminhtml/Rule.php b/app/code/Magento/Tax/Controller/Adminhtml/Rule.php index 81e01cbd32551..f4c71878b83f3 100644 --- a/app/code/Magento/Tax/Controller/Adminhtml/Rule.php +++ b/app/code/Magento/Tax/Controller/Adminhtml/Rule.php @@ -40,17 +40,17 @@ class Rule extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Tax/Helper/Data.php b/app/code/Magento/Tax/Helper/Data.php index 14cca5d72ce5f..b0f7d42feb6b5 100644 --- a/app/code/Magento/Tax/Helper/Data.php +++ b/app/code/Magento/Tax/Helper/Data.php @@ -103,7 +103,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -137,7 +137,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Tax\Model\Calculation $calculation @@ -149,7 +149,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function __construct( \Magento\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Model\Calculation $calculation, diff --git a/app/code/Magento/Tax/Model/Calculation.php b/app/code/Magento/Tax/Model/Calculation.php index b0501aaeb42fc..c4341a40d0e64 100644 --- a/app/code/Magento/Tax/Model/Calculation.php +++ b/app/code/Magento/Tax/Model/Calculation.php @@ -117,8 +117,8 @@ class Calculation extends \Magento\Core\Model\AbstractModel protected $_classesFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -131,8 +131,8 @@ class Calculation extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Customer\Helper\Data $customerData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Tax/Model/Calculation/Rate.php b/app/code/Magento/Tax/Model/Calculation/Rate.php index adc8620fc8a5e..9cdf52bf2a80f 100644 --- a/app/code/Magento/Tax/Model/Calculation/Rate.php +++ b/app/code/Magento/Tax/Model/Calculation/Rate.php @@ -71,8 +71,8 @@ class Rate extends \Magento\Core\Model\AbstractModel protected $_titleFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Directory\Model\RegionFactory $regionFactory * @param \Magento\Tax\Model\Calculation\Rate\TitleFactory $taxTitleFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -80,8 +80,8 @@ class Rate extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Tax\Model\Calculation\Rate\TitleFactory $taxTitleFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Tax/Model/Calculation/Rule.php b/app/code/Magento/Tax/Model/Calculation/Rule.php index 5e8df8790b6a2..2afeaab5fc98c 100644 --- a/app/code/Magento/Tax/Model/Calculation/Rule.php +++ b/app/code/Magento/Tax/Model/Calculation/Rule.php @@ -97,8 +97,8 @@ class Rule extends \Magento\Core\Model\AbstractModel protected $_calculation; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Tax\Model\ClassModel $taxClass * @param \Magento\Tax\Model\Calculation $calculation @@ -107,8 +107,8 @@ class Rule extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxHelper, \Magento\Tax\Model\ClassModel $taxClass, \Magento\Tax\Model\Calculation $calculation, diff --git a/app/code/Magento/Tax/Model/ClassModel.php b/app/code/Magento/Tax/Model/ClassModel.php index 12eb37553d694..71f3f73b0f603 100644 --- a/app/code/Magento/Tax/Model/ClassModel.php +++ b/app/code/Magento/Tax/Model/ClassModel.php @@ -59,16 +59,16 @@ class ClassModel extends \Magento\Core\Model\AbstractModel protected $_classFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Tax\Model\TaxClass\Factory $classFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Tax\Model\TaxClass\Factory $classFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php b/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php index 83dde3145b76f..cffad93165aec 100644 --- a/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php +++ b/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php @@ -34,8 +34,8 @@ class IncludePrice extends \Magento\Core\Model\Config\Value protected $_app; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\ConfigInterface $config * @param \Magento\Core\Model\App $app @@ -44,8 +44,8 @@ class IncludePrice extends \Magento\Core\Model\Config\Value * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\ConfigInterface $config, \Magento\Core\Model\App $app, diff --git a/app/code/Magento/Tax/Model/Config/Source/Apply/On.php b/app/code/Magento/Tax/Model/Config/Source/Apply/On.php index 3ad73a8062ebb..706d05bc1d097 100644 --- a/app/code/Magento/Tax/Model/Config/Source/Apply/On.php +++ b/app/code/Magento/Tax/Model/Config/Source/Apply/On.php @@ -25,7 +25,7 @@ */ namespace Magento\Tax\Model\Config\Source\Apply; -class On implements \Magento\Core\Model\Option\ArrayInterface +class On implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Tax/Model/Config/Source/Basedon.php b/app/code/Magento/Tax/Model/Config/Source/Basedon.php index f03a55ee5eed1..f89ee3c9256d8 100644 --- a/app/code/Magento/Tax/Model/Config/Source/Basedon.php +++ b/app/code/Magento/Tax/Model/Config/Source/Basedon.php @@ -25,7 +25,7 @@ */ namespace Magento\Tax\Model\Config\Source; -class Basedon implements \Magento\Core\Model\Option\ArrayInterface +class Basedon implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Tax/Model/Config/Source/Catalog.php b/app/code/Magento/Tax/Model/Config/Source/Catalog.php index 070e8aaa14048..2f108f79f0db8 100644 --- a/app/code/Magento/Tax/Model/Config/Source/Catalog.php +++ b/app/code/Magento/Tax/Model/Config/Source/Catalog.php @@ -25,7 +25,7 @@ */ namespace Magento\Tax\Model\Config\Source; -class Catalog implements \Magento\Core\Model\Option\ArrayInterface +class Catalog implements \Magento\Option\ArrayInterface { /** * @return array diff --git a/app/code/Magento/Tax/Model/Config/Source/TaxClass/Customer.php b/app/code/Magento/Tax/Model/Config/Source/TaxClass/Customer.php index 972b5ecc8a49b..8ae55fe4d6e01 100644 --- a/app/code/Magento/Tax/Model/Config/Source/TaxClass/Customer.php +++ b/app/code/Magento/Tax/Model/Config/Source/TaxClass/Customer.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\Config\Source\TaxClass; -class Customer implements \Magento\Core\Model\Option\ArrayInterface +class Customer implements \Magento\Option\ArrayInterface { /** * @var \Magento\Tax\Model\TaxClass\Source\CustomerFactory diff --git a/app/code/Magento/Tax/Model/Config/Source/TaxClass/Product.php b/app/code/Magento/Tax/Model/Config/Source/TaxClass/Product.php index 221cbd7f61589..d5c52e361d1c7 100644 --- a/app/code/Magento/Tax/Model/Config/Source/TaxClass/Product.php +++ b/app/code/Magento/Tax/Model/Config/Source/TaxClass/Product.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\Config\Source\TaxClass; -class Product implements \Magento\Core\Model\Option\ArrayInterface +class Product implements \Magento\Option\ArrayInterface { /** * @var \Magento\Tax\Model\TaxClass\Source\ProductFactory diff --git a/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/CustomerTaxClass.php b/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/CustomerTaxClass.php index 368444c579c46..265cc3b234b63 100644 --- a/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/CustomerTaxClass.php +++ b/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/CustomerTaxClass.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\Resource\Rule\Grid\Options; class CustomerTaxClass - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var \Magento\Tax\Model\Resource\TaxClass\CollectionFactory diff --git a/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/HashOptimized.php b/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/HashOptimized.php index 9dd09f93b6159..016fc49a9b399 100644 --- a/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/HashOptimized.php +++ b/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/HashOptimized.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\Resource\Rule\Grid\Options; class HashOptimized - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var \Magento\Tax\Model\Resource\Calculation\Rate\Collection diff --git a/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/ProductTaxClass.php b/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/ProductTaxClass.php index d9f588aa8353a..c9d0ca807d05a 100644 --- a/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/ProductTaxClass.php +++ b/app/code/Magento/Tax/Model/Resource/Rule/Grid/Options/ProductTaxClass.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\Resource\Rule\Grid\Options; class ProductTaxClass - implements \Magento\Core\Model\Option\ArrayInterface + implements \Magento\Option\ArrayInterface { /** * @var \Magento\Tax\Model\Resource\TaxClass\CollectionFactory diff --git a/app/code/Magento/Tax/Model/System/Config/Source/Algorithm.php b/app/code/Magento/Tax/Model/System/Config/Source/Algorithm.php index 5261d5887c83f..125177d66fc21 100644 --- a/app/code/Magento/Tax/Model/System/Config/Source/Algorithm.php +++ b/app/code/Magento/Tax/Model/System/Config/Source/Algorithm.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\System\Config\Source; -class Algorithm implements \Magento\Core\Model\Option\ArrayInterface +class Algorithm implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Tax/Model/System/Config/Source/Apply.php b/app/code/Magento/Tax/Model/System/Config/Source/Apply.php index a44c086d70b67..bdaba0cc81e3d 100644 --- a/app/code/Magento/Tax/Model/System/Config/Source/Apply.php +++ b/app/code/Magento/Tax/Model/System/Config/Source/Apply.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\System\Config\Source; -class Apply implements \Magento\Core\Model\Option\ArrayInterface +class Apply implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Tax/Model/System/Config/Source/PriceType.php b/app/code/Magento/Tax/Model/System/Config/Source/PriceType.php index 87df0a0455560..56ad3a10c18ab 100644 --- a/app/code/Magento/Tax/Model/System/Config/Source/PriceType.php +++ b/app/code/Magento/Tax/Model/System/Config/Source/PriceType.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\System\Config\Source; -class PriceType implements \Magento\Core\Model\Option\ArrayInterface +class PriceType implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Tax/Model/System/Config/Source/Tax/Display/Type.php b/app/code/Magento/Tax/Model/System/Config/Source/Tax/Display/Type.php index d848ab6a940e5..22b08d1d66ad5 100644 --- a/app/code/Magento/Tax/Model/System/Config/Source/Tax/Display/Type.php +++ b/app/code/Magento/Tax/Model/System/Config/Source/Tax/Display/Type.php @@ -31,7 +31,7 @@ */ namespace Magento\Tax\Model\System\Config\Source\Tax\Display; -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Tax/Model/System/Config/Source/Tax/Region.php b/app/code/Magento/Tax/Model/System/Config/Source/Tax/Region.php index 13db8946479b1..d2a1b0e720bd6 100644 --- a/app/code/Magento/Tax/Model/System/Config/Source/Tax/Region.php +++ b/app/code/Magento/Tax/Model/System/Config/Source/Tax/Region.php @@ -26,7 +26,7 @@ namespace Magento\Tax\Model\System\Config\Source\Tax; -class Region implements \Magento\Core\Model\Option\ArrayInterface +class Region implements \Magento\Option\ArrayInterface { /** * @var array diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php index 736cba7ac6a18..0e4fda2bae6da 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php @@ -34,18 +34,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php index 91bdc425faf8d..b91c75ab72394 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php @@ -44,20 +44,20 @@ abstract class AbstractTab /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\ObjectManager $objectManager * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\ObjectManager $objectManager, array $data = array() diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php index 7598a532f479c..614bf189ad9bf 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php @@ -59,7 +59,7 @@ class Css /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\ObjectManager $objectManager * @param \Magento\Theme\Model\Uploader\Service $uploaderService @@ -68,7 +68,7 @@ class Css */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\ObjectManager $objectManager, \Magento\Theme\Model\Uploader\Service $uploaderService, diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php index 1ac6786447ae1..ddc9c690fab31 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php @@ -53,7 +53,7 @@ class General /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\ObjectManager $objectManager * @param \Magento\View\Design\Theme\Image\PathInterface $themeImagePath @@ -62,7 +62,7 @@ class General */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\ObjectManager $objectManager, \Magento\View\Design\Theme\Image\PathInterface $themeImagePath, diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php index 4246d132f68a0..c5afa528642d2 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php @@ -36,7 +36,7 @@ class Theme extends \Magento\Backend\App\Action /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -47,12 +47,12 @@ class Theme extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\App\Response\Http\FileFactory $fileFactory ) { $this->_coreRegistry = $coreRegistry; diff --git a/app/code/Magento/Theme/Model/Layout/Source/Layout.php b/app/code/Magento/Theme/Model/Layout/Source/Layout.php index 67c974c01c8f3..b83646929d12c 100644 --- a/app/code/Magento/Theme/Model/Layout/Source/Layout.php +++ b/app/code/Magento/Theme/Model/Layout/Source/Layout.php @@ -23,7 +23,7 @@ */ namespace Magento\Theme\Model\Layout\Source; -class Layout implements \Magento\Core\Model\Option\ArrayInterface +class Layout implements \Magento\Option\ArrayInterface { /** * @var \Magento\Theme\Model\Layout\Config diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier.php b/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier.php index c75e6f7794ebe..1038fce4b408a 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier.php @@ -111,7 +111,7 @@ abstract class AbstractCarrier extends \Magento\Shipping\Model\Carrier\AbstractC /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -123,13 +123,13 @@ abstract class AbstractCarrier extends \Magento\Shipping\Model\Carrier\AbstractC * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Mode.php b/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Mode.php index 0a764c9601074..5a96093722154 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Mode.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Mode.php @@ -34,7 +34,7 @@ namespace Magento\Usa\Model\Shipping\Carrier\AbstractCarrier\Source; -class Mode implements \Magento\Core\Model\Option\ArrayInterface +class Mode implements \Magento\Option\ArrayInterface { /** * Returns array to be used in packages request type on back-end diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Requesttype.php b/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Requesttype.php index b80ce15664d59..e83ff5612c2a6 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Requesttype.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/AbstractCarrier/Source/Requesttype.php @@ -33,7 +33,7 @@ */ namespace Magento\Usa\Model\Shipping\Carrier\AbstractCarrier\Source; -class Requesttype implements \Magento\Core\Model\Option\ArrayInterface +class Requesttype implements \Magento\Option\ArrayInterface { /** * Returns array to be used in packages request type on back-end diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php index a332024bcc1b4..b90655488a4d1 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php @@ -191,7 +191,7 @@ class Dhl /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -206,13 +206,13 @@ class Dhl * @param \Magento\Stdlib\String $string * @param \Zend_Http_ClientFactory $httpClientFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php index 783f7bd51f3f9..ee3cce06b3ebd 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -212,7 +212,7 @@ class International /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -237,7 +237,7 @@ class International public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php index e9adef5d258b0..52ad9663e7810 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php @@ -30,7 +30,7 @@ * * @author Magento Core Team */ -class Contenttype implements \Magento\Core\Model\Option\ArrayInterface +class Contenttype implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Source/Generic.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Source/Generic.php index 21822c5894f05..6e33b10b2f755 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Source/Generic.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Source/Generic.php @@ -17,14 +17,14 @@ * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. - * + * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Magento\Usa\Model\Shipping\Carrier\Dhl\Source; -class Generic implements \Magento\Core\Model\Option\ArrayInterface +class Generic implements \Magento\Option\ArrayInterface { /** * @var \Magento\Usa\Model\Shipping\Carrier\Dhl diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php index cfd4298d850e0..17391a17bd1ea 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php @@ -133,7 +133,7 @@ class Fedex /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -149,13 +149,13 @@ class Fedex * @param \Magento\Module\Dir\Reader $configReader * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex/Source/Generic.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex/Source/Generic.php index 47f8ea48db87d..595a32f6ff25e 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex/Source/Generic.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex/Source/Generic.php @@ -17,14 +17,14 @@ * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. - * + * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Magento\Usa\Model\Shipping\Carrier\Fedex\Source; -class Generic implements \Magento\Core\Model\Option\ArrayInterface +class Generic implements \Magento\Option\ArrayInterface { /** * @var \Magento\Usa\Model\Shipping\Carrier\Fedex diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php index 3858e3006de24..45b81ec95ff02 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php @@ -140,7 +140,7 @@ class Ups /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -154,13 +154,13 @@ class Ups * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Generic.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Generic.php index 34d077583b6d0..cac9d09a8c44a 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Generic.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Generic.php @@ -17,13 +17,13 @@ * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. - * + * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Magento\Usa\Model\Shipping\Carrier\Ups\Source; -class Generic implements \Magento\Core\Model\Option\ArrayInterface +class Generic implements \Magento\Option\ArrayInterface { /** * @var \Magento\Usa\Model\Shipping\Carrier\Ups diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php index 133e932a5be48..bb7c7f2857bbc 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php @@ -34,7 +34,7 @@ */ namespace Magento\Usa\Model\Shipping\Carrier\Ups\Source; -class Mode implements \Magento\Core\Model\Option\ArrayInterface +class Mode implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Type.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Type.php index 4d7f8cf0884b1..1f74934650ae9 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Type.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups/Source/Type.php @@ -32,7 +32,7 @@ */ namespace Magento\Usa\Model\Shipping\Carrier\Ups\Source; -class Type implements \Magento\Core\Model\Option\ArrayInterface +class Type implements \Magento\Option\ArrayInterface { /** * {@inheritdoc} diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php index 1761295c9f7ca..4bf5a7c9181b0 100755 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php @@ -141,7 +141,7 @@ class Usps /** * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -156,13 +156,13 @@ class Usps * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Zend_Http_ClientFactory $httpClientFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php index 9e536376c5867..aa0fb934a5b2d 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php @@ -17,14 +17,14 @@ * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. - * + * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Magento\Usa\Model\Shipping\Carrier\Usps\Source; -class Generic implements \Magento\Core\Model\Option\ArrayInterface +class Generic implements \Magento\Option\ArrayInterface { /** * @var \Magento\Usa\Model\Shipping\Carrier\Usps diff --git a/app/code/Magento/User/Block/Buttons.php b/app/code/Magento/User/Block/Buttons.php index 486c9947b3be8..49c3dbb701bf9 100644 --- a/app/code/Magento/User/Block/Buttons.php +++ b/app/code/Magento/User/Block/Buttons.php @@ -31,18 +31,18 @@ class Buttons extends \Magento\Backend\Block\Template /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/User/Block/Role/Edit.php b/app/code/Magento/User/Block/Role/Edit.php index 72cebbd477b11..df3a95cf8426d 100644 --- a/app/code/Magento/User/Block/Role/Edit.php +++ b/app/code/Magento/User/Block/Role/Edit.php @@ -30,7 +30,7 @@ class Edit extends \Magento\Backend\Block\Widget\Tabs /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -38,14 +38,14 @@ class Edit extends \Magento\Backend\Block\Widget\Tabs * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/User/Block/Role/Grid/User.php b/app/code/Magento/User/Block/Role/Grid/User.php index 89269e758ac08..2a99649b8c235 100644 --- a/app/code/Magento/User/Block/Role/Grid/User.php +++ b/app/code/Magento/User/Block/Role/Grid/User.php @@ -33,7 +33,7 @@ class User extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -53,7 +53,7 @@ class User extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\User\Model\RoleFactory $roleFactory * @param array $data */ @@ -61,7 +61,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\User\Model\RoleFactory $roleFactory, array $data = array() ) { diff --git a/app/code/Magento/User/Block/Role/Tab/Edit.php b/app/code/Magento/User/Block/Role/Tab/Edit.php index 542d262bebe9e..e49216932c2af 100644 --- a/app/code/Magento/User/Block/Role/Tab/Edit.php +++ b/app/code/Magento/User/Block/Role/Tab/Edit.php @@ -40,7 +40,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form /** * Root ACL Resource * - * @var \Magento\Core\Model\Acl\RootResource + * @var \Magento\Acl\RootResource */ protected $_rootResource; @@ -70,7 +70,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param \Magento\Acl\RootResource $rootResource * @param \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory * @param \Magento\Acl\Builder $aclBuilder * @param \Magento\Acl\Resource\ProviderInterface $aclResourceProvider @@ -79,7 +79,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Acl\RootResource $rootResource, + \Magento\Acl\RootResource $rootResource, \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory, \Magento\Acl\Builder $aclBuilder, \Magento\Acl\Resource\ProviderInterface $aclResourceProvider, diff --git a/app/code/Magento/User/Block/User/Edit.php b/app/code/Magento/User/Block/User/Edit.php index 5930e8c24080b..0a26e3b57e828 100644 --- a/app/code/Magento/User/Block/User/Edit.php +++ b/app/code/Magento/User/Block/User/Edit.php @@ -37,18 +37,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/User/Block/User/Edit/Tab/Main.php b/app/code/Magento/User/Block/User/Edit/Tab/Main.php index bb3c0e89a04f5..703c2f234db8e 100644 --- a/app/code/Magento/User/Block/User/Edit/Tab/Main.php +++ b/app/code/Magento/User/Block/User/Edit/Tab/Main.php @@ -37,14 +37,14 @@ class Main extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Auth\Session $authSession * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Auth\Session $authSession, array $data = array() @@ -52,7 +52,7 @@ public function __construct( $this->_authSession = $authSession; parent::__construct($context, $registry, $formFactory, $data); } - + /** * Prepare form fields * diff --git a/app/code/Magento/User/Block/User/Edit/Tab/Roles.php b/app/code/Magento/User/Block/User/Edit/Tab/Roles.php index 8e208b73beec9..c5948880b1615 100644 --- a/app/code/Magento/User/Block/User/Edit/Tab/Roles.php +++ b/app/code/Magento/User/Block/User/Edit/Tab/Roles.php @@ -32,7 +32,7 @@ class Roles extends \Magento\Backend\Block\Widget\Grid\Extended /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -51,7 +51,7 @@ class Roles extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\User\Model\Resource\Role\CollectionFactory $userRolesFactory - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( @@ -59,7 +59,7 @@ public function __construct( \Magento\Backend\Helper\Data $backendHelper, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\User\Model\Resource\Role\CollectionFactory $userRolesFactory, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; diff --git a/app/code/Magento/User/Controller/Adminhtml/User.php b/app/code/Magento/User/Controller/Adminhtml/User.php index 5511c532ad411..a01d8b69c0589 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User.php +++ b/app/code/Magento/User/Controller/Adminhtml/User.php @@ -28,7 +28,7 @@ class User extends \Magento\Backend\App\AbstractAction /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry; @@ -41,12 +41,12 @@ class User extends \Magento\Backend\App\AbstractAction /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\User\Model\UserFactory $userFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\User\Model\UserFactory $userFactory ) { parent::__construct($context); diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Role.php b/app/code/Magento/User/Controller/Adminhtml/User/Role.php index bc0397b95e361..33791d26b75ac 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Role.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Role.php @@ -30,7 +30,7 @@ class Role extends \Magento\Backend\App\AbstractAction /** * Core registry * - * @var \Magento\Core\Model\Registry + * @var \Magento\Registry */ protected $_coreRegistry = null; @@ -64,7 +64,7 @@ class Role extends \Magento\Backend\App\AbstractAction /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Registry $coreRegistry * @param \Magento\User\Model\RoleFactory $roleFactory * @param \Magento\User\Model\UserFactory $userFactory * @param \Magento\User\Model\RulesFactory $rulesFactory @@ -72,7 +72,7 @@ class Role extends \Magento\Backend\App\AbstractAction */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Registry $coreRegistry, \Magento\User\Model\RoleFactory $roleFactory, \Magento\User\Model\UserFactory $userFactory, \Magento\User\Model\RulesFactory $rulesFactory, @@ -222,7 +222,7 @@ public function saveRoleAction() $isAll = $this->getRequest()->getParam('all'); if ($isAll) { - $resource = array($this->_objectManager->get('Magento\Core\Model\Acl\RootResource')->getId()); + $resource = array($this->_objectManager->get('Magento\Acl\RootResource')->getId()); } $role = $this->_initRole('role_id'); diff --git a/app/code/Magento/User/Model/Acl/Loader/Rule.php b/app/code/Magento/User/Model/Acl/Loader/Rule.php index d292b2c33be33..b1672c3145d1c 100644 --- a/app/code/Magento/User/Model/Acl/Loader/Rule.php +++ b/app/code/Magento/User/Model/Acl/Loader/Rule.php @@ -31,13 +31,13 @@ class Rule implements \Magento\Acl\LoaderInterface protected $_resource; /** - * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param \Magento\Acl\RootResource $rootResource * @param \Magento\App\Resource $resource * @param array $data * @SuppressWarnings(PHPMD.UnusedFormalParameter): */ public function __construct( - \Magento\Core\Model\Acl\RootResource $rootResource, + \Magento\Acl\RootResource $rootResource, \Magento\App\Resource $resource, array $data = array() ) { diff --git a/app/code/Magento/User/Model/Resource/Rules.php b/app/code/Magento/User/Model/Resource/Rules.php index 2d087f334a2d9..1c82a1b1a333d 100644 --- a/app/code/Magento/User/Model/Resource/Rules.php +++ b/app/code/Magento/User/Model/Resource/Rules.php @@ -31,7 +31,7 @@ class Rules extends \Magento\Core\Model\Resource\Db\AbstractDb /** * Root ACL resource * - * @var \Magento\Core\Model\Acl\RootResource + * @var \Magento\Acl\RootResource */ protected $_rootResource; @@ -56,14 +56,14 @@ class Rules extends \Magento\Core\Model\Resource\Db\AbstractDb * @param \Magento\App\Resource $resource * @param \Magento\Acl\Builder $aclBuilder * @param \Magento\Logger $logger - * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param \Magento\Acl\RootResource $rootResource * @param \Magento\Acl\CacheInterface $aclCache */ public function __construct( \Magento\App\Resource $resource, \Magento\Acl\Builder $aclBuilder, \Magento\Logger $logger, - \Magento\Core\Model\Acl\RootResource $rootResource, + \Magento\Acl\RootResource $rootResource, \Magento\Acl\CacheInterface $aclCache ) { $this->_aclBuilder = $aclBuilder; diff --git a/app/code/Magento/User/Model/Role.php b/app/code/Magento/User/Model/Role.php index 243ce22b64f35..7d5bce6557e8c 100644 --- a/app/code/Magento/User/Model/Role.php +++ b/app/code/Magento/User/Model/Role.php @@ -51,16 +51,16 @@ class Role extends \Magento\Core\Model\AbstractModel protected $_userRolesFactory; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\User\Model\Resource\Role\User\CollectionFactory $userRolesFactory * @param \Magento\User\Model\Resource\Role $resource * @param \Magento\User\Model\Resource\Role\Collection $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\User\Model\Resource\Role\User\CollectionFactory $userRolesFactory, \Magento\User\Model\Resource\Role $resource, \Magento\User\Model\Resource\Role\Collection $resourceCollection, diff --git a/app/code/Magento/User/Model/Rules.php b/app/code/Magento/User/Model/Rules.php index 0d0e494b26d79..08035e0828040 100644 --- a/app/code/Magento/User/Model/Rules.php +++ b/app/code/Magento/User/Model/Rules.php @@ -44,15 +44,15 @@ class Rules extends \Magento\Core\Model\AbstractModel /** * Class constructor * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param Resource\Rules $resource * @param Resource\Permissions\Collection $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\User\Model\Resource\Rules $resource, \Magento\User\Model\Resource\Permissions\Collection $resourceCollection, array $data = array() diff --git a/app/code/Magento/User/Model/User.php b/app/code/Magento/User/Model/User.php index e30b438faeaff..2303d06abdaff 100644 --- a/app/code/Magento/User/Model/User.php +++ b/app/code/Magento/User/Model/User.php @@ -33,7 +33,6 @@ * @method string getLastname() * @method \Magento\User\Model\User setLastname(string $value) * @method string getEmail() - * @method \Magento\User\Model\User setEmail(string $value) * @method string getUsername() * @method \Magento\User\Model\User setUsername(string $value) * @method string getPassword() @@ -93,16 +92,6 @@ class User */ protected $_hasResources = true; - /** - * Mail handler - * - * @var \Magento\Email\Model\Template\Mailer - */ - protected $_mailer; - - /** @var \Magento\Email\Model\Sender */ - protected $_sender; - /** * User data * @@ -131,13 +120,6 @@ class User */ protected $_roleFactory; - /** - * Factory for email info model - * - * @var \Magento\Email\Model\InfoFactory - */ - protected $_emailInfoFactory; - /** * @var \Magento\Encryption\EncryptorInterface */ @@ -149,35 +131,43 @@ class User protected $dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @var \Magento\Mail\Template\TransportBuilder + */ + protected $_transportBuilder; + + /** + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @param \Magento\Model\Context $context + * @param \Magento\Registry $registry * @param \Magento\User\Helper\Data $userData - * @param \Magento\Email\Model\Sender $sender * @param \Magento\Backend\App\ConfigInterface $config * @param \Magento\Validator\ObjectFactory $validatorObjectFactory * @param \Magento\User\Model\RoleFactory $roleFactory - * @param \Magento\Email\Model\InfoFactory $emailInfoFactory - * @param \Magento\Email\Model\Template\MailerFactory $mailerFactory + * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\Model\Context $context, + \Magento\Registry $registry, \Magento\User\Helper\Data $userData, - \Magento\Email\Model\Sender $sender, \Magento\Backend\App\ConfigInterface $config, \Magento\Validator\ObjectFactory $validatorObjectFactory, \Magento\User\Model\RoleFactory $roleFactory, - \Magento\Email\Model\InfoFactory $emailInfoFactory, - \Magento\Email\Model\Template\MailerFactory $mailerFactory, + \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Stdlib\DateTime $dateTime, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -186,12 +176,11 @@ public function __construct( $this->dateTime = $dateTime; parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_userData = $userData; - $this->_sender = $sender; $this->_config = $config; $this->_validatorObject = $validatorObjectFactory; $this->_roleFactory = $roleFactory; - $this->_emailInfoFactory = $emailInfoFactory; - $this->_mailer = $mailerFactory->create(); + $this->_transportBuilder = $transportBuilder; + $this->_storeManager = $storeManager; } /** @@ -212,14 +201,13 @@ public function __sleep() $properties = parent::__sleep(); return array_diff($properties, array( '_eventManager', - '_sender', '_userData', '_config', '_validatorObject', '_roleFactory', - '_emailInfoFactory', - '_mailer', - '_encryptor' + '_encryptor', + '_transportBuilder', + '_storeManager' )); } @@ -231,15 +219,14 @@ public function __wakeup() parent::__wakeup(); $objectManager = \Magento\App\ObjectManager::getInstance(); $this->_eventManager = $objectManager->get('Magento\Event\ManagerInterface'); - $this->_sender = $objectManager->get('Magento\Email\Model\Sender'); $this->_userData = $objectManager->get('Magento\User\Helper\Data'); $this->_config = $objectManager->get('Magento\Backend\App\ConfigInterface'); - $this->_coreRegistry = $objectManager->get('Magento\Core\Model\Registry'); + $this->_coreRegistry = $objectManager->get('Magento\Registry'); $this->_validatorObject = $objectManager->get('Magento\Validator\ObjectFactory'); $this->_roleFactory = $objectManager->get('Magento\User\Model\RoleFactory'); - $this->_emailInfoFactory = $objectManager->get('Magento\Email\Model\InfoFactory'); - $this->_mailer = $objectManager->get('Magento\Email\Model\Template\MailerFactory'); $this->_encryptor = $objectManager->get('Magento\Encryption\EncryptorInterface'); + $this->_transportBuilder = $objectManager->get('Magento\Mail\Template\TransportBuilder'); + $this->_storeManager = $objectManager->get('Magento\Core\Model\StoreManagerInterface'); } /** @@ -443,18 +430,6 @@ public function roleUserExists() return (is_array($result) && count($result) > 0) ? true : false; } - /** - * Set custom mail handler - * - * @param \Magento\Email\Model\Template\Mailer $mailer - * @return $this - */ - public function setMailer(\Magento\Email\Model\Template\Mailer $mailer) - { - $this->_mailer = $mailer; - return $this; - } - /** * Send email with reset password confirmation link * @@ -462,20 +437,20 @@ public function setMailer(\Magento\Email\Model\Template\Mailer $mailer) */ public function sendPasswordResetConfirmationEmail() { - /** @var \Magento\Email\Model\Info $emailInfo */ - $emailInfo = $this->_emailInfoFactory->create(); - $emailInfo->addTo($this->getEmail(), $this->getName()); - $this->_mailer->addEmailInfo($emailInfo); - // Set all required params and send emails - $this->_mailer->setSender($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY)); - $this->_mailer->setStoreId(0); - $this->_mailer->setTemplateId($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_TEMPLATE)); - $this->_mailer->setTemplateParams(array( - 'user' => $this - )); - $this->_mailer->send(); - + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder + ->setTemplateIdentifier($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_TEMPLATE)) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => 0 + )) + ->setTemplateVars(array('user' => $this, 'store' => $this->_storeManager->getStore(0))) + ->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY)) + ->addTo($this->getEmail(), $this->getName()) + ->getTransport(); + + $transport->sendMessage(); return $this; } @@ -486,15 +461,20 @@ public function sendPasswordResetConfirmationEmail() */ public function sendPasswordResetNotificationEmail() { - $this->_sender->send( - $this->getEmail(), - $this->getName(), - self::XML_PATH_RESET_PASSWORD_TEMPLATE, - self::XML_PATH_FORGOT_EMAIL_IDENTITY, - array('user' => $this), - 0 - ); - return $this; + // Set all required params and send emails + /** @var \Magento\Mail\TransportInterface $transport */ + $transport = $this->_transportBuilder + ->setTemplateIdentifier($this->_config->getValue(self::XML_PATH_RESET_PASSWORD_TEMPLATE)) + ->setTemplateOptions(array( + 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, + 'store' => 0 + )) + ->setTemplateVars(array('user' => $this, 'store' => $this->_storeManager->getStore(0))) + ->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY)) + ->addTo($this->getEmail(), $this->getName()) + ->getTransport(); + + $transport->sendMessage(); } /** diff --git a/app/code/Magento/User/etc/di.xml b/app/code/Magento/User/etc/di.xml index 5ef277cfc14f9..c40e6145ee5c9 100644 --- a/app/code/Magento/User/etc/di.xml +++ b/app/code/Magento/User/etc/di.xml @@ -28,13 +28,13 @@ - Magento\Core\Model\Acl\RootResource\Proxy - Magento\Core\Model\Acl\Cache\Proxy + Magento\Acl\RootResource\Proxy + Magento\Acl\Cache\Proxy - Magento\Core\Model\Acl\Cache\Proxy + Magento\Acl\Cache\Proxy diff --git a/app/code/Magento/User/view/email/password_reset.html b/app/code/Magento/User/view/email/password_reset.html index fc358201f81d9..aa66510a4877c 100644 --- a/app/code/Magento/User/view/email/password_reset.html +++ b/app/code/Magento/User/view/email/password_reset.html @@ -1,4 +1,4 @@ - +