Drupal 模块:PHP:面向对象:Galatranet 休假管理系统
我必须调整这个模块,使其在周六、周日和公共假期时不会扣除员工的假期。我对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Drupal中,$node是标准类对象,它包含有关节点和每个节点的所有信息
In Drupal, $node is standard Class Object which contains all information about node and every nodes