public function validateData(\Magento\Framework\DataObject $dataObject)
    {
        $result = [];
        $fromDate = $toDate = null;

        if ($dataObject->hasFromDate() && $dataObject->hasToDate()) {
            $fromDate = $dataObject->getFromDate();
            $toDate = $dataObject->getToDate();
        }

        if ($fromDate && $toDate) {
            $fromDate = $this->dateFilter->filter($fromDate);
            $toDate = $this->dateFilter->filter($toDate);

            if ($fromDate > $toDate) {
                $result[] = __('End Date must follow Start Date.');
            }
        }

        return !empty($result) ? $result : true;
    }
public function validateData(\Magento\Framework\DataObject $dataObject)
    {
        $result = [];
        $fromDate = $toDate = null;

        if ($dataObject->hasFromDate() && $dataObject->hasToDate()) {
            $fromDate = $dataObject->getFromDate();
            $toDate = $dataObject->getToDate();
        }

        if ($fromDate && $toDate) {
            $fromDate = $this->dateFilter->filter($fromDate);
            $toDate = $this->dateFilter->filter($toDate);

            if ($fromDate > $toDate) {
                $result[] = __('End Date must follow Start Date.');
            }
        }

        return !empty($result) ? $result : true;
    }
public function validateData ( \ Magento \ Framework \ DataObject $ dataObject ) { $ result = [ ] ; $ fromDate = $ toDate = null ; if ( $ dataObject -> hasFromDate ( ) && $ dataObject -> hasToDate ( ) ) { $ fromDate = $ dataObject -> getFromDate ( ) ; $ toDate = $ dataObject -> getToDate ( ) ; } if ( $ fromDate && $ toDate ) { $ fromDate = $ this -> dateFilter -> filter ( $ fromDate ) ; $ toDate = $ this -> dateFilter -> filter ( $ toDate ) ; if ( $ fromDate > $ toDate ) { $ result [ ] = __ ( 'End Date must follow Start Date.' ) ; } } return ! empty ( $ result ) ? $ result : true ; }
Validate optimizer data

@param \Magento\Framework\DataObject $dataObject The Optimizer

@return bool|string[] - return true if validation passed successfully. Array with errors description otherwise
Validate optimizer data