public static function buildLineWithCurrent(Cotation $cot) { $html = ""; $tdImg = self::buildImgTag($cot->getImage()) . "<a class='open-chart-window'>" . $cot->getMonth() . "</a>"; $html .= self::buildTD($tdImg); $html .= self::buildTD($cot->getLast()); $class = $cot->getDiff() >= 0 ? "positive" : "negative"; $html .= self::buildTD($cot->getDiff(), $class); $html .= self::buildTD($cot->openContracts()); return $html; }
private function saveOrUpdateCotations(PDOStatement $query, Cotation $cotation) { //$query = $this->session->prepare($sql); $query->bindParam(":code", $cotation->getCode()); $query->bindParam(":open", str_replace(",", "", $cotation->getOpen())); $query->bindParam(":close", str_replace(",", "", $cotation->getClose())); $query->bindParam(":max", str_replace(",", "", $cotation->getMax())); $query->bindParam(":min", str_replace(",", "", $cotation->getMin())); $query->bindParam(":diff", str_replace(",", "", $cotation->getDiff())); $query->bindParam(":openCont", str_replace(",", "", $cotation->openContracts())); $query->bindParam(":date", date('Y-m-d')); $query->execute(); return $query->rowCount(); }