So I have to create an object design for this application, it is just problem for practicing.
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)
I wrote this, only thing that is missing is method for selecting only columns that I need. Is this good structure ? I am new 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) {
}
}