2023-06-26 17:41:00 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
|
|
|
|
|
|
|
class Category extends Category_parent
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param int $indexOfArray
|
|
|
|
* @return string
|
|
|
|
*/
|
2024-01-17 15:53:51 +01:00
|
|
|
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
|
2023-06-26 17:41:00 +02:00
|
|
|
{
|
2024-01-17 15:53:51 +01:00
|
|
|
if ($bShallTakeStd){
|
2023-06-26 17:41:00 +02:00
|
|
|
$splitCatArray =
|
|
|
|
array_values(
|
|
|
|
array_filter(
|
|
|
|
explode(
|
|
|
|
'/',
|
|
|
|
trim(
|
|
|
|
parse_url(
|
|
|
|
$this->getLink(),
|
|
|
|
5
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2024-01-17 15:53:51 +01:00
|
|
|
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){
|
2023-06-26 17:41:00 +02:00
|
|
|
return $splitCatArray[$indexOfArray];
|
|
|
|
}else{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
trim(
|
|
|
|
parse_url(
|
|
|
|
$this->getLink(),
|
|
|
|
5
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|