I learned from forum,manual and source code about remove() and removeObject() methods, but have to confirm :
To use remove() method first I should instate the object. Second is this method will delete all the dependent object by composite relation.
removeObject() method doesn't instating objects. And as i see, this method doesn't look at any relations, just delete one or several rows from a table, regarding criteria.
So, no matter objects are instating or not, if i need cascade deletion i have to use remove() method, if i need to delete only one row from a table without any cascading changes - i should use removeObject() method.
Am i right?
never give up!
You are right
removeObject() does not load the object nor relations.
#Added,
Exception of course if you have set ON DELETE CASCADE to table, but lets assume you have not
[ed. note: lazylegs last edited this post 14 years, 7 months ago.]
Almost retired from web-development industry but still randomly writing at Lazylegs.info and on schedule hopefully in near future to finish Oracle and PostgreSQL ports of MODX
But "ON DELETE CASCADE" require InnoDB. Manual not suggesting to use InnoDB. This can make db manipulation more complicated as require to remember about relations that handled by DB.
Is there any methods in Revo 2.2 for doing "ON DELETE SET NULL"?! Or yet should do this manually?
never give up!
There are other databases that xPDO support also
There ain't method that I know off, have to check the createObjectContainer method to see if they actually remove possible cascading for databases in there. This is something opengeek should know, I am just a peon here
Almost retired from web-development industry but still randomly writing at Lazylegs.info and on schedule hopefully in near future to finish Oracle and PostgreSQL ports of MODX
Almost retired from web-development industry but still randomly writing at Lazylegs.info and on schedule hopefully in near future to finish Oracle and PostgreSQL ports of MODX