It's possible extend AR relationships?

440 views Asked by At

I'd like know if there are a way to create my own rules to AR relationships or extends the existent HAS_MANY, BELONGS_TO etc?

Thanks.

1

There are 1 answers

2
Mathieu Lordon On

Each AR relationships is created with the corresponding class.

    const BELONGS_TO='CBelongsToRelation';
    const HAS_ONE='CHasOneRelation';
    const HAS_MANY='CHasManyRelation';
    const MANY_MANY='CManyManyRelation';
    const STAT='CStatRelation';

These classes extend CActiveRelation » CBaseActiveRelation » CComponent.

You may be able to create your own AR relationship with a custom class extending CActiveRelation.