Base Database Model

It is a method to get model state variables.

  • param string $property - Optional parameter name
  • param mixed $default - Optional default value
  • return mixed - The property where specified, the state object where omitted
public function getState($property = null, $default = null)
{
if (!$this->__state_set)
{
// Protected method to auto-populate the model state.
$this->populateState();

// Set the model state set flag to true.
$this->__state_set = true;
}

return $property === null ? $this->state : $this->state->get($property, $default);
}