/** * Return array of investment buildings. * @return InvestmentBuilding[] */ public function GetBuildings() { if ($this->_Buildings == null) { $this->SetBuildings(InvestmentBuildings::GetInvestmentBuildings($this->GetId(), $this->GetIdLng())); } return $this->_Buildings; }
/** * Delete investment from database, given by ID. * @param int $id */ public static function DeleteInvestment($id) { $investment = self::GetInvestment($id); if ($investment != null) { OfferPhotos::DeletePhotosInvestment($id); InvestmentBuildings::DeleteInvestmentBuildings($id); $result = DataBase::GetDbInstance()->ExecuteQueryWithParams("DELETE FROM #S#investments_properties WHERE investments_id=?", array((int) $id)); $result = DataBase::GetDbInstance()->ExecuteQueryWithParams("DELETE FROM #S#investments WHERE id=?", array((int) $investment->GetId())); } }
/** * Return investment building as object. * @return Investment */ public function GetInvestmentBuilding() { if ($this->_InvestmentBuldingObj == null) { $this->_InvestmentBuldingObj = InvestmentBuildings::GetInvestmentBuilding($this->GetInvestmentBuildingId()); } return $this->_InvestmentBuldingObj; }
/** * Returns a investment building object from the database by ID. * @param $id InvestmentsBuilding Id. * @return InvestmentBuilding */ public function GetInvestmentBuilding($id) { return InvestmentBuildings::GetInvestmentBuilding($id); }