Hi,
how can I access to the user id within a command class?
Suppose I need to make a query to my database in the _HelpCommand.php_ class using the user id. How can I achieve this? I've already tried using _$GLOBALS [user_id]_ (which I set in index.php) but it's not working:
PHP Notice: Undefined index: user_id
That's very strange. What am I missing?
Hi,
Just use $this->getUpdate(); to retrieve the original update object and you can then fetch the user id or any other data.
Most helpful comment
Hi,
Just use
$this->getUpdate();to retrieve the original update object and you can then fetch the user id or any other data.