Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth
ORMAUTH - get user by id function
chavewain
January 2015
There is a way to get user information and user metadata by user id?
for example getUser(2);
Harro
January 2015
Accepted Answer
Simply use the model, like you would any other model:
$user = \Model\Auth_User::find(2);
chavewain
January 2015
I will change my quetion let me tray to explain it...
I have model1 with a relation related to model2 and model2 is related with model3 how i get the data from all relations?
Harro
January 2015
You can use array notation and the second parameter of find() to define relations to include (which I personally hate), or use method chaining.
$result = \Model1::query()->related('model2')->related('model2.model3')->get();
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
chavewain
January 2015
Harro
January 2015