Last active
April 26, 2018 10:06
-
-
Save davidpede/9cf88dfd20664669ddf40828eec0662f to your computer and use it in GitHub Desktop.
XPDO Select Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = $this->modx->newQuery('modUser'); | |
$query->innerJoin('modUserProfile','Profile'); | |
//Select ALL fields from both tables | |
$query->select(array('modUser.*, Profile.*')); | |
--- | |
$query->select(array('modUser.*')); | |
$query->select($this->modx->getSelectColumns('modUserProfile','Profile','profile_')); | |
//Select SPECIFIC fields from both tables | |
$query->select('modUser.id,Profile.email,Profile.fullname'); | |
--- | |
$query->select('modUser.id,Profile.email AS profile_email,Profile.fullname'); | |
--- | |
$query->select(array('modUser.*')); | |
$query->select($xpdo->getSelectColumns('className','alias','prefix_',array('email','fullname'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment