Ejemplo n.º 1
0
 public static function stateChangesBetween($_cmd_id, $_value = null, $_startDate, $_endDate)
 {
     if (!is_numeric(str_replace('#', '', $_cmd_id))) {
         $cmd = cmd::byId(str_replace('#', '', cmd::humanReadableToCmd($_cmd_id)));
     } else {
         $cmd = cmd::byId(str_replace('#', '', $_cmd_id));
     }
     if (!is_object($cmd) || $cmd->getIsHistorized() == 0) {
         return '';
     }
     $cmd_id = $cmd->getId();
     $args = func_num_args();
     if ($args == 3) {
         $_endDate = func_get_arg(2);
         $_startDate = func_get_arg(1);
         $_value = null;
     }
     $_startDate = date('Y-m-d H:i:s', strtotime(self::setTags($_startDate)));
     $_endDate = date('Y-m-d H:i:s', strtotime(self::setTags($_endDate)));
     return history::stateChanges($cmd_id, $_value, $_startDate, $_endDate);
 }