public function getAssociation($name, $autoLoad = true)
    {
        if (isset($this->loadedAssociations[$name])) {
            return $this->loadedAssociations[$name];
        } elseif ($autoLoad && $this->getAssociations()->exists($name)) {
            $this->loadedAssociations[$name] =
                $this->getAssociations()->load($this, $name);
            return $this->loadedAssociations[$name];
        }
        return null;
    }