We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10355
    • 44 Posts
    I want to delete the document now in such a way
    <?php
    $id=45;
    $doc = $modx->getObject('modResource', $id);
    $doc->set('deleted',true);
    ?>
    but 45 does not document goes into a "deleted"

    This method works fine
    <?php
    $id=45;
    $doc = $modx->getObject('modResource', $id);
    $doc->remove();
    ?>

    but need a way to $ doc-> set (’deleted’, true);
    What am I wrong?

    I use Revolution 2.0.4-pl2
      • 28215
      • 4,149 Posts
      <?php
      $doc = $modx->getObject('modResource',45);
      $doc->set('deleted',true);
      $doc->save();
      ?>
      
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 10355
        • 44 Posts
        Thank you very much