Esempio n. 1
0
func (this *partnerRep) GetPartner(id int) (partner.IPartner, error) {
	v, ok := this._cache[id]
	var err error
	if !ok {
		e := new(partner.ValuePartner)
		if this.Connector.GetOrm().Get(id, e) == nil {
			v, err = partnerImpl.NewPartner(e, this, this._userRep, this._memberRep)
			if v != nil {
				this._cache[id] = v
			}
		} else {
			err = partner.ErrNoSuchPartner
		}
	}
	return v, err
}
Esempio n. 2
0
func (this *partnerRep) CreatePartner(v *partner.ValuePartner) (partner.IPartner, error) {
	return partnerImpl.NewPartner(v, this, this._userRep, this._memberRep)
}