Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthoralake
    • CommentTimeFeb 8th 2008
     

    $user = $User->findBy('user_code', $uc);\ Where, please, is there an explanation of how to access the contents of $user?

    • CommentAuthordanfreak
    • CommentTimeFeb 8th 2008 edited
     
    I'm new to akelos, but i guess the model returns an array.
    try to print_r($user) to see what you get back as query result.

    dan
    • CommentAuthoralake
    • CommentTimeFeb 9th 2008
     

    I have no problem with using var_dump to see what I get. What I don't know how to do is to access a given element of it, such as the contents of a column.

    From the var_dump that I got, it appears that what is returned is a single dimensioned array that contains an object., which is the rest of the data.

    I figured that it would be more beneficial to more people if, rather than to ask for just what I need for this occasion, that I ask how to get all the elements that are returned. Better yet, it has to be documented somewhere, so a pointer to the documentation would be the greatest help.

    • CommentAuthorThijs
    • CommentTimeFeb 9th 2008 edited
     

    Normally you would get the available column names with

    $user->getContentColumns();
    

    -> see a scaffolded listing view. It's used there to construct the header of the table

    And the value of any individual column you can get by the name, like:

    echo $user->name;
    

    But it might be that your result contains more than one row (which you will have to loop through I guess).

    If you want to find just one user you should use:

    $user = $User->findFirstBy('user_code', $uc);
    
    • CommentAuthorsalavert
    • CommentTimeFeb 11th 2008
     

    Maybe you're looking for

    $User->getAttributes();
    

    or

    $User->getContentColumns();
    
Add your comments
    Username Password
  • Format comments as