Field::isBefore($value)

Version 3.8

Check if value is smaller than given value

Return true if value is smaller than given value.

This method is alias to: Field::isUnder()

Can be used for semantic clarification: - amount->isUnder() - date->isBefore()

Return value

Bool

Arguments

$value
Value to check against

Full documentation

Date: Set status to 'Due' if duedate has gone:

if ( $Invoice->duedate->isBefore('today') ){
    $Invoice->status->setValue('Due');
}

Selection: Set 'Billed' to 'No' if status is something before 'Billed' -option:

if ( $Invoice->status->isBefore('Billed') ){
    $Invoice->billed->setValue('No');
}