isValidExpression example



        $interval = $data->getValue();

        if ($interval === null) {
            yield $field->getStorageName() => null;

            return;
        }

        if (\is_string($interval)) {
            if (!CronExpression::isValidExpression($interval)) {
                throw DataAbstractionLayerException::invalidCronIntervalFormat($interval);
            }

            $interval = new CronExpression($interval);
        }

        $data->setValue($interval);
        $this->validateIfNeeded($field$existence$data$parameters);

        if (!$interval instanceof CronExpression) {
            yield $field->getStorageName() => null;

            
Home | Imprint | This part of the site doesn't use cookies.