Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthoralake
     

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

    • CommentAuthordanfreak
     
    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
     

    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
     

    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
     

    Maybe you're looking for

    $User->getAttributes();
    

    or

    $User->getContentColumns();