We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Should we setting the ColumnMap and column attribute setting for EVERY models ?

Hi All, For ColumnMap function , I just find IDE will auto list the column name. I need't use alias column name in my project. Is there any other benefits for ColumnMap function , or It's better not use it if we needn't ?( some performance issue or others) Thanks.!



2.7k

Did you read the docs regarding column mapping? Independent Column Mapping

I recommend you not to set the columnMap unless you really need it.

I recommend you not to set the columnMap unless you really need it. the Model doucument said " If you’re using PHP 5.4/5.5 it is recommended you declare each column that makes part of the model in order to save memory and reduce the memory allocation."

Is it means that if we use columnMap will impove performans?



34.6k
Accepted
answer

One thing is declare every property and other is use a column map

One thing is declare every property and other is use a column map Thanks!