CodeIgniter Forums
DataMapper 1.6.0 - 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: DataMapper 1.6.0 (/showthread.php?tid=11358)



DataMapper 1.6.0 - El Forum - 01-23-2009

[eluser]robertcsmith[/eluser]
hmmm.... also turning autotransactions back on and reordering DataMapper lines 604 - 615 to the following worked too:

Code:
// Begin auto transaction
$this->_auto_trans_begin();

// Create new record
$this->db->insert($this->table, $data);
                    
// Sets the id property
// to the last insert's auto_increment value
$this->id = $this->db->insert_id();

// Complete auto transaction
$this->_auto_trans_complete('save (insert)');



DataMapper 1.6.0 - El Forum - 01-24-2009

[eluser]Daniel H[/eluser]
Has Datamapper ceased to exist....?

http://stensi.com/datamapper/index.html


DataMapper 1.6.0 - El Forum - 01-24-2009

[eluser]tdktank59[/eluser]
Not from what we know...

The creator is really busy at the moment...

you can download it from the wiki and the manual is in the download.
If you have questions ask them here and people will try and help!


DataMapper 1.6.0 - El Forum - 01-24-2009

[eluser]Daniel H[/eluser]
Okay cool - it's fantastic contribution and was worried when I saw that.


DataMapper 1.6.0 - El Forum - 01-24-2009

[eluser]OverZealous[/eluser]
I recently talked to stensi. He's going through a server change, and it might be a little longer before he gets his website up.

DataMapper is still alive and kicking, however, and some additions are in the works, AFAIK.


DataMapper 1.6.0 - El Forum - 01-25-2009

[eluser]Iverson[/eluser]
I've always seemed to have problems with many to many relationships. Say I have "Table1" and "Table2". They have a many to many relationship. After the join table wasn't updated, I deleted the join table to see what error I got.

Quote:Table 'table1_table2' doesn't exist

SELECT * FROM (`table1_table2`) WHERE `table1_id` = 1 AND `table2_id` = '2'

Why in the &$#@ would it be trying to perform a SELECT statement?!?!?!?


DataMapper 1.6.0 - El Forum - 01-25-2009

[eluser]tdktank59[/eluser]
[quote author="Iverson" date="1232919452"]I've always seemed to have problems with many to many relationships. Say I have "Table1" and "Table2". They have a many to many relationship. After the join table wasn't updated, I deleted the join table to see what error I got.

Quote:Table 'table1_table2' doesn't exist

SELECT * FROM (`table1_table2`) WHERE `table1_id` = 1 AND `table2_id` = '2'

Why in the &$#@ would it be trying to perform a SELECT statement?!?!?!?[/quote]

It selects from the table all the time... To do checks to see if things exist etc...

Turn on the profiler And you can see this
add this to the config file:
[code[
$config['enable_profiler'] = TRUE;
[/code]

Otherwise your problem is with the table not being there... (but you caused that one).

Just a few thing to get out of the way.

1. Did you update your mysql driver file (check the troubleshoot page on the manual)
2. What are your config settings


DataMapper 1.6.0 - El Forum - 01-25-2009

[eluser]Iverson[/eluser]
Yeah I have the right driver. This is even more confusing because I'm assuming once it checks if it exists, it will attempt to insert it. I actually copied and pasted the table name into the database to make sure the table existed.


DataMapper 1.6.0 - El Forum - 01-25-2009

[eluser]stensi[/eluser]
I finally got around to putting the User Guide back up! Sorry for any inconvenience.

@Iverson: tdktank59's correct. It always does a select statement before adding or removing a relationship. This is to ensure the integrity of relationships remain correct. For example, if you had a One to Many relationship, it would ensure that if a record already existed for the "One" side, it would update it rather than creating a new one, to keep the One to Many relationship intact etc.

What are the relationship settings you have in your models?


DataMapper 1.6.0 - El Forum - 01-26-2009

[eluser]wolffc[/eluser]
Thanks for the help earlier on my question about ordering. I have another question. Is there a way to print out or log the sql statement datamapper creates?