51 private $timezoneConverter;
65 \
Magento\Framework\Data\Collection\AbstractDb $resourceCollection =
null,
90 $e = preg_split(
'#\s+#', $expr,
null, PREG_SPLIT_NO_EMPTY);
91 if (
sizeof($e) < 5 ||
sizeof($e) > 6) {
95 $this->setCronExprArr($e);
108 $time = $this->getScheduledAt();
109 $e = $this->getCronExprArr();
114 if (!is_numeric($time)) {
117 $time = $this->timezoneConverter->date($time)->format(
'Y-m-d H:i');
118 $time = strtotime($time);
147 if (strpos($expr,
',') !==
false) {
148 foreach (explode(
',', $expr) as $e) {
157 if (strpos($expr,
'/') !==
false) {
158 $e = explode(
'/', $expr);
159 if (
sizeof($e) !== 2) {
160 throw new CronException(
__(
'Invalid cron expression, expecting \'match/modulus\': %1', $expr));
162 if (!is_numeric($e[1])) {
163 throw new CronException(
__(
'Invalid cron expression, expecting numeric modulus: %1', $expr));
175 }
elseif (strpos($expr,
'-') !==
false) {
177 $e = explode(
'-', $expr);
178 if (
sizeof($e) !== 2) {
179 throw new CronException(
__(
'Invalid cron expression, expecting \'from-to\' structure: %1', $expr));
190 if ($from ===
false || $to ===
false) {
194 return $num >= $from && $num <= $to && $num % $mod === 0;
254 self::STATUS_RUNNING,
257 $this->setStatus(self::STATUS_RUNNING);
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[], TimezoneInterface $timezoneConverter=null)
matchCronExpression($expr, $num)