<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Network_Model_DbTable_Membership extends Core_Model_DbTable_Membership
{
  protected $_type = 'network';

  public function isUserApprovalRequired()
  {
    return false;
  }

  public function isResourceApprovalRequired(Core_Model_Item_Abstract $resource)
  {
    return false;
  }

  protected function _delete(){

  }

  public function countJoinedMembers($resource_id) {
    $count = $this->select()
							->from($this->info('name'), array("COUNT(resource_id)"))
							->where('resource_id =?', $resource_id)
							->where('active =?', 1);
    return $count->query()->fetchColumn();
  }
}
