示例#1
0
 /**
  * @param $managerId
  * @return array
  */
 public function getManagersPOListJson($managerId)
 {
     $expenseDao = new Expenses($this->getServiceLocator(), '\\ArrayObject');
     $pos = $expenseDao->getManagerPOs($managerId);
     $poList = [];
     if ($pos->count()) {
         foreach ($pos as $po) {
             $validity = '';
             if (!is_null($po['expected_completion_date_start']) && !is_null($po['expected_completion_date_end'])) {
                 $validity = date(Constants::GLOBAL_DATE_FORMAT, strtotime($po['expected_completion_date_start'])) . ' - ' . date(Constants::GLOBAL_DATE_FORMAT, strtotime($po['expected_completion_date_end']));
             }
             $po['title'] .= $validity;
             unset($po['expected_completion_date_start']);
             unset($po['expected_completion_date_end']);
             array_push($poList, $po);
         }
     }
     return json_encode($poList);
 }