Field::isCleared()

Version 3.8

Check if value in field is removed

Returns TRUE, if field is changed and contains no valid value.

Return value

Bool

Full documentation

If status is changed and it has no new value:

if ( $Order->status->isCleared() ){
    // Order status is changed to empty
}

This is shorthand for:

if ( $Order->status->isChanged() && $Order->status->isEmpty() ){
    // Order status is changed to empty
}