praiadeseselle/wire/core/NullField.php
2022-03-08 15:55:41 +01:00

19 lines
376 B
PHP

<?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);
}
}