0
我必須調整這個模塊,以便在週六,週日和公共假期不會扣除員工休假。我有我的解決方法,但我不知道什麼時候面向對象編程。任何人都可以向我解釋這塊報價的含義是什麼?尤其是「$節點 - > frmdate」和「$節點 - > TODATE」Drupal模塊:PHP:面向對象:Galatranet假期管理系統
function leavemgt_update($node) {
if ($node->revision) {
leavemgt_insert($node);
}
else {
$node->frmdate = mktime(0,0,0, $node->frmdate['month'], $node->frmdate['day'],$node->frmdate['year']);
$node->todate = mktime(0,0,0, $node->todate['month'], $node->todate['day'],$node->todate['year']);
$date1 = format_date($node->frmdate, $type = 'custom', $format = 'd/m/Y', $timezone = NULL, $langcode = NULL);
$date2 = format_date($node->todate, $type = 'custom', $format = 'd/m/Y', $timezone = NULL, $langcode = NULL);
$diff= (dateDiff("/",$date2,$date1)+1);
當你不知道變量包含什麼,['var_dump()'](http://php.net/manual/en/function.var-dump.php)是你的朋友:) –