Drupal 模块:PHP:面向对象:Galatranet 休假管理系统

发布于 2024-12-07 20:05:31 字数 770 浏览 0 评论 0原文

我必须调整这个模块,使其在周六、周日和公共假期时不会扣除员工的假期。我对 php 有自己的一套方法,但我不知道什么时候涉及到面向对象编程。谁能向我解释一下这段引用的含义是什么?特别是“$node->frmdate”和“$node->todate”

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);

I have to tweak this module so that it will not deduct employee's leave when it comes to Saturday, Sunday and public holidays. I have my way around php but I have no idea when it comes to object oriented programming. can anyone explain to me what this block of quote means? especially "$node->frmdate" and "$node->todate"

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);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最美不过初阳 2024-12-14 20:05:31

在Drupal中,$node是标准类对象,它包含有关节点和每个节点的所有信息

In Drupal, $node is standard Class Object which contains all information about node and every nodes

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文