Is it possible to extend AR relationships?

I would like to know if there is a way to create my own rules for AR relationships or extend existing HAS_MANY, BELONGS_TO etc.

Thanks.

+4
source share
1 answer

Each AR relationship is created with a corresponding class.

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

These classes extend the CActiveRelation "CBaseActiveRelation" CComponent.

You might be able to create your own AR relationships with a custom class extending CActiveRelation.

0
source

Source: https://habr.com/ru/post/1341655/


All Articles