private function internal_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;
}
if (is_null($property)) {
return $this->state;
} else {
if (property_exists($this->state, $property)) {
return $this->state->{$property};
} else {
return $default;
}
}
}