public function getReferenceSoft($repository, $attr, $key = 'id')
    {
        if (isset($this->$attr)) {
            return ($repository->findSoft($key, $this->$attr) ?: null);
        }
        return null;
    }