Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • Revolution
  • xPDO
  •  
  • Filtering results with getCollectionGraph#

  • 813
    271

    aladage Reply #1, 4 months, 1 week ago

    Reply
    • Link to this post#1
    I'm having trouble understanding how to sort and filter getCollectionGraph based on anything other than the primary key. I have another column called "created_userid", and all I want is the equivalent of a where statement that lets me show only entries that match a passed-in userid. Can anyone clarify? I'd be glad to provide my example code.

    Btw, I saw this thread...

    http://forums.modx.com/thread/31768/but-i-don-t-want-to-order-by-primary-key#dis-post-171755

    ...but it makes no sense to me and (I think) is way more complicated than what I'm trying to do:


  • 813
    271

    aladage Reply #2, 4 months, 1 week ago

    Reply
    • Link to this post#2
    Never mind -- got it! It never fails: I post on the forums, and figure it out five seconds later.

    For anyone wondering:

    $user_id = $_GET['user_id'];
      $crit = $modx->newQuery('Table1');
      $crit->where(array ('Table1.created_userid:=' => $user_id));  
      $articles = $modx->getCollectionGraph('Table1', '{ "Table2":{},"Table3":{} }', $crit);





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
aladage

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy