public function saveUrl($merchandiseId, $url) { $dm = new App_Merchandise_Dm(); $dm->setImageUrl($url)->setLastUpdateTime(Pw::getTime()); $result = $this->_getMerchandiseDs()->update($merchandiseId, $dm); return $result; }
private function updateMerchandiseCurrentPrice($merchandiseId, $discount, $promoTemplateId) { $promotion = $this->_getPromoDs()->getPromoByTemplateId($promoTemplateId); $merchandise = $this->_getMerchandiseDs()->getMerchandiseById($merchandiseId); $discountedPrice = $this->_getPromotionsDs()->getPromo($promotion['name'])->get_discounted_price($merchandise['price'], $discount); $dm = new App_Merchandise_Dm(); $dm->setCurrentPrice($discountedPrice)->setLastUpdateTime(Pw::getTime()); $this->_getMerchandiseDs()->update($merchandiseId, $dm); }
/** * update record * * @param App_Merchandise_Dm $dm * @return multitype:|Ambigous <boolean, number, rowCount> */ public function update($id, App_Merchandise_Dm $dm) { if (true !== ($r = $dm->beforeUpdate())) { return $r; } return $this->loadDao()->update($id, $dm->getData()); }