Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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.0k

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?



33.7k
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!