<?php

Doo::loadModel('measureconcern');

/**
 * Description of Users
 *
 * @author zongheng
 */
class MeasureConcerner
{

    private $__measureconcern;

    function __construct()
    {
        $this->__measureconcern = new MeasureConcern();
    }

    public function insertMeasureConcern($pid, $stid, $pmid, $uid)
    {
        if (!isset($pid))
            return FALSE;
        $this->__measureconcern->pid = filter_var($pid, FILTER_VALIDATE_INT);
        $this->__measureconcern->stid = filter_var($stid, FILTER_VALIDATE_INT);
        $this->__measureconcern->pmid = filter_var($pmid, FILTER_VALIDATE_INT);
        $this->__measureconcern->uid = filter_var($uid, FILTER_VALIDATE_INT);
        $this->__measureconcern->intime = time();
        return $this->__measureconcern->insert();
    }

    public function delMeasureConcern($tenderid, $uid)
    {
        return $this->__measureconcern->delete(array('where' => 'pmid=? and uid=?', 'param' => array($tenderid, $uid), 'asArray' => TRUE));
    }

    public function getMeasureConcernList($tenderid){
        return $this->__measureconcern->find(array('where' => 'pmid=?', 'param' => array($tenderid), 'asArray' => TRUE));
    }

    public function getRowbyUid($uid){
        return $this->__measureconcern->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
    }


}
