Quindi devo creare un oggetto design per questa applicazione, è solo un problema per esercitarsi.
You are building application that will load data from several different advertising systems and then store the data into database, so it will be possible to analyze them.
You need to take in mind that every advertising system has different structure of report: Different named columns, different order of columns, different date formats Also data from ad systems are in different data formats(JSON,CSV,XML),
Reports from each system contains different amount of columns, our application is interested only in some of them(in every system they have different name)
Ho scritto questo, solo ciò che manca è il metodo per selezionare solo le colonne di cui ho bisogno. Questa buona struttura? Sono nuovo o OOP.
class Report {
protected $data = [];
protected $dataTypes = [];
public function loadReport($adSystem){ return $data}
public function loadAllReports($adSystemCollection){ return $data}
}
class Decode{
protected $data = [];
protected $dataTypes = [];
public function getType($data){ return $dataTypes};
public function getAllTypes($data){ return $dataTypes};
public function getColumns($data, $columns){ return $data}
public function convertToString($data,$dataTypes){ return $data}
}
}
class Query{
$databaseConnection = "";
public function __construct(){
//get database connection
return void;
}
public function save($data){ return null};
public function loadData($key){ return $data};
}
class Collection
{
private $items = array();
public function addItem($obj, $key = null) {
}
public function deleteItem($key) {
}
public function getItem($key) {
}
}