# adminify/4.1.3/Inc/base-model.php

Adminify – White Label, Admin Menu Editor, Login Customizer, version 4.1.3. 26 lines.

- Page: https://pluginprobe.com/plugins/adminify/4.1.3/code/Inc/base-model.php
- Raw: https://pluginprobe.com/plugins/adminify/4.1.3/raw/Inc/base-model.php
- Modified: 2024-08-24T11:24:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/adminify/4.1.3/code/Inc/base-model.php#L10-L20`.

```php
<?php

namespace WPAdminify\Inc;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

abstract class Base_Model extends Base_Data {

	protected function init( $data ) {
		$this->set( array_merge( $this->get_defaults(), $data ) );
	}

	public function get_default_field( $field ) {
		$fields = $this->get_defaults();
		return isset( $fields[ $field ] ) ? $fields[ $field ] : null;
	}

	public function __construct( $data ) {
		if ( $data ) {
			$this->init( $data );
		}
	}
}

```
