<?php
/**
 * Class that operate on table 'sparepartstoredetails'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2013-09-28 11:55
 */
class SparepartstoredetailsMySqlExtDAO extends SparepartstoredetailsMySqlDAO{

	public function queryBySparepartidExt($value){
		$sql = 'SELECT * FROM sparepartstoredetails WHERE sparepartid = ?';
		$sqlQuery = new SqlQuery($sql);
		$sqlQuery->setNumber($value);
		return $this->getRow($sqlQuery);
	}
	
	
	public function updateQuantity($sparepartstoredetail){
		$sql = 'UPDATE sparepartstoredetails SET sparepartid = ?, partquantity = ? WHERE sparepartstoredetailid = ?';
		$sqlQuery = new SqlQuery($sql);
		
		$sqlQuery->setNumber($sparepartstoredetail->sparepartid);
		$sqlQuery->set($sparepartstoredetail->partquantity);

		$sqlQuery->setNumber($sparepartstoredetail->sparepartstoredetailid);
		return $this->executeUpdate($sqlQuery);
	}

}
?>