<?php

Doo::loadCore('db/DooModel');

class tag extends DooModel {

    public $tid;
    public $name;
    public $sid;
    public $colorid;
    
    public $_table = 'CLD_tag';
    public $_primarykey = 'tid';
    public $_fields = array('tid', 'name','sid','colorid');

    function getAllBySid($sid){
    	return $this->find(array( 'asc' => 'tid', 'where'=>'sid='.$sid,  'asArray' => true));
    }
    
    function getTagByTidL($tid){
    	
    	if(!empty($tid))
	    	return $this->find(array( 'asc' => 'tid', 'where'=>'tid in('.$tid.')',  'asArray' => true));
	    else
	    	return array();
    }
	
}

?>