/**
* Constructor
*
* @param array $config An array of configuration options (name, state, ignore_request).
*
* @since 4.0.0
* @throws \Exception
*/
public function __construct($config = array())
{
// Set the view name
if (empty($this->name)) {
if (\array_key_exists('name', $config)) {
$this->name = $config['name'];
} else {
$this->name = $this->getName();
}
}
// Set the model state
if (\array_key_exists('state', $config)) {
$this->state = $config['state'];
}
// Set the internal state marker - used to ignore setting state from the request
if (!empty($config['ignore_request'])) {
$this->__state_set = true;
}
}