Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ORMAUTH - get user by id function
  • There is a way to get user information and user metadata by user id?

    for example getUser(2);
  • HarroHarro
    Accepted Answer
    Simply use the model, like you would any other model:

    $user = \Model\Auth_User::find(2);
  • 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?
  • 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();

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion