FOF30\Model\Model::internal_getState PHP Method

internal_getState() private method

Method to get model state variables
private internal_getState ( string $property = null, mixed $default = null ) : object
$property string Optional parameter name
$default mixed Optional default value
return object The property where specified, the state object where omitted
    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;
            }
        }
    }