Yii Relation Index For Multiple Records

I need to access records in a relation by using an index, e.g.: relationName[index]. Yii supports this by using the index attribute but only if relationName[index] returns a single record/instance. In my case, there may be more than one record so it doesn’t work.

Is there any way to achieve this kind of functionality?

Currently I have the relation set like this:

'descendants'   => array(self::HAS_MANY,    'TDPClosure',   'ancestor', 'index' => 'length' ),