We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22656
    • 121 Posts
    Quote from: OpenGeek at Jun 22, 2011, 12:09 PM

    If you want to take advantage of xPDO result set caching (cache_db config option)...

    Tx opengeek, knowledge is power! I was wondering how to make use of db caching options in settings, this example is great!
    I would suggest someone adds these 2 snippets under revo documentation titled "how to do simple mysql queries under revo" or similar. It will definitely help all those people trying modx for the first time, wanting to run simple queries on their pages.

    I started with my revo project more than a month ago, its only today I learned I can use PDO/XPDO using examples above.
    The confusion/ignorance comes from no exposure to PDO and lack of documentation/examples.

    Where ORM will go i have no idea, being a bit of a neophobe i always resist further complexities in anything. rolleyes
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: lossendae at Jun 22, 2011, 02:49 PM

      Is it possible to use toSQL method with xPDOCriteria ?
      Yes. xPDOCriteria defines the method toSQL(). xPDOQuery extends xPDOCriteria and inherits the behavior. Only difference is you must manually prepare() an xPDOQuery before calling toSQL(); xPDOCriteria instances are prepared when constructed.
        • 4971
        • 964 Posts
        Jason, thanks for the explanation of xPDO wrapping PDO...
        helps understand all these!
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner