Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Sentry and ORM user not found
  • Hello folks. First sorry if its a stupid question, maybe im missing something, but i ran in to my first fuelphp problem.
    So i use Sentry, and i sat down yesterday for a bit more deep experimenting. So i have ORM for my blog posts, and i store the users id in the table, i though just to experiment, that i wont create a relation for the user by ORM i will use sentry by passing the user id to it via the user id stored in the post table so
    <?php foreach($posts as $post): ?>
     echo $post->user_id;
    <?php endforeach; ?>
    
    returns me the user id in this case its equal to one. So when i experimented i tried like this
    Sentry::user($post->user_id)->get('metadata.fullname');
    

    I get the user not found error what is really strange because its returning the correct user id and the user does exists. and if i make it this way
    Sentry::user(1)->get('metadata.fullname');
    

    it returns the user perfectly, so its really strange. Again sorry if its a silly question, but did anyone else ran in to this problem? Than you for the replies
  • How about this? Sentry::user((int) $post->user_id)->get('metadata.fullname');
  • dont know why didnt i thought about this, thank you

Howdy, Stranger!

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

In this Discussion