yeah that’s a common pitfall
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 13, 2008 3:25pm
Subscribe [27]#76 / Feb 21, 2008 12:06pm
yeah that’s a common pitfall
#77 / Feb 27, 2008 3:01pm
Would it be possible for you to post a schematic diagram (or file list) of how/where Codex files should live in association with the CI root directory? I get a 404 error when I try to run backend.php I have an atypical install where I am running CI in a subdirectory (because I am also running EE [with many of the same filenames]) 😊
#78 / Feb 27, 2008 3:04pm
well, the codex folder is simply a CI application. So, I’m assuming you can access index.php. Put the codex/ directory alongside your index.php file. And you should be good. You might want to play with backend.php and adjust the $application_folder variable.
#79 / Feb 27, 2008 3:46pm
Eureka. OK, many thanks!
#80 / Feb 27, 2008 4:29pm
I’ve been able to understand the way the one-to-many plugin works… has anyone used the many-to-many plugin yet? Or is there any examples of it I missed? I think the many-to-many item is the primary reason I’d like to use CodeExtinguisher, or any other CRUD generation system, but I’ve yet to figure out what all of the code is doing for that plugin.
#81 / Feb 27, 2008 4:38pm
Well, ManyToMany is extremely similar to OneToMany, which a couple of exceptions:
1) the ManyToMany plugin uses a different table structure. Let’s say you have two tables: recipes, and ingredients. They have a many-many relationship between them. So your database should contain the following tables: recipes, recipes_ingredients, and ingredients. the recipes_ingredients table links the records between the two tables together. The recipes_ingredients table would have the following fields: id, recipes_id, ingredients_id
2) In the OneToMany plugin, if a record can belong _only_ to one field. So let’s say you have two tables: players, and teams. A player can obviously only belong to one team. If you create a new team and specify which players belong to it, then those players get “unlinked” from all the other records they were previously associated with. With ManyToMany, you don’t have that constraint.
Please let me know if i’m not being clear.
#82 / Feb 27, 2008 5:24pm
Now that you mention it, I seemed to notice a specific table structure was required to work with those when I was fooling around with it a few days ago. Cool. I’ll have to try it out.
#83 / Feb 27, 2008 8:30pm
One to Many…
Trying to get my head around this, ‘cause the documentation is a bit sketchy… How do you invoke the onetomany / manytomany plugins and tell them which tables to pull from? Are the table names then expressed in the ‘db_table’ option? Sorry, it’s just a bit sketchy in the docs.
#84 / Feb 27, 2008 8:38pm
no no I apologize, the docs aren’t updated yet. I haven’t gotten to that yet. But to answer your question. with both the OneToMany and ManyToMany plugins, the name you give it is the name of the foreign table, and it takes care of the rest for you.
#85 / Feb 27, 2008 10:21pm
Boy, I understand about documentation. But… this is how you load the usual plugin:
$this->load->plugin(‘name’);
You’re saying that the name is the table name, but how does the system know to load the correct plugin? And, my understanding is you can tie up to three tables? Is that constructed as an array? Many thanks for your kind attention.
#86 / Feb 27, 2008 10:24pm
Well I the name ‘plugin’ may be a bit misleading, but they’re not the same as CI plugins. When you define your own form in your controllers, then the class that you define is the name of your plugin. Take a look at definitions/example_form.yml to see how to implement a OneToMany relationship between example and related_example.
#87 / Feb 28, 2008 5:46am
When I try update my Current Data I got this error Message
+++
Fatal error: Call to undefined method CI_DB_mysql_driver::get_where() in /Users/jauhari/Sites/Personal/First/codex/application/controllers/codexcontroller.php on line 157
+++
Why?
#88 / Feb 28, 2008 6:22am
first of all thanks, this looks great.
i have everything set up and most things seem to be working but when i try to edit a record the form will not load. i get the error “PHP Fatal error: Call to undefined method CI_DB_mysql_driver::get_where()” in my log file. this happens in the example as well as my own.
i’m using the latest version of CodeIgniter and CodeExtinguisher
thanks
**UPDATE**
hmm… even though i’m using 1.6.1 changing get_where to getwhere seems to have fixed the issue. strange.
I make this corrections too and now it’s work.
Can anybody give me the information? why work?
#89 / Feb 28, 2008 1:15pm
From the User Guide:
Note: get_where() was formerly known as getwhere(), which has been deprecated
This issue comes up if you use CodeExtinguisher with CI 1.5.4
#90 / Feb 28, 2008 1:30pm
Sorry for the double post,
I have setup a public preview (login with preview:preview) for those of you who don’t want to download and setup CodeExtinguisher. This is kind of a sandbox really, so bang up on it, and let me know what you think.