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.
    • CommentAuthorhpatoio
    • CommentTimeMay 9th 2008
     

    Hello.

    Is there already a function to get from an AkHasMany object an array with this structure

    array ( [0] => ( ['field1'] => ['value1'], ['field2'] => ['value2'], ['field3'] => ['value3], ['field4'] => ['value4']) [1] => ( ['field11'] => ['value11'], ['field22'] => ['value22'], ['field33'] => ['value33], ['field44'] => ['value44']) )

    Thanks

    -- Simone

    • CommentAuthorhpatoio
    • CommentTimeMay 9th 2008
     

    Well, I couldn't way so here the function

    function toHash($object) { foreach ($object->_columns as $columnName => $columnDetails) { $row[$columnName] = $object->$columnName; } return $row; }

    Just call it this way :

    $myMatrix = array_map("toHash",$this->MyMaster->myChildren);

    Now I'm just wondering if something like this already exists in Akelos. Anybody ?

    -- Simone

    • CommentAuthorKaste
    • CommentTime4 days ago
     

    ActiveRecord has ->select() and ->collect() which are a bit different.

    but

     ->select($myChildren,list_of_columns_to_select...);
    

    would be equivalent to what you did.

Add your comments
    Username Password
  • Format comments as