<?php
require_once (PATH_TABLES . "activity/JobServiceAttendeePictureTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

class JobServiceAttendeePictureClass extends MasterBase {
	private $fldpicid;
	function __construct($db) {
		$this->db 		= $db ;
		$this->tbl 		= JobServiceAttendeePictureTable::C_TABLE ;
		$this->fldid 	= JobServiceAttendeePictureTable::C_ID ;
		$this->fldpicid = JobServiceAttendeePictureTable::C_PICTURE_ID ;
	}

	function __destruct() {
	}
	
	function getRecordByPictureId($pictureId){
        $sql = "SELECT * FROM " .$this->tbl ;
        $sql .= " WHERE " . $this->fldpicid . " = " . $pictureId;
        
        $rows = $this->db->getTable($sql);

        if(!is_null($rows) && count($rows) > 0){
            return $rows;
        }
        
        return null;
    }

    function deleteRecordByPictureId($pictureId){
        $sql = " DELETE FROM " . JobServiceAttendeePictureTable::C_TABLE .
                " WHERE " . JobServiceAttendeePictureTable::C_PICTURE_ID . " = " . $pictureId;
        
        $this->db->executeSql($sql);
    }
}
?>