protected function belongsTo($associatedClass, $foreignKey = null, $mappingId = null)
    {
        $associatedTable = $this->getTableNameFromClass($associatedClass);
        $foreignKey = $this->buildForeignKeyName($foreignKey, $associatedTable);
        $associatedTableId = $this->$foreignKey;

        if (is_null($mappingId)) {
            return (new $associatedClass())->where($this->primaryKey, '=', $associatedTableId);
        }

        return (new $associatedClass())->where($mappingId, '=', $associatedTableId);
    }