praiadeseselle/wire/core/NullField.php

20 lines
376 B
PHP
Raw Normal View History

2022-03-08 15:55:41 +01:00
<?php namespace ProcessWire;
/**
* ProcessWire NullField
*
* Represents a Field object that doesn't exist.
*
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
* https://processwire.com
*
*/
class NullField extends Field implements WireNull {
public function get($key) {
if($key == 'id') return 0;
if($key == 'name') return '';
return parent::get($key);
}
}