public function dateAdd($expression, $value, $unit, $types = [])
    {
        if (!is_numeric($value)) {
            $value = 0;
        }
        $interval = $value . ' ' . $unit;
        $expression = $this->_literalArgumentFunction('DATE_ADD', $expression, $types, 'datetime');
        $expression->setConjunction(', INTERVAL')->add([$interval => 'literal']);

        return $expression;
    }
public function dateAdd($expression, $value, $unit, $types = [])
    {
        if (!is_numeric($value)) {
            $value = 0;
        }
        $interval = $value . ' ' . $unit;
        $expression = $this->_literalArgumentFunction('DATE_ADD', $expression, $types, 'datetime');
        $expression->setConjunction(', INTERVAL')->add([$interval => 'literal']);

        return $expression;
    }
public function dateAdd ( $ expression , $ value , $ unit , $ types = [ ] ) { if ( ! is_numeric ( $ value ) ) { $ value = 0 ; } $ interval = $ value . ' ' . $ unit ; $ expression = $ this -> _literalArgumentFunction ( 'DATE_ADD' , $ expression , $ types , 'datetime' ) ; $ expression -> setConjunction ( ', INTERVAL' ) -> add ( [ $ interval => 'literal' ] ) ; return $ expression ; }
Add the time unit to the date expression

@param string $expression Expression to obtain the date part from.
@param string $value Value to be added. Use negative to subtract.
@param string $unit Unit of the value e.g. hour or day.
@param array $types list of types to bind to the arguments
@return \Cake\Database\Expression\FunctionExpression
Add the time unit to the date expression