GoogleAnalytics4/Modules/Application/Model/Manufacturer.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2023-08-15 11:59:27 +02:00
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Manufacturer extends Manufacturer_parent
{
/**
* @param int $indexOfArray
* @return string
*/
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
2023-08-15 11:59:27 +02:00
{
if ($bShallTakeStd){
2023-08-15 11:59:27 +02:00
$splitCatArray =
array_values(
array_filter(
explode(
'/',
trim(
parse_url(
$this->getLink(),
5
)
)
)
)
);
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){
2023-08-15 11:59:27 +02:00
return $splitCatArray[$indexOfArray];
}else{
return "";
}
}
return
trim(
parse_url(
$this->getLink(),
5
)
);
}
}