本文整理汇总了PHP中ApplicationLogs::setIsPrivateForType方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationLogs::setIsPrivateForType方法的具体用法?PHP ApplicationLogs::setIsPrivateForType怎么用?PHP ApplicationLogs::setIsPrivateForType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationLogs
的用法示例。
在下文中一共展示了ApplicationLogs::setIsPrivateForType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Save this list
*
* @param void
* @return boolean
*/
function save()
{
parent::save();
$tasks = $this->getTasks();
if (is_array($tasks)) {
$task_ids = array();
foreach ($tasks as $task) {
$task_ids[] = $task->getId();
}
// if
if (count($task_ids)) {
ApplicationLogs::setIsPrivateForType($this->isPrivate(), 'ProjectTasks', $task_ids);
}
// if
}
// if
return true;
}
示例2: save
/**
* Save this list
*
* @param void
* @return boolean
*/
function save()
{
if (!$this->isNew()) {
$old_me = ProjectTasks::findById($this->getId(), true);
if (!$old_me instanceof ProjectTask) {
return;
}
// TODO: check this!!!
/* This was added cause deleting some tasks was giving an error, couldn't reproduce it again, but this solved it */
}
if ($this->isNew() || $this->getAssignedToCompanyId() != $old_me->getAssignedToCompanyId() || $this->getAssignedToUserId() != $old_me->getAssignedToUserId()) {
$this->setAssignedBy(logged_user());
$this->setAssignedOn(DateTimeValueLib::now());
}
$due_date_changed = false;
if (!$this->isNew()) {
$old_due_date = $old_me->getDueDate();
$due_date = $this->getDueDate();
if ($due_date instanceof DateTimeValue) {
if (!$old_due_date instanceof DateTimeValue || $old_due_date->getTimestamp() != $due_date->getTimestamp()) {
$due_date_changed = true;
}
} else {
if ($old_due_date instanceof DateTimeValue) {
$due_date_changed = true;
}
}
}
parent::save();
if ($due_date_changed) {
$id = $this->getId();
$sql = "UPDATE `" . TABLE_PREFIX . "object_reminders` SET\n\t\t\t\t`date` = date_sub((SELECT `due_date` FROM `" . TABLE_PREFIX . "project_tasks` WHERE `id` = {$id}),\n\t\t\t\t\tinterval `minutes_before` minute) WHERE\n\t\t\t\t\t`object_manager` = 'ProjectTasks' AND `object_id` = {$id};";
DB::execute($sql);
}
$tasks = $this->getSubTasks();
if (is_array($tasks)) {
$task_ids = array();
foreach ($tasks as $task) {
$task_ids[] = $task->getId();
}
// if
if (count($task_ids) > 0) {
ApplicationLogs::setIsPrivateForType($this->isPrivate(), 'ProjectTasks', $task_ids);
}
// if
}
// if
return true;
}