<?php
namespace App\EcommerceFrameworkBundle\Model;
use Pimcore\Bundle\EcommerceFrameworkBundle\Model\IndexableInterface;
use Pimcore\Model\DataObject\DamEntry;
class IndexableDamEntry extends DamEntry implements IndexableInterface
{
protected $isActive = false;
/**
* @inheritDoc
*/
public function isActive(bool $inProductList = false): bool
{
if ($this->isPublished()) {
$this->isActive = true;
}
return $this->isActive;
}
/**
* @inheritDoc
*/
public function getObjectType()
{
return $this->getType();
}
/**
* @inheritDoc
*/
public function getPriceSystemName(): ?string
{
return '';
}
/**
* @inheritDoc
*/
public function getOSDoIndexProduct(): bool
{
return true;
}
/**
* @inheritDoc
*/
public function getOSIndexType(): ?string
{
return $this->getObjectType();
}
/**
* @inheritDoc
*/
public function getOSParentId(): ?int
{
return $this->getParentId();
}
public function getIndustryNames(): string
{
$relations = $this->getIndustries();
$objects = [];
if (!empty($relations)) {
foreach ($relations as $relation) {
array_push($objects, $relation->getName());
}
}
return implode(', ',$objects);
}
public function getCategoryNames(): string
{
$relations = $this->getCategories();
$objects = [];
if (!empty($relations)) {
foreach ($relations as $relation) {
array_push($objects, $relation->getName());
}
}
return implode(', ',$objects);
}
}