예제 #1
0
 public function saveCropAndTask($crop)
 {
     if (validateCrop($crop) == 0) {
         return "error-validation-crop";
     }
     //end if (validateCrop($crop) == 0)
     foreach ($listTask as $task) {
         if (validateTask($task) == 0) {
             return "error-validation-task";
         }
         //end if (validateTask($task) == 0)
     }
     //end foreach($listTask as $task)
     $cropDao->saveCrop($crop);
 }
예제 #2
0
usleep($delay);
$lunchStart = validatedUserInput(function ($line) {
    return validateTimeInput($line);
});
echo "\nPlease enter the time when you ended your Lunch:\n";
usleep($delay);
$lunchEnd = validatedUserInput(function ($line) {
    return validateTimeInput($line);
});
echo "Ok let`s go now through your tasks after lunch\n";
usleep($delay);
echo "We will do it in the same way as before\n";
usleep($delay);
$secondPart = [];
while ($task = validatedUserInput(function ($line) {
    return validateTask($line);
}, "Please enter here what you did: ")) {
    $secondPart[] = $task;
}
$email = '*****@*****.**';
echo "By default email will be sent to {$email}.\n";
usleep($delay);
echo "If you ok with this one just leave next field empty\n";
usleep($delay);
echo "Or provide other email if you wish so\n";
usleep($delay);
$newEmail = validatedUserInput(function ($line) {
    return validateEmail($line);
});
if ($newEmail) {
    $email = $newEmail;