Actionクラスのgetプロパティーにデータ変換用の記述を書くことで人間にとって意味を成す情報(表示)を生成します。
class List_Index { var $DTO; var $listDAO; function execute() { $log =& LogFactory::getLog(); $log->debug("List_Indexが実行されました", "List_Index#execute"); $this->DTO = $this->listDAO->factory(); //point1 return "success"; } function getDTO() { if($this->DTO){ foreach($this->DTO as $key => $set){ $this->DTO[$key]['disp_date'] = strftime("%Y/%m/%d",$set['date']); } } //point2 return $this->DTO; } function setListDAO($dao) { $this->listDAO = $dao; } }
array(1) { 0 => array(4) { file_name => string(14) 1118166138.gif title => string(7) testGIF date => int 1118166138 user_name => string(4) test } }
array(1) { 0 => array(5) { file_name => string(14) 1118166138.gif title => string(7) testGIF date => int 1118166138 user_name => string(4) test disp_date => string(10) 2005/06/08 } }