Hi,
Sorry if the title is confusing, but looking at the documentation I got wondering. How are they different?
PHP Code:
class UserModel extends UserAuthModel
{
/**
* Called during initialization. Appends
* our custom field to the module's model.
*/
protected function initialize()
{
$this->allowedFields[] = 'middlename';
}
}
PHP Code:
class UserModel extends UserAuthModel
{
protected $allowedFields = 'middlename';
}
PHP Code:
class UserModel extends UserAuthModel
{
public function __construct()
{
$this->allowedFields[] = 'middlename';
}
}
Don't they all execute the code first thing when the class is initiated?
Thanks