original_string: protected static function _getDateString($value)
      {
          $formatted = '';
          if (isset($value['year'], $value['month'], $value['day']) &&
              (is_numeric($value['year']) && is_numeric($value['month']) && is_numeric($value['day']))
          ) {
              $formatted .= sprintf('%d-%02d-%02d ', $value['year'], $value['month'], $value['day']);
          }
  
          if (isset($value['hour'])) {
              if (isset($value['meridian']) && (int)$value['hour'] === 12) {
                  $value['hour'] = 0;
              }
              if (isset($value['meridian'])) {
                  $value['hour'] = strtolower($value['meridian']) === 'am' ? $value['hour'] : $value['hour'] + 12;
              }
              $value += ['minute' => 0, 'second' => 0];
              if (is_numeric($value['hour']) && is_numeric($value['minute']) && is_numeric($value['second'])) {
                  $formatted .= sprintf('%02d:%02d:%02d', $value['hour'], $value['minute'], $value['second']);
              }
          }
  
          return trim($formatted);
      }
code: protected static function _getDateString($value)
      {
          $formatted = '';
          if (isset($value['year'], $value['month'], $value['day']) &&
              (is_numeric($value['year']) && is_numeric($value['month']) && is_numeric($value['day']))
          ) {
              $formatted .= sprintf('%d-%02d-%02d ', $value['year'], $value['month'], $value['day']);
          }
  
          if (isset($value['hour'])) {
              if (isset($value['meridian']) && (int)$value['hour'] === 12) {
                  $value['hour'] = 0;
              }
              if (isset($value['meridian'])) {
                  $value['hour'] = strtolower($value['meridian']) === 'am' ? $value['hour'] : $value['hour'] + 12;
              }
              $value += ['minute' => 0, 'second' => 0];
              if (is_numeric($value['hour']) && is_numeric($value['minute']) && is_numeric($value['second'])) {
                  $formatted .= sprintf('%02d:%02d:%02d', $value['hour'], $value['minute'], $value['second']);
              }
          }
  
          return trim($formatted);
      }
code_tokens: protected static function _getDateString ( $ value ) { $ formatted = '' ; if ( isset ( $ value [ 'year' ] , $ value [ 'month' ] , $ value [ 'day' ] ) && ( is_numeric ( $ value [ 'year' ] ) && is_numeric ( $ value [ 'month' ] ) && is_numeric ( $ value [ 'day' ] ) ) ) { $ formatted .= sprintf ( '%d-%02d-%02d ' , $ value [ 'year' ] , $ value [ 'month' ] , $ value [ 'day' ] ) ; } if ( isset ( $ value [ 'hour' ] ) ) { if ( isset ( $ value [ 'meridian' ] ) && ( int ) $ value [ 'hour' ] === 12 ) { $ value [ 'hour' ] = 0 ; } if ( isset ( $ value [ 'meridian' ] ) ) { $ value [ 'hour' ] = strtolower ( $ value [ 'meridian' ] ) === 'am' ? $ value [ 'hour' ] : $ value [ 'hour' ] + 12 ; } $ value += [ 'minute' => 0 , 'second' => 0 ] ; if ( is_numeric ( $ value [ 'hour' ] ) && is_numeric ( $ value [ 'minute' ] ) && is_numeric ( $ value [ 'second' ] ) ) { $ formatted .= sprintf ( '%02d:%02d:%02d' , $ value [ 'hour' ] , $ value [ 'minute' ] , $ value [ 'second' ] ) ; } } return trim ( $ formatted ) ; }
docstring: Converts an array representing a date or datetime into a ISO string.
  The arrays are typically sent for validation from a form generated by
  the CakePHP FormHelper.
  
  @param array $value The array representing a date or datetime.
  @return string
docstring_tokens: Converts an array representing a date or datetime into a ISO string . The arrays are typically sent for validation from a form generated by the CakePHP FormHelper .