CC-733 : playout history
translating mDataProp values to be able to search table on backend
This commit is contained in:
parent
53b8eb2724
commit
c66b55ec17
4 changed files with 29 additions and 6 deletions
|
@ -15,6 +15,15 @@ class Application_Model_PlayoutHistory {
|
|||
private $epoch_now;
|
||||
private $opts;
|
||||
|
||||
private $mDataPropMap = array(
|
||||
"artist" => "file.artist_name",
|
||||
"title" => "file.track_title",
|
||||
"played" => "playout.played",
|
||||
"length" => "file.length",
|
||||
"composer" => "file.composer",
|
||||
"copyright" => "file.copyright",
|
||||
);
|
||||
|
||||
public function __construct($p_startDT, $p_endDT, $p_opts) {
|
||||
|
||||
$this->con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
||||
|
@ -25,8 +34,21 @@ class Application_Model_PlayoutHistory {
|
|||
$this->opts = $p_opts;
|
||||
}
|
||||
|
||||
/*
|
||||
* map front end mDataProp labels to proper column names for searching etc.
|
||||
*/
|
||||
private function translateColumns() {
|
||||
|
||||
for ($i = 0; $i < $this->opts["iColumns"]; $i++){
|
||||
|
||||
$this->opts["mDataProp_{$i}"] = $this->mDataPropMap[$this->opts["mDataProp_{$i}"]];
|
||||
}
|
||||
}
|
||||
|
||||
public function getItems() {
|
||||
|
||||
$this->translateColumns();
|
||||
|
||||
$select = array(
|
||||
"file.track_title as title",
|
||||
"file.artist_name as artist",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue