<?php

/**
 * Class that operate on table 'taskorderproducts'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2018-11-18 12:20
 */
class TaskorderproductsMySqlExtDAO extends TaskorderproductsMySqlDAO {

    public function queryAllProductsByTaskOrderId($id) {
        $sql = 'SELECT taskorderproducts. * , product.productName ,product.productBuyPrice , unit.unitName,productunit.productnumber
		FROM taskorderproducts
		JOIN product
			 ON product.productId = taskorderproducts.productId
		JOIN productunit
			 ON  productunit.productunitid=taskorderproducts.unitId
		JOIN unit
         	 ON unit.unitId= productunit.unitid
		where taskorderproducts.taskorderid=' . $id . '
		';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

}

?>