Empty
Empty class
Empty class
Loop through join field that does not exists:
foreach ( $Order->missing_field->getPages() as $Row ){
// This is not executed, because Empty::getPages() will return empty array
}
Check if field that does not exists has a value:
if ( $Order->missing_field->isGiven() ){
// This is not executed, since Empty::isGiven() always returns false.
}
Setting value to field that does not exists:
$Order->missing_field->setValue(123);
// Value is set to Empty object, which is not handled in save.
Method list
| Method | Return value | Description |
|---|---|---|
| isField() | false | |
| isPage() | false | |
| isTable() | false | |
| getId() | 0 | |
| isGiven() | false | |
| isChanged() | false | |
| hasValue() | false | |
| getValue() | '' | Empty string |
| getNumber() | 0 | |
| __get() | Empty | Allow chaining in non-existing path |
| __call() | Empty | Allow chaining in non-existing path |