Answer the question
In order to leave comments, you need to log in
How to properly implement OOP structure?
Hello! Please advise how best to do it. My task is to take information from the database and write it into an xml file, after converting it according to the requirements of the site (the main problem is that the names of the fields in the database and on the site are different), to which I send the feed. information of this kind.
We have motorcycle, car, truck, etc. (as in rights) and they can be rented or sold.
I wrote a class that receives an array with data from the database
function __construct($data) {
$this->data = $data;
}
public function motoSale($value) {
// какое-то преобразование
return $dataForXml;
}
public function motoRent($value) {
// какое-то преобразование
return $dataForXml;
public function general($val) {
// что-то делаем
return $generalData;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question