[Deprecated] DMZ 1.6.2 (DataMapper OverZealous Edition) |
[eluser]cube1893[/eluser]
[quote author="OverZealous" date="1260584509"][quote author="cube1893" date="1260577009"]It's a pity, because I would be nice if DMZ would convert empty input fields to NULL, if this ist set in the table settings.[/quote] There's no way for DMZ to know what the default value is on a column. So, it sets the column to whatever you ask it to. (And '' is not the same as NULL, since NULL is a special data construct.) [/quote] Alrighty, I realised my error in reasoning, thanks!
[eluser]Mirage[/eluser]
[quote author="OverZealous" date="1260584509"][quote author="cube1893" date="1260577009"]By definition, a join table is not a model or an object. It's just the link between two objects. That's why you can't create an object out of it. I don't see any way to implement the MPTT structure via the internal relationship code. I'm not even 100% sure what the benefit would be.[/quote] Ok, so I do get that. But that doesn't mean I couldn't make a model anyway representing the join-table if only to be able to apply MPTT, right? Another alternative to that would to add some methods in one of the related models to handle this, or even straight SQL in the controller. What would your approach be? Make a Model and ride with it the DMZ way, or use a less structured approach? TIA, m
[eluser]OverZealous[/eluser]
I'm not 100% sure what you are asking, Mirage, but I have a recommendation in the docs for a different problem that sounds like what you are asking about. Maybe that will give you some help!
[eluser]tdktank59[/eluser]
Hey Phill got a question. So ive got 3 tables users user_info user_settings However I want to only have 1 page for all the settings that can change. is there a way to be able to save all (the second 2 tables are a one to one relation with users.) Otherwise ill end up having a few screens to set all the details, but would be nice to do it with the array and form extensions if possible. I have no problem setting in the main model all the values for the form, just saving them is the issue.
[eluser]OverZealous[/eluser]
The HTMLForm extension isn't designed to handle multiple objects. It's a simple scaffolding-like extension. If you want to manipulate multiple objects, you'll have to manually build the form, or extend or customize the HTMLForm class. You can save the data using the Array extension, but only if there are no name collisions. I don't see what the problem is here — just specify the fields and save the objects. If you want something more complex, then you'll just have to manually create it or manually save it. The extensions in DMZ are closer to examples than be-all-end-all solutions.
[eluser]tdktank59[/eluser]
fair enough was just currious if you have an idea
[eluser]Mirage[/eluser]
I probably wouldn't use the form extension for this. In general I'm not a big fan of form generators. So I'd build the form manually and use php array notation to avoid conflicts and then use the array extension to import the resulting sub-arrays in $_POST to the proper objects, followed by $user->save($info,$settings). hth, -m
[eluser]tdktank59[/eluser]
[quote author="Mirage" date="1260614292"]I probably wouldn't use the form extension for this. In general I'm not a big fan of form generators. So I'd build the form manually and use php array notation to avoid conflicts and then use the array extension to import the resulting sub-arrays in $_POST to the proper objects, followed by $user->save($info,$settings). hth, -m[/quote] Thats what Ill probably end up doing. I also dont mind the form generator since all of my forms are basically the same with small variations and I don't need anything fancy on them. However the other option is I extend the form extension and add the functionality I need (multidimensional array support or something)
[eluser]teddy3[/eluser]
hi, i set Multiple Relationships to the Same Model like on http://www.overzealous.com/dmz/pages/adv...tions.html How can I get a list of users and get related post of each user which related as creator?
[eluser]chadbob[/eluser]
Can someone help me figure out how to sort results by a related count? I have a crime, and report. They have a many-to-many relationship. I can get all the statutes and the number of reports tied to each statute by: Code: $this->load->model('statute'); How would I sort the results of statutes by number of reports related? Let's say I just wanted the top 5 statutes by # of reports? |
Welcome Guest, Not a member yet? Register Sign In |