add getLinkOrError method to AbstractModel