<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Bizlist_Model_Category extends Core_Model_Category
{
  protected $_searchTriggers = false;
  protected $_route = 'bizlist_general';

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

  public function getUsedCount()
  {
    $bizlistTable = Engine_Api::_()->getItemTable('bizlist');
    return $bizlistTable->select()
        ->from($bizlistTable, new Zend_Db_Expr('COUNT(bizlist_id)'))
        ->where('category_id = ?', $this->category_id)
        ->query()
        ->fetchColumn();
  }

  public function isOwner($owner)
  {
    return false;
  }

  public function getOwner($recurseType = null)
  {
    return $this;
  }

  public function getHref($params = array())
  {
    return Zend_Controller_Front::getInstance()->getRouter()
            ->assemble($params, $this->_route, true) . '?category=' . $this->category_id;
  }
}
