本文整理汇总了PHP中Visitor::setTimeIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Visitor::setTimeIn方法的具体用法?PHP Visitor::setTimeIn怎么用?PHP Visitor::setTimeIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visitor
的用法示例。
在下文中一共展示了Visitor::setTimeIn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeUpdate
public function executeUpdate()
{
$member_code = $this->getRequestParameter('code');
$member = MemberPeer::retrieveByCode($member_code);
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$now = date('dmY');
$time = date('Y/m/d h:i');
$i18n = new sfI18N();
$i18n->initialize($this->getContext());
$i18n->setCulture($this->getUser()->getCulture());
$action_i18n = $i18n->globalMessageFormat->format('save as new');
$action_type = $this->getRequestParameter('action_type');
if ($member->hasVisit()) {
//$pk = $member()->getVisitorId()->getId();
//$visitor = VisitorPeer::retrieveByPk($this->getRequestParameter('id'));
$member_id = $member->getId();
$visitor = VisitorPeer::retrieveByMember($member_id);
$this->forward404Unless($visitor);
//$c = new Criteria();
//$c->add(VisitorPeer::ID, $pk);
//$visitor = VisitorPeer::doSelectOne($c);
$visitor->setTimeOut($time);
$visitor->save();
return $this->redirect('default/index2');
} else {
$visitor = new Visitor();
$visitor->setId($this->getRequestParameter('id'));
$visitor->setMemberId($member->getId());
$visitor->setTimeIn($time);
$visitor->setDepartmentId($dept->getId());
$visitor->setCode($now);
$visitor->save();
return $this->redirect('default/index2');
}
}