<?php
/**
 * Class that operate on table 'workstation'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2014-04-01 11:09
 */
class WorkstationMySqlExtDAO extends WorkstationMySqlDAO{
	
	public function queryWorkstationValue($dropDownvalue){
		
		$sql = 'SELECT workstation.workerhours
		        FROM workstation
				where workstation.workstationid="'.$dropDownvalue.'"';
				
		$sqlQuery = new SqlQuery($sql);
		return $this->getList($sqlQuery);
	}

	
	public function updateConditions($station)
	{
		$sql = 'UPDATE workstation SET date = ?,  conditions = ?, user_id = ? WHERE workstationid = ?';
		$sqlQuery = new SqlQuery($sql);
		
		$sqlQuery->set($station->date);
		$sqlQuery->setNumber($station->conditions);
		$sqlQuery->setNumber($station->user_id);

		$sqlQuery->setNumber($station->workstationid);
		return $this->executeUpdate($sqlQuery);
	}
}
?>