本文整理汇总了PHP中Logs::LogMsg方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::LogMsg方法的具体用法?PHP Logs::LogMsg怎么用?PHP Logs::LogMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logs
的用法示例。
在下文中一共展示了Logs::LogMsg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
public static function boot()
{
parent::boot();
static::created(function ($record) {
$kitTypeID = $record->KitType;
$kitID = $record->ID;
Logs::LogMsg(4, $kitTypeID, $kitID, null, "Created Kit: " . $record->Name);
return true;
});
static::updating(function ($record) {
$kitTypeID = $record->KitType;
$kitID = $record->ID;
$dirty = $record->getDirty();
foreach ($dirty as $field => $newdata) {
$olddata = $record->getOriginal($field);
if ($olddata != $newdata) {
Logs::LogMsg(5, $kitTypeID, $kitID, null, "Changed Kit field: " . $field . " From:" . $olddata . " To:" . $newdata);
}
}
return true;
});
static::deleting(function ($record) {
$kitTypeID = $record->KitType;
$kitID = $record->ID;
Logs::LogMsg(6, $kitTypeID, $kitID, null, "Deleted Kit: " . $record->Name);
return true;
});
}
示例2: boot
public static function boot()
{
parent::boot();
static::created(function ($record) {
$kitTypeID = $record->kit->KitType;
$kitID = $record->kit->ID;
Logs::LogMsg(10, $kitTypeID, $kitID, $record->ID, "Added content: " . $record->Name);
return true;
});
static::updating(function ($record) {
$kitTypeID = $record->kit->KitType;
$kitID = $record->kit->ID;
$dirty = $record->getDirty();
foreach ($dirty as $field => $newdata) {
$olddata = $record->getOriginal($field);
if ($olddata != $newdata) {
Logs::LogMsg(11, $kitTypeID, $kitID, $record->ID, "Changed " . $field . " From:" . $olddata . " To:" . $newdata);
}
}
return true;
});
static::deleting(function ($record) {
$kitTypeID = $record->kit->KitType;
$kitID = $record->kit->ID;
Logs::LogMsg(12, $kitTypeID, $kitID, $record->ID, "Removed Contents: " . $record->Name);
return true;
});
}
示例3: boot
public static function boot()
{
parent::boot();
static::created(function ($record) {
$userName = "";
if (isset($record->UserID)) {
$userName = User::find($record->UserID)->username;
} else {
$userName = $record->Email;
}
$primaryBooker = " as primary booker";
if (!$record->Booker) {
$primaryBooker = " as secondary contact";
}
Logs::LogMsg(18, $record->booking->kit->KitType, $record->booking->kit->ID, $record->booking->branch->ID, "Added user:" . $userName . $primaryBooker);
return true;
});
static::updating(function ($record) {
$dirty = $record->getDirty();
foreach ($dirty as $field => $newdata) {
$olddata = $record->getOriginal($field);
if ($olddata != $newdata) {
Logs::LogMsg(19, $record->booking->kit->KitType, $record->booking->kit->ID, $record->booking->branch->ID, $field . " changed From:" . $olddata . " To:" . $newdata);
}
}
return true;
});
static::deleting(function ($record) {
Logs::LogMsg(20, $record->booking->kit->KitType, $record->booking->kit->ID, $record->booking->branch->ID, "Detail deleted by:" . Auth::user()->username);
return true;
});
}
示例4: boot
public static function boot()
{
parent::boot();
static::created(function ($record) {
Logs::LogMsg(13, $record->kit->KitType, $record->kit->ID, $record->branch->ID, "Booking for:" . $record->branch->BranchID . " from:" . $record->StartDate . " To:" . $record->EndDate);
return true;
});
static::updating(function ($record) {
$dirty = $record->getDirty();
foreach ($dirty as $field => $newdata) {
$olddata = $record->getOriginal($field);
if ($olddata != $newdata) {
Logs::LogMsg(15, $record->kit->KitType, $record->kit->ID, $record->branch->ID, "Changed booking " . $field . " From:" . $olddata . " To:" . $newdata);
}
}
return true;
});
static::deleting(function ($record) {
Logs::LogMsg(14, $record->kit->KitType, $record->kit->ID, $record->branch->ID, "Booking Deleted by:" . Auth::user()->username);
return true;
});
}
示例5: boot
public static function boot()
{
parent::boot();
static::created(function ($record) {
Logs::LogMsg(7, $record->ID, null, null, "Type Created");
return true;
});
static::updating(function ($record) {
$dirty = $record->getDirty();
foreach ($dirty as $field => $newdata) {
$olddata = $record->getOriginal($field);
if ($olddata != $newdata) {
Logs::LogMsg(19, $record->ID, null, null, $field . " changed From:" . $olddata . " To:" . $newdata);
}
}
return true;
});
static::deleting(function ($record) {
Logs::LogMsg(20, $record->ID, null, null, "Kit type deleted by:" . Auth::user()->username);
return true;
});
}
示例6: Note
public static function Note($KityTypeID, $KitID, $ContentsID, $Message)
{
return Logs::LogMsg(3, $KityTypeID, $KitID, $ContentsID, $Message);
}