PHP code example of carles / scheduled-command-bundle
1. Go to this page and download the library: Download carles/scheduled-command-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
carles / scheduled-command-bundle example snippets
use CommandSchedulerBundle\Entity\ScheduledCommand;
$scheduledCommand = new ScheduledCommand();
$scheduledCommand->setCommand("echo 'Happy New Year'");
$scheduledCommand->setDatetime(new \DateTime('01-01-2020 00:00:00'));
$this->getDoctrine()->getManager()->persist($scheduledCommand);
$this->getDoctrine()->getManager()->flush();