We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28189
    • 47 Posts
    I’m not sure what I’m doing wrong, but I can’t seem to get this to work (line 2):

    http://pastebin.com/m275e3adf

    My goal is to reduce the amount of memory my object collection will require.

    Any help is greatly appreciated smiley

    Thanks!
      • 28215
      • 4,149 Posts
      You need to at least select the PK of the object:

      $query = $this->modx->newQuery('modDocument');
      $query->select('modDocument.id,modDocument.pagetitle');
      $query->where(array(
          'modDocument.published' => 1,
          'modDocument.searchable' => 1,
      ));
      $searchables = $this->modx->getCollection('modDocument', $query);
      
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 28189
        • 47 Posts
        Ahh, thank you smiley