Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8565187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:22:06+00:00 2026-06-11T17:22:06+00:00

I am writing an installer, and as such I need to save multiple types

  • 0

I am writing an installer, and as such I need to save multiple types of data in different tables, even when not associated. Ideally I woud like to take care of this all at once. Here is a brief of what I have so far.

Here is my cake array in preparation for saving said data.

$initialData = array(
    array( 'Option' => array( 'name' => 'version', 'value' => '1.0.0', )),
    array( 'Option' => array( 'name' => 'non-version', 'value' => '1.0.2', )),
    array( 'User' => array( 'username' => 'skyler', 'password' => 'hi', )),
);

And I use the following to try and save it.

$this->Option->saveMany($initialData)

Which only saves the Option rows, not the User rows. Thoughts?

NOTE: This is NOT associated data. Options and Users are not associated, but need to be saved at the same time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:22:07+00:00Added an answer on June 11, 2026 at 5:22 pm

    The $this->Option->saveMany will work because you are saving multiple records for a single table. However, because the User is not associated to the Option, it does not know what to do with the data. You will need to call $this->User->save($initialData).

    If you expect to have multiple user records, you can call $this->User->saveMany($initialData).

    Be sure not to forget to call $this->User->create().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an installer( msi file) which needs to be run on a
I have been tasked with writing an installer with a silverlight out of browser
I'm writing an NSIS installer and the setup program elevates as administrator as needed
I'm writing a complex setup/installer application in native C++/MFC. I would very much like
I have a fairly complicated installer that I'm writing in Wix that has a
I am writing an install script that installs all tables, stored procedures, views, full
I'm writing a new major upgrade of our product. In my installer I start
I'm writing codes to capture Serial Port data (e.g. micrometer) and do the following
I'm writing a script to automate work environment preparation. I need to open 4
I'm writing an MSI installer using Visual Studio 2010 and I was wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.