We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37975
    • 12 Posts
    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!
      • 34012
      • 88 Posts
      You are right smiley

      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 smiley [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
        • 37975
        • 12 Posts
        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!
          • 34012
          • 88 Posts
          There are other databases that xPDO support also wink

          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 smiley
            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
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: lazylegs at Mar 20, 2012, 07:05 AM
            There are other databases that xPDO support also wink

            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 smiley
            Currently, xPDO does not support foreign key constraints in MySQL InnoDB engines, but I would love to get support for it into the code. Can someone open a ticket in xPDO for it (or if one already exists, reply to it)?
              • 34012
              • 88 Posts
                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