alias
and name
are both properties in cake models. They seem to be similar, but since both of them exist, there must be a difference. What is it?
I'm guessing, but an alias could be the assigned value when you have a relationship between a model and another and you give the associated model a name not equal to that of the class.
For example:
$hasMany = array('UserNew' => array('className' => 'User'));
In that case, you're using the model that's actually called User, but you're referencing it as 'UserNew'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With