![]() |
[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) (/showthread.php?tid=18196) |
[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-05-2009 [eluser]OverZealous[/eluser] [quote author="someoneinomaha" date="1252202053"]I'm really enjoying working with DMZ so far... thanks for the great library.[/quote] Thanks for your support! Quote:Is there any protection against SQL injection? Everything that DMZ does to the database runs through Active Record. This means that all values are escaped (preventing SQL injection). Column names are not escaped, however, but you should never accept any sort of SQL from the client anyway. FYI: $this->input->post() does not provide any sort of SQL injection protection. It merely is a shortcut to handling whether a field was returned, or if not, it returns FALSE. (See here.) Using the input->post method with the optional second parameter set to TRUE will perform XSS cleaning, but that also provides no SQL injection protection. XSS is a different (and more subtle) form of attack. DMZ handles XSS cleaning through validation rules, namely 'xss_clean'. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-05-2009 [eluser]12vunion[/eluser] [quote author="OverZealous" date="1252141208"] Update: I implemented the option, which will be released soon. I decided to go with the default behavior being indexed arrays, and the option being the old style array. The ID-indexed arrays can cause problems (in my experience), so I think it is better to be manually enabled.[/quote] I knew {all} is an array, but didn't know it was indexed by id. Does seem a little weird to do it that way since chances are that you don't know the ids of the objects you just grabbed and you might not always want to iterate through them; or loop in some other way. The config option sounds like a good compromise. Very excited about this. PS -- Thanks for the hard work. I love getting to use an ORM in CodeIgniter. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-06-2009 [eluser]emorling[/eluser] Sorry, for being a total idiot. I can't login or reset the Squash Example. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-06-2009 [eluser]OverZealous[/eluser] [quote author="emorling" date="1252296105"]Sorry, for being a total idiot. I can't login or reset the Squash Example.[/quote] Simplest solution is to just recreate the database! ;-) Or, go to your DB management tool, and run this: Code: DROP TABLE bugs_categories CASCADE; Or something similar. When presented with an empty database, the sample app recreates itself. The real value in the sample app is example code, however, not that it works great or anything ![]() [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-08-2009 [eluser]Oblique[/eluser] Plural name of advanced relation Looks like DM has no way to make join table be named properly (children_parents) in cases like this one: Code: class Referenceitem extends DataMapper { [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-08-2009 [eluser]PoetaWD[/eluser] Hello Guys ! I think I found a BUG ! I just started working with the deep relationships ! AWESOME work I have to say phil ! It works like a glove ! Thanks ! But it seens to be a problem when including all the fields from a related object like: Code: $obj = new Company(); So.. it would be easier just to do this: $obj->include_related('presponsavel/enderecoprincipal','*'); --> That should include all the fields... but it doesnt... It give me this error: Code: A Database Error Occurred I think this is a BUG... because it works perfectly in the non-deep relationships. I hope I helped ! [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-08-2009 [eluser]Mirage[/eluser] Does the html form generator support rendering checkboxes inline (in one row)? The multifield syntax doesn't seem to work for me: Code: $render_form = array ( coloroptions is a non-db field. Instead of rendering it's values in a single row it oddly takes it out of the order and renders them as one per row at the top of the form. What are my choices here if this is not a bug? - a custom field template for this field? - a custom row template for the row? - adding all the checkboxes as their own field rather than using the 'list' functionality? Thanks, -m [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-08-2009 [eluser]BrianDHall[/eluser] I have a question - is there any method, magic or otherwise, that would allow setting a datamapper object property to a value with a function? For instance, I have: Code: $details = new Imagedetail(); I would prefer to have: Code: $details = new Imagedetail(); Basically I would like to use method chaining magically, but I don't want to have to go to the work of creating a set_ function for every property in every model I have. Is there something I could do to create this, or perhaps an addition of a magic function that could be made hidden inside DMZ? I'm not very familiar with the magic functions of PHP5 anymore, but you seem to be a master at it ![]() [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-08-2009 [eluser]OverZealous[/eluser] [quote author="Oblique" date="1252420034"]Looks like DM has no way to make join table be named properly (children_parents) ...[/quote] This isn't because you are using advanced relationship (advanced relationships are usually stored on the normal join table), but instead because this is a self-relationship. Self relationship tables are named after the pluralized form of the relationship name. In this case, I believe the name becomes childs_parents. It's not pretty, but it's what you get with automated naming. ![]() See Naming Self-Relationship Tables. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-08-2009 [eluser]OverZealous[/eluser] [quote author="PoetaWD" date="1252440349"]I think this is a BUG... because it works perfectly in the non-deep relationships.[/quote] Yup, it's a bug. Thanks for finding it. I was looking up the field names too early. Sorry about that, I'll get it fixed for the next release. I also added a check in to make sure it didn't throw a DB error. Now it logs a debug-level message. (I figure it might make sense to have the ability to dynamically pick which columns to include, optionally including none.) |