0

During working I faced a very weird thing in phpfox script

I put in the table user a new field .. and this field is tinyint with default value 0 and started to work on giving the user the ability to insert the value through links and finally it's succeeded but when I tried to get this value by getUserBy('name_of_the_field') it gave me a null value although I checked it in the database table and found that field has a value ... so could you help me please ?!

Ariel Magbanua
  • 3,083
  • 7
  • 37
  • 48

1 Answers1

0

The getUserBy() does not get every field in the user table, there is a predefined list of columns that it will fetch. You will need to get this field in a different way or write a plug-in to the hook "user.service_auth___construct_query" so it loads your new field, I have not tried this but I believe it should work as a plug-in to that hook:

$this->database()->select('u.my_new_field,');
Purefan
  • 1,498
  • 24
  • 44