protected function _getModels($attributeName, $relatedObjName = false, $query = false, $loadMap = false)
    {
      $def = $this->model_attributes[$attributeName];
      $result = [];

      if ($relatedObjName) {
        // If the relationship is one-to-many.
        if (isset($def['via'])) {
          $result = $this->_getModelsFromTableColumn($attributeName, $relatedObjName, $def['via'], $query, $loadMap);
        }

        else if (isset($def['using'])) {
          $result = $this->getModelsFromCustomRelationship($attributeName, $relatedObjName, $query, $loadMap);
        }

        // If the relationship is many-to-many.
        // OR if the relationship is one-to-many and no 'owner' type column is set,
        // meaning there needs to be a relation table.
        else {
          $result = $this->_getModelsFromRelationTable($attributeName, $relatedObjName, $query, $loadMap);
        }
      }

      // If there is no data to return, return an empty collection
      if ($result == null) {
        $this->$attributeName = new \Cora\Collection();
        $result = $this->model_data[$attributeName];
      } 
      return $result;
    }