32 lines
649 B
PHP
32 lines
649 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Antadis\API\Front\Models\Tag as BaseTag;
|
|
use Illuminate\Support\Collection;
|
|
|
|
require_once _PS_ROOT_DIR_ . '/modules/privatesales_family_menu/privatesales_family_menu.php';
|
|
|
|
class Tag extends BaseTag
|
|
{
|
|
/**
|
|
* @Override
|
|
*/
|
|
static public function apiGetTags() {
|
|
global $cookie;
|
|
$modules_tags = new \Privatesales_Family_Menu();
|
|
|
|
$raw_tags = $modules_tags->getTree($cookie->id_lang);
|
|
|
|
$tags = new Collection();
|
|
|
|
foreach ($raw_tags as $tag) {
|
|
$tagModel = new static();
|
|
$tagModel->name = $tag['name'];
|
|
$tagModel->id = $tag['id_category_family'];
|
|
$tags->push($tagModel);
|
|
}
|
|
return $tags;
|
|
}
|
|
}
|