[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]naren_nag[/eluser]
EDIT: You caught it while I was writing out the response. Good for you! Take a look at the second part of the response, that should still be relevant. cheers, ------- ORIGINAL POST starts here ... The problem is in how you've defined the relationship. You've forgotten to define the other side of the relationship -- you still got it saying post => ... it should be category => Updating that should get the code to work. Code: <?php Also, in your data structure, every sub category can have multiple parent categories, is that correct?? Code: parent_1 parent_2 So subcat2 has both parent_2 and parent_1 ... that's how your relationship is setup at the moment. If you don't want it to work like this, then you need to make it a one to many relationship, where every category has many sub categories, but every subcategory has one parent category. cheers, naren
[eluser]ciGR[/eluser]
Yes you have right that is the error I write on edit my last post.I changed and all is ok, now I get also the subcategories of an category! But in my first post,I havent that error.(as you can see in my model I was post here http://ellislab.com/forums/viewreply/618114/), maybe something else happens but now with start the example again and with you help all is ok(for the time). about the Quote:Also, in your data structure, every sub category can have multiple parent categories, is that correct?? Is not correct, you have true. I thinking to change to one-to-many, but I tried first to understand and I just simply get the code from the user guide of DMZ without changes. Thank you very much for your time.
[eluser]Daniel H[/eluser]
When I'm autoloading both htmlform and arrayutils like this Code: $config['extensions'] = array('custom_rules', 'simplecache', 'htmlform', 'arrayutils'); there seems to be some sort of conflict when I try to render a form: Code: Severity: Warning When I stop autoloading arrayutils, the form works fine. Any ideas?
[eluser]naren_nag[/eluser]
I need to use MySql's "match - against" combo for full text searches. I don't think this is already part of DMZ. I just thought I'd ping the forum before diving into the library code. Anybody done match against using DMZ? cheers naren
[eluser]tdktank59[/eluser]
@OverZealous And you top top DMZ this is great! Ill give it a whirl and see what breaks with my system lol... At first glance of looking at docs and what not this is pretty sweet! I love the grouping because I can finally get rid of straight sql code for some like statements! And thanks a lot now I'm going home early to go play around with this and figure out all the nifty changes! On another note, Any idea in how DMZ and MS SQL Server get along? I know the limit features will break... But other than that any ideas?
[eluser]OverZealous[/eluser]
[quote author="Daniel H" date="1249324518"]When I'm autoloading both htmlform and arrayutils […] there seems to be some sort of conflict when I try to render a form[/quote] I'm looking into it, I'll let you know if I find a bug. (Sounds like a bug in DMZ.)
[eluser]OverZealous[/eluser]
[quote author="naren_nag" date="1249338458"]I need to use MySql's "match - against" combo for full text searches. I don't think this is already part of DMZ.[/quote] DMZ (and CodeIgniter's ActiveRecord) doesn't have any DB-specific functions like that, but here's a couple of tips: • Use the add_table_name method (<a href="http://www.overzealous.com/dmz/pages/utility.html#add_table_name">documented here</a>) to properly specify the fields. • If you want to be able to support querying related fields, look at the _related and _add_related_table (undocumented) methods. They are probably a lot easier to read if you look in the src/35_relations.php file in the full DMZ download. The second one, specifically, is how I automatically join the necessary table(s), and it returns the pseudo-table name that you want to compare against. Usually the code looks like this: Code: $table_name = $this->_add_related_table($related_object, $related_field_name); • You can manually protect the fields and values by calling $this->db->_protect_identifiers (for table and column names) and $this->db->escape. Good luck. If you get it working, you might want to think about wrapping it up in an extension. Then it can be easily shared! Just replace $this with $object, and accept $object as the first parameter in your custom methods.
[eluser]OverZealous[/eluser]
[quote author="tdktank59" date="1249349940"]On another note, Any idea in how DMZ and MS SQL Server get along? I know the limit features will break... But other than that any ideas?[/quote] Thanks for the feedback! I'm really happy with the direction DMZ is heading. As far as MS SQL, I don't have any clue as to what would happen, and I don't have access to any non-free databases. (In fact, it would take too much time to test more than MySQL and Postgres.) Please test away at it, and let me know if there are any issues. (I'm curious, shouldn't limit still work, since CI's ActiveRecord code generates DB-specific code when necessary?)
[eluser]tdktank59[/eluser]
[quote author="OverZealous.com" date="1249365261"][quote author="tdktank59" date="1249349940"]On another note, Any idea in how DMZ and MS SQL Server get along? I know the limit features will break... But other than that any ideas?[/quote] Thanks for the feedback! I'm really happy with the direction DMZ is heading. As far as MS SQL, I don't have any clue as to what would happen, and I don't have access to any non-free databases. (In fact, it would take too much time to test more than MySQL and Postgres.) Please test away at it, and let me know if there are any issues. (I'm curious, shouldn't limit still work, since CI's ActiveRecord code generates DB-specific code when necessary?)[/quote] MS SQL does not have a "LIMIT" function... So the way around it is screwy... You end up slecting a batch and selecting a batch from that batch lol... Really anoying if you ask me...
[eluser]OverZealous[/eluser]
@tdktank59 If you look within the CI-provided MS SQL code (system/database/drivers/mssql/mssql_driver.php), you will see that they have a work around that lets you still use the built-in AR limit method, but generate the correct query. |
Welcome Guest, Not a member yet? Register Sign In |