本文整理汇总了PHP中app\Task::checkIfExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::checkIfExists方法的具体用法?PHP Task::checkIfExists怎么用?PHP Task::checkIfExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Task
的用法示例。
在下文中一共展示了Task::checkIfExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
$myArray['THU'] = 3.0;
$myArray['FRI'] = 2.0;
$myArray['SAT'] = 10.0;
$description = 'Day of week starts on SAT and ends on SUN';
$timeCardFormat = TimeCardFormat::where('description', '=', $description)->first();
for ($j = 0; $j < appGlobals::DAYS_IN_WEEK_NUM; $j++) {
$pos = $timeCardFormat->{"dow_0" . $j};
echo "For {$pos} the hours worked are: " . $myArray[$pos] . "<br>";
}
});
Route::get('task_fail', function () {
$startTime = '17:00:00';
$endTime = '12:00:00';
$hoursWorked = 5.0;
$notes = "error testing";
if (is_null($task = Task::checkIfExists($startTime))) {
// get $taskType->id
$taskType = TaskType::where('type', '=', 'Code')->first();
// get $timeCard->id
$timeCard = TimeCard::where('date_worked', '=', '2015-11-12')->first();
$task = new Task();
$task->start_time = $startTime;
$task->end_time = $endTime;
$task->hours_worked = $hoursWorked;
$task->notes = $notes;
$task->task_type_id = $taskType->id;
$task->time_card_id = $timeCard->id;
try {
$task->save();
} catch (QueryException $e) {
if ($e->getCode() == appGlobals::TBL_TASK_START_TIME_GT_END_TIME) {