Is there a simple and safe way to get data from inside an EE add-ons file without having to create a new PHP SQL query to the database?
Get the member ID from the email address.
I could just do this in PHP, create an SQL query, and pass the email address to the table that matches the ID number for that member table.
Just curious if there is a native API, or model to do this that would be more elegant.
Many thanks Yuri! 😊
I was actually trying this already (using models), but the documentation does not really have examples for beginners, so I was stuck with this so far while playing around:
$userID = ee('Model')->get('Member')->first(); echo $userid;
Your code is precisely the examples that would be really useful for new comes to EE. I actually searched all search engines. Even StackOverflow and got no results with just searching ee(‘Model’) for some examples on how this is used in EE.