php - CakePHP : Saving Multiple Checkbox Associated Data -


I am searching through other tutorials and guides, but whatever I am doing is not found anywhere.

I have a form that has multiple selection fields which gives an array. This array (space-object) I'm looking for to insert in the related fields and other models that reference the place. This is where I go into problems. I get the array given below by my form but in all instances I have to add field and location_id with each data entry because I do not know how many

  Array ( [Name] = & gt; [type] => [specialties] => array   

(

  [location] => phone] = [Address_num] = & gt; [address_street] => [address_suffix] => [address_state] => [address_suburb] => [address_postcode] => [NUM_DOCS] = & gt; Gt; [additional_services] => [Money] => [created_by] => 1 [assigned_to] => 1) [hour] => array ([mon_active] => 0 [Mon_open] = & gt; 10:00 [m On_close] => 10:00 [tues_active] => [[tues_open] => 10:00 [tues_close] => 10:00 [wed_active] => 0 [wed_open] = & 10:00 [wed_close] => 10:00 [thurs_active] => [[thurs_open] => 10:00 [thurs_close] => 10:00 [fri_active] = & gt; 0 [fri_open] = & gt; 10:00 [fri_close] = & gt; 10:00 [sat_active] => 0 [sat_open] = & gt; 10:00 [Satyclo] = & gt; 10:00 [Sun_A Tive] => 0 [sun_oopen] = & gt; 10:00 [Sun_clo] = & gt; 10:00) [locationboot] = & gt; Array ([1] = & gt; array ([field] = & gt; patient_type [created_by] => 1 [assigned_to] => 1 [data] => array ([0] = & gt; ; [1] = Family [2] = & gt; Child [3] = & old> age)))   

)

Is this There is no way to save the data in the format provided, if not, how would I have to go about accepting my array as an acceptable format, I thought about manually making it manually in my controller, but I followed the best practices.

Note: I am calling this saved request from Location Model

Here is my relation for reference

Location

  class space AppModel {$ public = $ wide = many = array ('contact', 'response', 'location attribute'); Public $ isan = array ('hour'); Public $ belongsTo = array ('user' = & gt; array ('className' = & gt; 'user', 'foreigner' = & gt; 'assigned_to', 'dependent' = & gt; wrong));        <'= & gt; Location ',' foreigner '= & gt;' Location_id ',' dependent '= & gt; wrong));    

In the model of your location, you use the Location Attribute There are too many announcements in your $, but in the model, and in the data, you have transfer you are sure that this is not the cause of your problems ?

I would be curious to see how the schema of the transfers models looks like. Are you trying to save a line in it for every 4 data array elements, or do they correspond to a field in the table?

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -