<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Core_Model_Tag extends Core_Model_Item_Abstract
{
  protected $_searchTriggers = false;// = array('text');

  public function __construct(array $config)
  {
    // Strip tags form text
    if (!empty($config['data']['text'])) {
      $config['data']['text'] = strip_tags($config['data']['text']);
    }

    parent::__construct($config);
  }

  public function getTitle()
  {
    return $this->text;
  }

  public function getHref($params = array())
  {
    $params = array_merge(array(
      'module' => 'core',
      'controller' => 'search',
      'action' => 'index',
      'query' => $this->text,
      'route' => 'default',
    ), $params);
    $route = $params['route'];
    unset($params['route']);
    return Zend_Controller_Front::getInstance()->getRouter()->assemble($params, $route, true);
  }
}
