Exemplo n.º 1
0
 public function PdContract($option = null)
 {
     if ($option != null && is_array($option)) {
         if (array_key_exists('date_begin', $option)) {
             $beginBundle = $option['date_begin'];
             $date_begin = $beginBundle['id'];
         } else {
             $date_begin = $this->date_begin;
         }
         $date_begin = \Helper::parseDate($date_begin);
         if (array_key_exists('date_end', $option)) {
             $endBundle = $option['date_end'];
             $date_end = $endBundle['id'];
         } else {
             $date_end = $this->date_end;
         }
         $date_end = \Helper::parseDate($date_end);
         $sourceData = ['date_begin' => $date_begin, 'date_end' => $date_end];
         return PdContract::getByDateRange($sourceData);
     }
     return null;
 }