Get Metada From Ar Model

Hi, i need some help for getting all metadata from an AR Model:

so,

  • Name and Label attributes (columns): I know how i can get it.

foreach($model->getMetaData()->columns as $columns){

 //code

        echo $columns->name; // Nombre campo

        echo $model->getAttributeLabel($columns->name); // Label

}

  • Datatype of columns ?????

  • The same for Relations:

Get all Relations, Model/table related, columns of join ??????

Thanks in advance

Check these methods:

http://www.yiiframework.com/doc/api/1.1/CActiveRecord#getTableSchema-detail

http://www.yiiframework.com/doc/api/1.1/CActiveRecord#getActiveRelation-detail