11<?php
22/**
3- * Copyright © 2017 MagePal LLC. All rights reserved.
3+ * Copyright © MagePal LLC. All rights reserved.
44 * See COPYING.txt for license details.
55 */
66
77namespace MagePal \FormFieldManager \Helper ;
88
9- class Data extends \Magento \Framework \App \Helper \AbstractHelper {
10-
9+ class Data extends \Magento \Framework \App \Helper \AbstractHelper
10+ {
1111 const XML_PATH_ACTIVE = 'magepal_formfieldmanager/general/active ' ;
1212 const XML_CUSTOMER_ATTRIBUTE = 'magepal_formfieldmanager/general/customer_attribute ' ;
1313 const XML_CUSTOMER_ADDRESS_ATTRIBUTE = 'magepal_formfieldmanager/general/customer_address_attribute ' ;
1414
15- static $ ignoreLazyLoad = 0 ;
16-
15+ public static $ ignoreLazyLoad = 0 ;
1716
1817 /**
1918 * If enabled
2019 *
2120 * @return bool
2221 */
23- public function isEnabled () {
22+ public function isEnabled ()
23+ {
2424 return $ this ->scopeConfig ->isSetFlag (self ::XML_PATH_ACTIVE , \Magento \Store \Model \ScopeInterface::SCOPE_STORE );
2525 }
2626
2727 /**
2828 * Check page type
2929 * @return bool
3030 */
31- public function isCustomerEditAdminPage (){
31+ public function isCustomerEditAdminPage ()
32+ {
3233 return $ this ->_request ->getFullActionName () === 'customer_index_edit ' ;
3334 }
3435
3536 /**
3637 * Check page type
3738 * @return bool
3839 */
39- public function isOrderCreationAdminPage (){
40+ public function isOrderCreationAdminPage ()
41+ {
4042 return $ this ->_request ->getFullActionName () === 'sales_order_create_index '
4143 || $ this ->_request ->getFullActionName () === 'sales_order_create_loadBlock ' ;
4244 }
@@ -45,23 +47,26 @@ public function isOrderCreationAdminPage(){
4547 * Get list of customer attribute to disabled
4648 * @return string|null
4749 */
48- public function getCustomerAttribute (){
50+ public function getCustomerAttribute ()
51+ {
4952 return $ this ->scopeConfig ->getValue (self ::XML_CUSTOMER_ATTRIBUTE , \Magento \Store \Model \ScopeInterface::SCOPE_STORE );
5053 }
5154
5255 /**
5356 * Get list of customer attribute to disabled
5457 * @return string|null
5558 */
56- public function getCustomerAddressAttribute (){
59+ public function getCustomerAddressAttribute ()
60+ {
5761 return $ this ->scopeConfig ->getValue (self ::XML_CUSTOMER_ADDRESS_ATTRIBUTE , \Magento \Store \Model \ScopeInterface::SCOPE_STORE );
5862 }
5963
6064 /**
6165 * Get Array of customer attribute to disabled
6266 * @return array
6367 */
64- public function getCustomerAttributeArray (){
68+ public function getCustomerAttributeArray ()
69+ {
6570 $ list = $ this ->getCustomerAttribute ();
6671
6772 return empty ($ list ) ? [] : explode (', ' , $ list );
@@ -71,7 +76,8 @@ public function getCustomerAttributeArray(){
7176 * Get Array of customer attribute to disabled
7277 * @return array
7378 */
74- public function getCustomerAddressAttributeArray (){
79+ public function getCustomerAddressAttributeArray ()
80+ {
7581 $ list = $ this ->getCustomerAddressAttribute ();
7682
7783 return empty ($ list ) ? [] : explode (', ' , $ list );
@@ -84,11 +90,12 @@ public function getCustomerAddressAttributeArray(){
8490 * @param string $separator
8591 * @return bool
8692 */
87- public function array_path_exists ($ array , $ path , $ separator = '/ ' ){
93+ public function array_path_exists ($ array , $ path , $ separator = '/ ' )
94+ {
8895 $ paths = explode ($ separator , $ path );
8996
90- foreach ($ paths as $ sub ){
91- if (!is_array ($ array ) || !array_key_exists ($ sub , $ array )){
97+ foreach ($ paths as $ sub ) {
98+ if (!is_array ($ array ) || !array_key_exists ($ sub , $ array )) {
9299 return false ;
93100 }
94101
@@ -97,6 +104,4 @@ public function array_path_exists($array, $path, $separator = '/'){
97104
98105 return true ;
99106 }
100-
101-
102107}
0 commit comments