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

    Hi. I've got form with few params. I would like run query(insert) for each of this params(its an array in fact). I have no idea how to implement this, I think it'll be somethin like this: function beforeCreate(){ foreach($this->get('action') as $action){ //insert some data } //and dont insert "main" query } I'm affraid, You'll don't understand me, so I'll write it once again: when I'm adding my data(it's "normal" scaffold") - I would like to run one query for each checkbox checked in form -and only for them(so I would like to avoid to run default query, which will be run with save() function )

    • CommentAuthorThijs
     

    run one query for each checkbox checked in form

    so a new record for each checkbox.

    Are those checkbox records associated (belongs_to) another model?

    • CommentAuthorkkrzyzak
     

    so a new record for each checkbox.

    well, in fact- yes :)

    Are those checkbox records associated (belongs_to) another model?

    No, actually, it looks like this: -some data I'm adding via normal inputs. -few checkboxes are generated form explode(',',$data_from_xml_file)

    • And, as You wrote, I want to run new record only for each checkbox (no other queries). Question is how?
    •  
      CommentAuthorriffed
     

    Create a memo field and store the checked options as a serialized array

    • CommentAuthorkkrzyzak
     

    well... it's very good idea, thanks ;)