: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace NinjaForms\Includes\Handlers;
use NinjaForms\Includes\Contracts\Field as ContractsField;
* Honor Field contract providing NF Field object methods
* Provides functionality normally handled by the field object created by
* \Ninja_Forms()->form()->get_field( $fieldId )
class Field implements ContractsField
protected $settings = [];
public function get_id(): int
public function get_tmp_id()
public function get_type(): string
public function get_setting($setting, $default = FALSE)
if (isset($this->settings[$setting])) {
$return = $this->settings[$setting];
public function get_settings(): array
public function update_setting($key, $value): Field
public function update_settings($data): Field
public function find($parent_id = '', array $where = array()): array
public function get_object_settings($obj_array): array
public function _insert_row($data = array()): void
public function cache($cache = ''): Field
public function add_parent($parent_id, $parent_type): Field
public static function import(array $settings, $field_id = '', $is_conversion = FALSE): void
* Construct entity from associative array
public static function fromArray(array $items): Field
foreach ($items as $property => $value) {
$obj = $obj->__set($property, $value);
* Magic method getter for properties
public function __get($name)
$getter = 'get' . ucfirst($name);
if (method_exists($this, $getter)) {
return call_user_func([$this, $getter]);
if (property_exists($this, $name)) {
if (isset($this->$name)) {
* Magic method setter for properties
public function __set(string $name, $value)
$setter = 'set' . ucfirst($name);
if (method_exists($this, $setter)) {
return call_user_func([$this, $setter], $value);
} catch (\TypeError $e) {
// Do not set invalid type
if (property_exists($this, $name)) {