classname
stringlengths
2
79
method_name
stringlengths
3
5.05k
description
stringlengths
6
3.95k
method_code
stringlengths
7
8.51k
explanation
stringclasses
1 value
TPkgShopDhlPackstation_TPkgExtranetMapper_AddressForm
Accept
* To map values from models to views the mapper has to implement iVisitable. * The ViewRender will pass a prepared MapeprVisitor instance to the mapper. * * The mapper has to fill the values it is responsible for in the visitor. * * example: * * $foo = $oVisitor->GetSourceObject("foomodel")->GetFoo(); * $oVisitor->SetMapperValue("foo", $foo); * * * To be able to access the desired source object in the visitor, the mapper has * to declare this requirement in its GetRequirements method (see IViewMapper) * * @param \IMapperVisitorRestricted $oVisitor * @param bool $bCachingEnabled - if set to true, you need to define your cache trigger that invalidate the view rendered via mapper. if set to false, you should NOT set any trigger * @param IMapperCacheTriggerRestricted $oCacheTriggerManager * * @return
parent::Accept($oVisitor, $bCachingEnabled, $oCacheTriggerManager); $oAddress = $oVisitor->GetSourceObject('oAddressObject'); $aFieldList = array('aFieldPackstation' => 'is_dhl_packstation'); $this->SetInputFields($aFieldList, $oVisitor, $oAddress, 'checkbox');
-
TPkgShopDhlPackstation_DataExtranetUser
SetAddressAsBillingAddress
* set address as new billing address... will check if the address belongs to the user. * * @param string $sAddressId * * @return TdbDataExtranetUserAddress|null|false
$oNewBillingAdr = null; if (0 != strcmp($this->fieldDefaultBillingAddressId, $sAddressId)) { $oAdr = TdbDataExtranetUserAddress::GetNewInstance(); if ($oAdr->LoadFromFields( array('id' => $sAddressId, 'data_extranet_user_id' => $this->id, 'is_dhl_packstation' => '0') ) ) { $this->SaveFieldsFast(array('default_billing_address_id' => $sAddressId)); $oNewBillingAdr = $this->GetBillingAddress(true);
-
TPkgShopDhlPackstation_DataExtranetUser
UpdateShippingAddress
* clear field for type change after updating address. * * @param array $aAddressData * * @return bool
$aAddressData = $this->fillPackStationFieldValue($aAddressData); $bChangeDHLPackStation = $this->DHLPackStationStatusChanged($aAddressData); $bIsDHLPackStation = ('0' == $aAddressData['is_dhl_packstation']) ? false : true; $bUpdated = parent::UpdateShippingAddress($aAddressData); if (true === $bUpdated && true === $bChangeDHLPackStation) { $oShippingAddress = $this->GetShippingAddress(); if (false === is_null($oShippingAddress)) { $oShippingAddress->SetIsDhlPackstation($bIsDHLPackStation, false);
-
TPkgShopDhlPackstation_DataExtranetUser
fillPackStationFieldValue
* add pack station field if missing in address data. * * @param array $aAddressData * * @return array
if (is_array($aAddressData) && false === isset($aAddressData['is_dhl_packstation'])) { $aAddressData['is_dhl_packstation'] = 0;
-
TPkgShopDhlPackstation_DataExtranetUser
DHLPackStationStatusChanged
* check if address type status changed. * * @param array $aAddressData * * @return bool
$bChangeDHLPackStation = false; $aAddressData = $this->fillPackStationFieldValue($aAddressData); $bIsDHLPackStation = ('0' == $aAddressData['is_dhl_packstation']) ? false : true; $oOldAddress = clone $this->GetShippingAddress(); if ($bIsDHLPackStation != $oOldAddress->fieldIsDhlPackstation) { $bChangeDHLPackStation = true;
-
TPkgShopDhlPackstation_DataExtranetUserAddress
SetIsDhlPackstation
* @param bool $bIsPackstation * @param bool $bSave set to false if you not want to save cleard fiel values * * @return void
$aData = $this->sqlData; if ($bIsPackstation) { $aClear = array('company', 'address_additional_info', 'streetnr');
-
TPkgShopDhlPackstation_DataExtranetUserAddress
GetRequiredFields
* return array with required fields. * * @return string[]
$aRequiredFields = parent::GetRequiredFields(); if ($this->fieldIsDhlPackstation) { $aRequiredFields[] = 'address_additional_info'; $sKey = array_search('telefon', $aRequiredFields); if (false !== $sKey) { unset($aRequiredFields[$sKey]);
-
TPkgShopDhlPackstation_ShopStepUserDataV2
AllowedMethods
* define any methods of the class that may be called via get or post. * * @return array
$aExternalFunctions = parent::AllowedMethods(); $aExternalFunctions[] = 'ChangeShippingAddressIsPackstationState'; return $aExternalFunctions;
-
TPkgShopDhlPackstation_ShopStepUserDataV2
ChangeShippingAddressIsPackstationState
* switch the current shipping address from being a packstation address to a normal address and back. * * @return void
$this->SetPreventProcessStepMethodFromExecuting(true); $bIsDhlPackstation = false; $aShipping = $this->GetShippingAddressData(); if (is_array($aShipping) && array_key_exists('is_dhl_packstation', $aShipping)) { $bIsDhlPackstation = ('1' == $aShipping['is_dhl_packstation']) ? (true) : (false);
-
TPkgShopDhlPackstation_ShopStepUserDataV2
ChangeSelectedAddress
* set state of ship to billing yes/no. * * if the user wants shipping=billing, then we can only allow this if the new target * * @param string $sShipToBillingAddress * * @return void
$oUser = self::getExtranetUserProvider()->getActiveUser(); if ($oUser->IsLoggedIn()) { $newShippingAddressId = $this->GetShippingAddressData('selectedAddressId'); $newBillingAddressId = $this->GetBillingAddressData('selectedAddressId'); if ('new' !== $newShippingAddressId) { $this->updateStepAddressDataForAddressId($newShippingAddressId, $newBillingAddressId); if ($newShippingAddressId === $newBillingAddressId && true === $this->isShipToBillingAddressAndBillingAddressIsPackstation() ) { $this->SetShipToBillingAddress('0'); $newBillingAddress = $oUser->GetBillingAddress(); $this->SetBillingAddressData($newBillingAddress->sqlData); $this->getFlashMessageService()->addMessage( TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING, 'PkgShopDhlPackstation-ERROR-BILLING-MAY-NOT-BE-PACKSTATION' );
-
Configuration
allowUseOfPostSearchFilter
* @return bool
return $this->fieldCanBeFiltered;
-
DbAdapter
getFilterableListInstanceIdOnPage
* @var Connection
// find module instances of type x on page with setting y $query = "SELECT `shop_module_article_list`.`cms_tpl_module_instance_id` FROM `shop_module_article_list` INNER JOIN `cms_tpl_page_cms_master_pagedef_spot` ON `shop_module_article_list`.`cms_tpl_module_instance_id` = `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_module_instance_id` WHERE `shop_module_article_list`.`can_be_filtered` = '1' AND `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_page_id` = :pageId "; /** @psalm-var false|non-empty-list<string> $instanceData */ $instanceData = $this->getDatabaseConnection()->fetchNumeric($query, array('pageId' => $pageId)); if (false === $instanceData) { return null;
-
DbAdapter
setDatabaseConnection
* @param string $pageId * * @return string|null
$this->databaseConnection = $connection;
-
DbAdapter
getFilterableListInstanceSpotOnPage
@psalm-var false|non-empty-list<string> $instanceData
// find module instances of type x on page with setting y $query = "SELECT `cms_master_pagedef_spot`.`name` FROM `shop_module_article_list` INNER JOIN `cms_tpl_page_cms_master_pagedef_spot` ON `shop_module_article_list`.`cms_tpl_module_instance_id` = `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_module_instance_id` INNER JOIN `cms_master_pagedef_spot` ON `cms_tpl_page_cms_master_pagedef_spot`.`cms_master_pagedef_spot_id` = `cms_master_pagedef_spot`.`id` WHERE `shop_module_article_list`.`can_be_filtered` = '1' AND `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_page_id` = :pageId "; $instanceData = $this->getDatabaseConnection()->fetchNumeric($query, array('pageId' => $pageId)); if (false === $instanceData) { return null;
-
ChameleonSystemShopListFilterExtension
load
* @return void
$loader = new XMLFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml');
-
AbstractPkgShopListfilterMapper_Filter
GetRequirements
* {@inheritdoc}
$oRequirements->NeedsSourceObject('oFilterItem', 'TdbPkgShopListfilterItem'); $oRequirements->NeedsSourceObject('oActiveFilter', 'TdbPkgShopListfilter', TdbPkgShopListfilter::GetActiveInstance());
-
AbstractPkgShopListfilterMapper_Filter
Accept
* {@inheritdoc}
/** @var $oFilterItem TdbPkgShopListfilterItem */ $oFilterItem = $oVisitor->GetSourceObject('oFilterItem'); $aFilterData = array( 'sTitle' => $oFilterItem->fieldName, 'sInputURLName' => $oFilterItem->GetURLInputName(), 'sResetURL' => $oFilterItem->GetAddFilterURL(''), 'bActive' => $oFilterItem->IsActive(), ); $oVisitor->SetMappedValueFromArray($aFilterData);
-
TPkgShopListfilterMapper_FilterBoolean
Accept
@var $oFilterItem TPkgShopListfilterItemBoolean
parent::Accept($oVisitor, $bCachingEnabled, $oCacheTriggerManager); /** @var $oFilterItem TPkgShopListfilterItemBoolean */ $oFilterItem = $oVisitor->GetSourceObject('oFilterItem'); $aFilterData = array( '0' => array( 'sValue' => '', 'bActive' => false, 'iCount' => 0, 'sURL' => '#', ), '1' => array( 'sValue' => '', 'bActive' => false, 'iCount' => 0, 'sURL' => '#', ), ); $aOptions = $oFilterItem->GetOptions(); $iActiveValue = $oFilterItem->GetActiveValue(); foreach ($aOptions as $sValue => $iCount) { $aFilterData[$sValue] = array( 'sValue' => $sValue, 'bActive' => $sValue == $iActiveValue, 'iCount' => $iCount, 'sURL' => $oFilterItem->GetAddFilterURL($sValue), );
-
TPkgShopListfilterMapper_FilterNumericSlider
Accept( IMapperVisitorRestricted $oVisitor, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager )
* {@inheritdoc}
parent::Accept($oVisitor, $bCachingEnabled, $oCacheTriggerManager); /** @var $oFilterItem TPkgShopListfilterItemNumeric */ $oFilterItem = $oVisitor->GetSourceObject('oFilterItem'); /** @var $oActiveFilter TdbPkgShopListfilter */ $oActiveFilter = $oVisitor->GetSourceObject('oActiveFilter'); $userDataValueLow = false; $userDataValueHigh = false; $userData = $oActiveFilter->GetCurrentFilterAsArray(); if (count($userData) > 0) { $dStartAmountTmp = $oFilterItem->GetActiveStartValue(); if (!empty($dStartAmountTmp)) { $userDataValueLow = $dStartAmountTmp;
-
TPkgShopListfilterMapper_FilterNumericSlider
setDisabled
@var $oFilterItem TPkgShopListfilterItemNumeric
// slider need that as string $this->disabled = ($disabled) ? 'true' : 'false'; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getDisabled
@var $oActiveFilter TdbPkgShopListfilter
return $this->disabled;
-
TPkgShopListfilterMapper_FilterNumericSlider
setMax
* no articles * $lowestArticlePrice = $highestArticlePrice = 0.
$this->max = $max; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getMax
* 1 article * $lowestArticlePrice = $highestArticlePrice * slider * range (values): * - $lowestArticlePrice (rounded down) * - $highestArticlePrice (rounded up) * selected (min & max): * - $lowestArticlePrice (rounded down) * - $highestArticlePrice (rounded up) * - *** IGNORE url input * disabled: * - true * step: * - $highestArticlePrice (rounded up) - $lowestArticlePrice (rounded down).
return $this->max;
-
TPkgShopListfilterMapper_FilterNumericSlider
setMin
@psalm-suppress InvalidCast
$this->min = $min; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getMin
@psalm-suppress InvalidCast
return $this->min;
-
TPkgShopListfilterMapper_FilterNumericSlider
setStep
@psalm-suppress InvalidCast
$this->step = $step; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getStep
@psalm-suppress InvalidCast
return $this->step;
-
TPkgShopListfilterMapper_FilterNumericSlider
setValueHigh
* at least 2.
$this->valueHigh = $valueHigh; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getValueHigh
@psalm-suppress InvalidCast
return $this->valueHigh;
-
TPkgShopListfilterMapper_FilterNumericSlider
setValueLow
@psalm-suppress InvalidCast
$this->valueLow = $valueLow; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getValueLow
* as the $stepSize is rounded * ($lowestArticlePrice + ($stepCount * $stepSize) can be higher than the actual $highestArticlePrice * this would mess up the behaviour between the slider and the selects. * * => set $highestArticlePrice based on last option element in $selectToPrice
return $this->valueLow;
-
TPkgShopListfilterMapper_FilterNumericSlider
setDisabled
* @param float $value * * @return float
$this->disabled = $disabled; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getDisabled
* @param float $value * * @return float
return $this->disabled;
-
TPkgShopListfilterMapper_FilterNumericSlider
setSelectedOption
* String representation of the boolean * @var string * @psalm-var 'true'|'false'
$this->selectedOption = $selectedOption; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
getSelectedOption
@var int
return $this->selectedOption;
-
TPkgShopListfilterMapper_FilterNumericSlider
setOptions
@var int
$this->options = $options; return $this;
-
TPkgShopListfilterMapper_FilterNumericSlider
addOption
@var int
if (false === in_array($option, $this->options)) { $this->options[] = $option;
-
TPkgShopListfilterMapper_FilterNumericSlider
getOptions
@var int
return $this->options;
-
TPkgShopListfilterMapper_FilterStandard
Accept
* To map values from models to views the mapper has to implement iVisitable. * The ViewRender will pass a prepared MapeprVisitor instance to the mapper. * * The mapper has to fill the values it is responsible for in the visitor. * * example: * * $foo = $oVisitor->GetSourceObject("foomodel")->GetFoo(); * $oVisitor->SetMapperValue("foo", $foo); * * * To be able to access the desired source object in the visitor, the mapper has * to declare this requirement in its GetRequirements method (see IViewMapper) * * @param \IMapperVisitorRestricted $oVisitor * @param bool $bCachingEnabled - if set to true, you need to define your cache trigger that invalidate the view rendered via mapper. if set to false, you should NOT set any trigger * @param IMapperCacheTriggerRestricted $oCacheTriggerManager * * @return
parent::Accept($oVisitor, $bCachingEnabled, $oCacheTriggerManager); /** @var $oFilterItem TPkgShopListfilterItemMultiselect */ $oFilterItem = $oVisitor->GetSourceObject('oFilterItem'); /** @var $oActiveFilter TdbPkgShopListfilter */ $oActiveFilter = $oVisitor->GetSourceObject('oActiveFilter'); $aFilterData = array(); $aOptions = $oFilterItem->GetOptions(); foreach ($aOptions as $sValue => $iCount) { $aFilterData[] = array( 'sValue' => $sValue, 'bActive' => $oFilterItem->IsSelected(trim($sValue)), 'iCount' => $iCount, 'sURL' => $oFilterItem->GetAddFilterURL(trim($sValue)), 'bAllowMultiSelect' => $oFilterItem->fieldAllowMultiSelection, );
-
TPkgShopListfilterMapper_Variants
GetRequirements
* A mapper has to specify its requirements by providing th passed MapperRequirements instance with the * needed information and returning it. * * example: * * $oRequirements->NeedsSourceObject("foo",'stdClass','default-value'); * $oRequirements->NeedsSourceObject("bar"); * $oRequirements->NeedsMappedValue("baz"); * * @param IMapperRequirementsRestricted $oRequirements
parent::GetRequirements($oRequirements); $oRequirements->NeedsSourceObject('sShopVariantTypeIds', 'string'); $oRequirements->NeedsSourceObject('aFilterData', 'array');
-
TPkgShopListfilterMapper_Variants
Accept
* To map values from models to views the mapper has to implement iVisitable. * The ViewRender will pass a prepared MapeprVisitor instance to the mapper. * * The mapper has to fill the values it is responsible for in the visitor. * * example: * * $foo = $oVisitor->GetSourceObject("foomodel")->GetFoo(); * $oVisitor->SetMapperValue("foo", $foo); * * * To be able to access the desired source object in the visitor, the mapper has * to declare this requirement in its GetRequirements method (see IViewMapper) * * @param \IMapperVisitorRestricted $oVisitor * @param bool $bCachingEnabled - if set to true, you need to define your cache trigger that invalidate the view rendered via mapper. if set to false, you should NOT set any trigger * @param IMapperCacheTriggerRestricted $oCacheTriggerManager * * @return
parent::Accept($oVisitor, $bCachingEnabled, $oCacheTriggerManager); $aFilterData = $oVisitor->GetSourceObject('aFilterData'); $sShopVariantTypeIds = $oVisitor->GetSourceObject('sShopVariantTypeIds'); $aRestriction = array(); reset($aFilterData); foreach ($aFilterData as $aFilter) { $aRestriction[] = MySqlLegacySupport::getInstance()->real_escape_string($aFilter['sValue']);
-
FilterApi
__construct( RequestStack $requestStack, DbAdapter $dbAdapter, DbAdapterInterface $listDbAdapter, StateFactoryInterface $stateFactory, ResultFactoryInterface $resultFactory, ActivePageServiceInterface $activePageService, CacheInterface $cache, StateRequestExtractorCollectionInterface $stateRequestExtractorCollection )
* @var DbAdapter
$this->dbAdapter = $dbAdapter; $this->listDbAdapter = $listDbAdapter; $this->stateFactory = $stateFactory; $this->requestStack = $requestStack; $this->resultFactory = $resultFactory; $this->activePageService = $activePageService; $this->cache = $cache; $this->stateRequestExtractorCollection = $stateRequestExtractorCollection;
-
FilterApi
getArticleListQuery
* @var DbAdapterInterface
$config = $this->getListConfiguration(); return $this->resultFactory->getFilterQuery($config);
-
FilterApi
getArticleListFilterRelevantState
* @var StateFactoryInterface
$state = $this->getArticleListState(); $parameterIdentifier = $this->getArticleListSpotName(); return $state->getStateAsUrlQueryArray($parameterIdentifier, array(StateInterface::PAGE));
-
FilterApi
getListConfiguration
* @var RequestStack
if (null !== $this->listModuleConfig) { return $this->listModuleConfig;
-
FilterApi
allowCache
* @var ResultFactoryInterface
return $this->resultFactory->_AllowCache($this->getListConfiguration());
-
FilterApi
getCacheParameter
* @var ConfigurationInterface
return $this->resultFactory->_GetCacheParameters($this->getListConfiguration(), $this->getArticleListState());
-
FilterApi
getCacheTrigger
* @var ActivePageServiceInterface
return $this->resultFactory->_GetCacheTableInfos($this->getListConfiguration());
-
FilterApi
getArticleListState
* @var string|null
if (null !== $this->articleListState) { return $this->articleListState;
-
FilterApi
getResultFactory
* @var StateInterface
return $this->resultFactory;
-
TPkgShopListfilter
setListState
* @var null|array
$this->listState = $listState;
-
TPkgShopListfilter
getListSate
* @var string
return $this->listState;
-
TPkgShopListfilter
getActiveFilterAsQueryString
* @var array
$oFilterList = $this->GetFieldPkgShopListfilterItemList(); return $oFilterList->GetQueryRestriction();
-
TPkgShopListfilter
isStaticFilter
* return the active instance based on the active category or shop config * Attention: If list filter has configured a static filter the static filter data was added to post data * within this function. * * @return TdbPkgShopListfilter|null
if (!is_array($this->staticFilter)) { return false;
-
TPkgShopListfilter
setArticleListQuery
@var $filterApi FilterApiInterface
$this->articleListQuery = $articleListQuery;
-
TPkgShopListfilter
Render
* @param array $listState * @return void
$oView = new TViewParser(); /** @var $oView TViewParser */ $oView->AddVar('oListfilter', $this); $oView->AddVar('aCallTimeVars', $aCallTimeVars); $aOtherParameters = $this->GetAdditionalViewVariables($sViewName, $sViewType); $oView->AddVarArray($aOtherParameters); return $oView->RenderObjectPackageView($sViewName, TdbPkgShopListfilter::VIEW_PATH, $sViewType);
-
TPkgShopListfilter
GetFieldPkgShopListfilterItemList
* @return TdbPkgShopListfilter|null
$oList = $this->GetFromInternalCache('FieldPkgShopListfilterItemList'); if (is_null($oList)) { $aTrigger = array('class' => __CLASS__, 'method' => 'GetFieldPkgShopListfilterItemList', 'id' => $this->id); $aTrigger['activeFilter'] = TGlobal::instance()->GetUserData(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA); $bCaching = false; if (!is_array($aTrigger['activeFilter']) || 0 == count($aTrigger['activeFilter'])) { $bCaching = true;
-
TPkgShopListfilter
GetCurrentFilterAsHiddenInputFields
* @return array
$oList = $this->GetFieldPkgShopListfilterItemList(); return $oList->GetListSettingAsInputFields();
-
TPkgShopListfilter
GetCurrentFilterAsArray
* @return string
$aFilterAsArray = $this->GetFromInternalCache('aFilterAsArray'); if (is_null($aFilterAsArray)) { $oList = $this->GetFieldPkgShopListfilterItemList(); $aFilterAsArray = $oList->GetListSettingAsArray(); $this->SetInternalCache('aFilterAsArray', $aFilterAsArray);
-
TPkgShopListfilter
GetFilterValuesForFilterType
* @param string $staticFilter * * @return void
/** @var array|null $aActiveFilter */ $aActiveFilter = $this->GetFromInternalCache('aFilterDataAsArrayFor'.$sFilterSystemName); if (is_null($aActiveFilter)) { $aActiveFilter = false; $aFilterData = $this->GetCurrentFilterAsArray(); if (is_array($aFilterData) && array_key_exists(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA, $aFilterData) && is_array($aFilterData[TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA]) && count($aFilterData[TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA]) > 0) { $aFilterData = $aFilterData[TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA]; $oFilterId = TdbPkgShopListfilterItem::GetNewInstance(); if ($oFilterId->LoadFromFields(array('pkg_shop_listfilter_id' => $this->id, 'systemname' => $sFilterSystemName))) { if (is_array($aFilterData) && array_key_exists($oFilterId->id, $aFilterData)) { if (is_array($aFilterData[$oFilterId->id]) && count($aFilterData[$oFilterId->id]) > 0) { $aActiveFilter = $aFilterData[$oFilterId->id];
-
TPkgShopListfilterItem
GetURLInputName
* you need to set this to the field name you want to filter by. * * @var string
return urlencode(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA).'['.urlencode($this->id).']';
-
TPkgShopListfilterItem
GetActiveSettingAsHiddenInputField
* the item list filtered by all other listfilter item aside from this one. * * @var TCMSRecordList|null
/** * @psalm-suppress InvalidArgument * @FIXME Passing an array (`aActiveFilterData`) to `TGlobal::OutHTML` which expects a string. Due to `htmlentities` being used in that method, this will return an empty string up to PHP7.4 but result in an fatal error in PHP8+ */ return '<input type="hidden" name="'.TGlobal::OutHTML($this->GetURLInputName()).'" value="'.TGlobal::OutHTML($this->aActiveFilterData).'" />';
-
TPkgShopListfilterItem
GetActiveSettingAsArray
* the current user selection for the filter. * * @var array|null
$aData = array(); if (is_array($this->aActiveFilterData) || !empty($this->aActiveFilterData)) { $aData = array(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA => array($this->id => $this->aActiveFilterData));
-
TPkgShopListfilterItem
GetAddFilterURL
* @var bool
// @todo: the sorting is lost here (#29269) $oActiveListfilter = TdbPkgShopListfilter::GetActiveInstance(); $aURLData = $oActiveListfilter->GetCurrentFilterAsArray(); $aURLData[TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA][$this->id] = $sValue; $aURLData[TdbPkgShopListfilter::URL_PARAMETER_IS_NEW_REQUEST] = '1'; return $this->getActivePageService()->getLinkToActivePageRelative($aURLData);
-
TPkgShopListfilterItem
SetFilteredItemList
* {@inheritdoc} * * @return void
$this->oItemListFilteredByOtherItems = $oItemListFilteredByOtherItems;
-
TPkgShopListfilterItem
GetOptions
* called when an object recovers from serialization. * * @return void
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = array(); $sIdSelect = $this->GetResultSetBaseQuery(); if (PKG_SHOP_LISTFILTER_ENABLE_COUNT_PER_FILTER_ITEM) { $sItemQuery = "SELECT `shop_article`.`{$this->sItemFieldName
-
TPkgShopListfilterItem
Render
* @return void
$oView = new TViewParser(); /** @var $oView TViewParser */ $oView->AddVar('oListItem', $this); $oView->AddVar('oFilterType', $this->GetFieldPkgShopListfilterItemType()); $oView->AddVar('aCallTimeVars', $aCallTimeVars); $aOtherParameters = $this->GetAdditionalViewVariables($sViewName, $sViewType); $oView->AddVarArray($aOtherParameters); return $oView->RenderObjectPackageView($sViewName, TdbPkgShopListfilterItem::VIEW_PATH, $sViewType);
-
TPkgShopListfilterItem
GetQueryRestrictionForActiveFilter
* @param array<string, mixed>|string $aData * @psalm-param array<string, mixed>|'' $aData * @return array<string, mixed>|null - Returns `null` if the resulting array would be empty or if an empty string was passed as input.
return '';
-
TPkgShopListfilterItem
IsActive
* overload view settings from filter-type if nothing is set in this filter-item. * * @return void
return $this->bIsActive;
-
TPkgShopListfilterItemList
__construct
* create a new instance. * * @param string|null $sQuery * @param string|null $iLanguageId
$this->bAllowItemCache = true; parent::__construct($sQuery, $iLanguageId);
-
TPkgShopListfilterItemList
GetQueryRestriction
* return sql condition for the current filter list. optionaly excluding the element passed. * * @param TdbPkgShopListfilterItem $oExcludeItem * @param bool $bReturnAsArray - set to true if you want an array with the query parts instead of a string * * @return string|string[] * @psalm-return ($bReturnAsArray is true ? string[] : string)
$sQuery = ''; $aQueryItems = array(); $iPointer = $this->getItemPointer(); $this->GoToStart(); while ($oItem = $this->Next()) { if (is_null($oExcludeItem) || !$oExcludeItem->IsSameAs($oItem)) { $sTmpQuery = trim($oItem->GetQueryRestrictionForActiveFilter()); if (!empty($sTmpQuery)) { $aQueryItems[] = $sTmpQuery;
-
TPkgShopListfilterItemList
GetListSettingAsInputFields
* return the setting of the list element as input fields (hidden). * * @return string
$sInput = ''; $aInputItems = array(); $iPointer = $this->getItemPointer(); $this->GoToStart(); while ($oItem = $this->Next()) { $sTmp = trim($oItem->GetActiveSettingAsHiddenInputField()); if (!empty($sTmp)) { $aInputItems[] = $sTmp;
-
TPkgShopListfilterItemList
GetListSettingAsArray
* return the setting of the list element as input fields (hidden). * * @return array
$aSettings = array(); $iPointer = $this->getItemPointer(); $this->GoToStart(); while ($oItem = $this->Next()) { $aTmpSetting = $oItem->GetActiveSettingAsArray(); $aSettings = array_merge_recursive($aSettings, $aTmpSetting);
-
TPkgShopListfilterItemBoolean
GetActiveValue
* return the current active value (0 or 1). if none is set, we will return 0. * * @return int * @psalm-suppress InvalidReturnType, InvalidReturnStatement * @FIXME We can't be sure that the return type is `int`. Better add a cast here.
$iValue = $this->aActiveFilterData; if (is_null($iValue) || ('0' != $iValue && '1' != $iValue)) { $iValue = '';
-
TPkgShopListfilterItemCategoryTree
GetTreeFromValueList
* you need to set this to the table name of the connected table. * * @var string
$aValues = $oListItem->GetOptions();
-
TPkgShopListfilterItemIsNew
GetQueryRestrictionForActiveFilter
* you need to set this to the field name you want to filter by. * * @var string
$sQuery = ''; $sValue = $this->GetActiveValue(); if ('1' == $sValue || '0' == $sValue) { $sQuery = "`shop_article`.`{$this->sItemFieldName
-
TPkgShopListfilterItemIsOnStock
GetOptions
* you need to set this to the field name you want to filter by. * * @var string
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { if (PKG_SHOP_LISTFILTER_ENABLE_COUNT_PER_FILTER_ITEM) { $oObj = clone $this->oItemListFilteredByOtherItems; $iCount = $this->oItemListFilteredByOtherItems->Length(); $databaseConnection = $this->getDatabaseConnection(); $quotedItemFieldName = $databaseConnection->quoteIdentifier($this->sItemFieldName); $oObj->AddFilterString(" `shop_article_stock`.$quotedItemFieldName > 0"); $iWithStockCount = $oObj->Length(); $aOptions[0] = $iCount - $iWithStockCount; $aOptions[1] = $iWithStockCount;
-
TPkgShopListfilterItemIsOnStock
GetQueryRestrictionForActiveFilter
* return option as assoc array (name=>count). * * @return array
$sQuery = ''; $sValue = $this->GetActiveValue(); if ('1' == $sValue) { $sQuery = '`shop_article_stock`.`'.MySqlLegacySupport::getInstance()->real_escape_string($this->sItemFieldName).'` > 0';
-
TPkgShopListfilterItemIsReduced
GetOptions
* you need to set this to the field name you want to filter by. * * @var string
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = $this->oItemListFilteredByOtherItems->GetItemUniqueValueListForField('id', array($this, 'ArticleIsReduced')); $this->OrderOptions($aOptions); $this->SetInternalCache('aOptions', $aOptions);
-
TPkgShopListfilterItemIsReduced
ArticleIsReduced
* return option as assoc array (name=>count). * * @return array
if ($aRow['price_reference'] > $aRow['price']) { return '1';
-
TPkgShopListfilterItemIsReduced
GetQueryRestrictionForActiveFilter
* @param string $sFieldName * @param string $sValue * @param array<string, string> $aRow * @return string * * @psalm-return '0'|'1'
$sQuery = ''; $sValue = $this->GetActiveValue(); if ('1' == $sValue) { $sQuery = '`shop_article`.`price_reference` > 0 AND `shop_article`.`price_reference` != `shop_article`.`price` ';
-
TPkgShopListfilterItemLevelTree
GetRenderedCategoryTree
* you need to set this to the table name of the connected table. * * @var string
$aFilterCategories = $this->GetOptions(); $oTree = TShopCategoryTree::GetCategoryTree(); $oTree->ResetCounter(); foreach ($aFilterCategories as $sCategoryId => $sCategoryCount) { $oTree->AddItemCount($sCategoryId, $sCategoryCount);
-
TPkgShopListfilterItemManufacturer
GetQueryRestrictionForActiveFilter
* you need to set this to the table name of the connected table. * * @var string
$sQuery = parent::GetQueryRestrictionForActiveFilter(); if (is_null($sQuery)) { $aValues = $this->aActiveFilterData; if (is_array($aValues) && count($aValues) > 0) { $quotedItemFieldName = $this->getDatabaseConnection()->quoteIdentifier($this->sItemFieldName); $sQuery = " `shop_article`.$quotedItemFieldName = '' ";
-
TPkgShopListfilterItemManufacturer
GetOptions
* you need to set this to the field name in the article table (note: the field is not derived from * the table name since this may differ). * * @var string
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = array(); //select shop_manufacturer_id, that has available(searchable, invirtual, active, etc) articles of filtered categories $sIdSelect = $this->GetResultSetBaseQuery(); //select id of available(searchable, invirtual, active, etc) articles of filtered categories $sArticleIdsQuery = $this->GetResultSetBaseQuery('id'); $databaseConnection = $this->getDatabaseConnection(); $quotedItemTableName = $databaseConnection->quoteIdentifier($this->sItemTableName); $quotedItemFieldName = $databaseConnection->quoteIdentifier($this->sItemFieldName); $quotedTargetTableNameField = $databaseConnection->quoteIdentifier($this->GetTargetTableNameField()); if (PKG_SHOP_LISTFILTER_ENABLE_COUNT_PER_FILTER_ITEM) { $sItemQuery = " SELECT itemtable.$quotedTargetTableNameField AS attribute, COUNT(itemtable.$quotedTargetTableNameField) AS matches FROM $quotedItemTableName AS itemtable INNER JOIN `shop_article` ON `shop_article`.$quotedItemFieldName = itemtable.`id` INNER JOIN ($sIdSelect) AS Z ON itemtable.`id` = Z.$quotedItemFieldName INNER JOIN ($sArticleIdsQuery) AS Y ON `shop_article`.`id` = Y.`id` GROUP BY itemtable.$quotedTargetTableNameField ORDER BY itemtable.$quotedTargetTableNameField ";
-
TPkgShopListfilterItemMultiselect
IsSelected
* you need to set this to the table name of the connected table. * * @var string
$bIsSelected = false; if (is_array($this->aActiveFilterData)) { $bIsSelected = in_array($sItemName, $this->aActiveFilterData);
-
TPkgShopListfilterItemMultiselect
IsActiveFilter
* you need to set this to the field name in the article table (note: the field is not derived from * the table name since this may differ). * * @var string
$bIsSelected = false; if (is_array($this->aActiveFilterData)) { $bIsSelected = true;
-
TPkgShopListfilterItemMultiselect
GetOptions
* return true if the item is selected. * * @param string $sItemName * * @return bool
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = array(); $sIdSelect = $this->GetResultSetBaseQuery(); $databaseConnection = $this->getDatabaseConnection(); $quotedItemTableName = $databaseConnection->quoteIdentifier($this->sItemTableName); $quotedItemFieldName = $databaseConnection->quoteIdentifier($this->sItemFieldName); $quotedTargetTableNameField = $databaseConnection->quoteIdentifier($this->GetTargetTableNameField()); if (PKG_SHOP_LISTFILTER_ENABLE_COUNT_PER_FILTER_ITEM) { $sItemQuery = " SELECT itemtable.$quotedTargetTableNameField AS attribute, COUNT(itemtable.$quotedTargetTableNameField) AS matches FROM $quotedItemTableName AS itemtable INNER JOIN `shop_article` ON `shop_article`.$quotedItemFieldName = itemtable.`id` INNER JOIN ($sIdSelect) AS Z ON itemtable.`id` = Z.$quotedItemFieldName GROUP BY itemtable.$quotedTargetTableNameField ";
-
TPkgShopListfilterItemMultiselect
GetQueryRestrictionForActiveFilter
* return true if a item is selected. * * @return bool
/** @var string|null $sQuery */ $sQuery = $this->GetFromInternalCache('sQueryRestrictionForActiveFilter'); if (is_null($sQuery)) { $aValues = $this->aActiveFilterData; if (is_array($aValues) && count($aValues) > 0) { $aValues = TTools::MysqlRealEscapeArray($aValues); $sItemListQuery = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sItemTableName).'` WHERE '.$this->GetTargetTableNameField()." IN ('".implode("','", $aValues)."')"; $tRes = MySqlLegacySupport::getInstance()->query($sItemListQuery); $aIdList = array(); while ($aItemRow = MySqlLegacySupport::getInstance()->fetch_assoc($tRes)) { $aIdList[] = MySqlLegacySupport::getInstance()->real_escape_string($aItemRow['id']);
-
TPkgShopListfilterItemMultiselect
GetActiveSettingAsHiddenInputField
* return option as assoc array (name=>count). * * @return array
$sHTML = ''; if (is_array($this->aActiveFilterData)) { reset($this->aActiveFilterData); foreach ($this->aActiveFilterData as $sItemName) { $sHTML .= '<input type="hidden" name="'.TGlobal::OutHTML($this->GetURLInputName()).'[]" value="'.TGlobal::OutHTML($sItemName).'" />';
-
TPkgShopListfilterItemMultiselectMLT
GetQueryRestrictionForActiveFilter
* return the query restriction for active filter. returns false if there * is no active restriction for this item. * * @return string|null
/** @var string|null $sQuery */ $sQuery = $this->GetFromInternalCache('sQueryRestrictionForActiveFilter'); if (is_null($sQuery)) { if (true === is_array($this->aActiveFilterData) && count($this->aActiveFilterData) > 0) { $sItemListQuery = $this->GetSQLQueryForQueryRestrictionForActiveFilter(); $aIdList = array(); if (!empty($sItemListQuery)) { $tRes = MySqlLegacySupport::getInstance()->query($sItemListQuery); $aIdList = array(); while ($aItemRow = MySqlLegacySupport::getInstance()->fetch_assoc($tRes)) { $aIdList[] = MySqlLegacySupport::getInstance()->real_escape_string($aItemRow['source_id']);
-
TPkgShopListfilterItemMultiselectMLT
GetOptions
@var string|null $sQuery
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = array(); $sIdSelect = $this->GetResultSetBaseQuery(); $databaseConnection = $this->getDatabaseConnection(); $quotedItemTableName = $databaseConnection->quoteIdentifier($this->sItemTableName); $quotedTableName = $databaseConnection->quoteIdentifier("shop_article_{$this->sItemFieldName
-
TPkgShopListfilterItemMultiselectPropertyTable
GetOptions
* return option as assoc array (name=>count). * * @return array
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { if (!empty($this->fieldMysqlFieldName)) { $this->sItemTableName = $this->fieldMysqlFieldName;
-
TPkgShopListfilterItemNumeric
GetActiveStartValue
* return active start value. * * @return float|false
$sStartValue = false; if (is_array($this->aActiveFilterData) && array_key_exists( self::URL_PARAMETER_FILTER_START_VALUE, $this->aActiveFilterData ) ) { $sStartValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_START_VALUE];
-
TPkgShopListfilterItemNumeric
GetActiveEndValue
* return active end value. * * @return float|false
$sEndValue = false; if (is_array($this->aActiveFilterData) && array_key_exists( self::URL_PARAMETER_FILTER_END_VALUE, $this->aActiveFilterData ) ) { $sEndValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_END_VALUE];
-
TPkgShopListfilterItemNumeric
GetActiveSettingAsHiddenInputField
* return setting of element as hidden input fields. * * @return string
$sInput = ''; if (false !== $this->GetActiveStartValue()) { $sInput .= '<input type="hidden" name="'.TGlobal::OutHTML( $this->GetURLInputName().'['.self::URL_PARAMETER_FILTER_START_VALUE.']' ).'" value="'.TGlobal::OutHTML($this->GetActiveStartValue()).'" />';
-
TPkgShopListfilterItemNumeric
GetQueryRestrictionForActiveFilter
* return the query restriction for active filter. returns false if there * is no active restriction for this item. * * @return string
$sQuery = ''; $dStartValue = $this->GetActiveStartValue(); $dEndValue = $this->GetActiveEndValue(); if ($dStartValue > 0 && $dEndValue > 0) { $sQuery = "`shop_article`.`{$this->sItemFieldName
-
TPkgShopListfilterItemPriceSlider
GetOptions
* return option as assoc array (name=>count). * * @return array
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = array(); // we only care for the max and min value... $sIdSelect = $this->GetResultSetBaseQuery(); $query = "SELECT MAX(`price`) AS maxprice, MIN(`price`) AS minprice FROM `shop_article` INNER JOIN ({$sIdSelect
-
TPkgShopListfilterItemShopAttributeList
GetOptions
* possible filter config defines. * * PKG_SHOP_LISTFILTER_ENABLE_COUNT_PER_FILTER_ITEM -> set to true if you want a count per filter option * * PKG_SHOP_LISTFILTER_ATTRIBUTE_FILTER_SELECT_VARIANTS -> set to true if you want the filter to include variants * * PKG_SHOP_LISTFILTER_ATTRIBUTE_FILTER_SELECT_VARIANTS_PARENTS -> set to true if you want to include variants and * show only parent articles in list. If false you have to show variants in article list. * * /*
$aOptions = $this->GetFromInternalCache('aOptions'); if (is_null($aOptions)) { $aOptions = array(); $oShopAttribute = $this->GetFieldShopAttribute(); if (is_object($oShopAttribute)) { $sIdSelect = $this->GetResultSetBaseQuery(); // now add the filter from the filter module... $query = 'CREATE TEMPORARY TABLE `_tmp_category_article` ( `id` CHAR( 36 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ) ENGINE = MEMORY'; MySqlLegacySupport::getInstance()->query($query); $query = "INSERT INTO _tmp_category_article (`id`) {$sIdSelect
-
TPkgShopListfilterItemShopAttributeList
GetQueryRestrictionForActiveFilter
* you need to set this to the table name of the connected table. * * @var string
/** @var string|null $sQuery */ $sQuery = $this->GetFromInternalCache('sQueryRestrictionForActiveFilter'); if (null === $sQuery) { $databaseConnection = $this->getDatabaseConnection(); $aValues = $this->aActiveFilterData; if (is_array($aValues) && count($aValues) > 0) { $sItemListQuery = $this->GetSQLQueryForQueryRestrictionForActiveFilter(); $aIdList = array(); if (!empty($sItemListQuery)) { $tRes = MySqlLegacySupport::getInstance()->query($sItemListQuery); $aIdList = array(); while ($aItemRow = MySqlLegacySupport::getInstance()->fetch_assoc($tRes)) { $aIdList[] = $databaseConnection->quote($aItemRow['source_id']);
-
TPkgShopListfilterItemShopAttributeNumeric
GetActiveStartValue
* you need to set this to the table name of the connected table. * * @var string
$sStartValue = false; if (is_array($this->aActiveFilterData) && array_key_exists(self::URL_PARAMETER_FILTER_START_VALUE, $this->aActiveFilterData)) { $sStartValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_START_VALUE];
-