ContractCost::getLastCostForContract PHP Method

getLastCostForContract() public method

Get last datas for a contract
public getLastCostForContract ( $contracts_id )
$contracts_id integer ID of the contract
    function getLastCostForContract($contracts_id)
    {
        global $DB;
        $query = "SELECT *\n                FROM `" . $this->getTable() . "`\n                WHERE `contracts_id` = '{$contracts_id}'\n                ORDER BY 'end_date' DESC, `id` DESC";
        if ($result = $DB->query($query)) {
            return $DB->fetch_assoc($result);
        }
        return array();
    }