protected function _getAttributeDataWhenSet($attributeName, $query = false, $loadMap = false, $record = false) 
    {
      // Check if the stored data is numeric.
      // If it's not, then we don't need to worry about it being a
      // class reference that we need to fetch.
      if (is_numeric($this->model_data[$attributeName])) {

        // If the attribute is defined as a model relationship, then the number is 
        // a placeholder or ID and needs to be converted into a model.
        if ($this->_isRelation($attributeName) && !isset($this->model_dynamicOff)) {
          $this->$attributeName = $this->_getRelation($attributeName, $query, $loadMap, $record);
        }
      }

      $this->beforeGet($attributeName); // Lifecycle callback
      $returnValue = $this->model_data[$attributeName];
      $this->afterGet($attributeName, $returnValue); // Lifecycle callback
      return $returnValue;
    }