Arena_name is displayed with no issues but i get below error for Fname
Property "Arena.Fname" is not defined.
Since the Fname comes from another table named Deputy and i am rendering the view using only Arena::model(), view cannot recognize Fname and i understand that.
My question is there something i need to do while rendering that will help my view to display the data related to Deputy table?
You should be able to use ‘with’ option in your findAll() query to pull in each deputy that matches an arena. The deputy information will be available as $arena->deputy->lname and so on.
Edit: nothing wrong with using CDbCriteria either but you aren’t really using the power of AR.
While learning Yii, i did went through AR relations but i read in the book that AR is memory efficient but performs bad compared with CDbcriteria in terms of query execution. Also i found it more comfortable using CDbcriteria coming from SQL background and virtually zero experience in OOP.
Can you suggest any link or exactly how to do using CDbcriteria?
I would recommend to learn and love AR, then rewrite only those AR queries that are a performance bottleneck.
Development time-wise, AR is so much faster and comes with so many benefits - events, validation, etc. If you write SQL you need to handle a lot of stuff yourself that AR would do for you automatically.