Running MODX Revolution 2.1.2-pl
I’ve defined a custom table MyApp_classschd with a classyear column.
xPDO schema says dbtype="year" precision="4" phptype="string"
Relevant example data is:
id classyear
1 2009
2 2009
3 2010
4 2010
5 2010
6 2011
Standard query SELECT DISTINCT campyear FROM myApp_classschd ORDER BY campyear yields the desired result:
classyear
2009
2010
2011
I see DISTINCT referenced in the xPDO->newQuery object:
public ’query’ =>
array
’command’ => string ’SELECT’
’distinct’ => string ’’
’columns’ =>
’from’ =>
’where’ =>
’groupby’ =>
’having’ =>
’orderby’ =>
’offset’ => string ’’
’limit’ => string ’’
’priority’ => string ’’
but I receive Call to undefined method xPDOQuery_mysql::distinct() when I attempt to use it. I cannot find info about DISTINCT in the xPDO->newQuery docs.
Can I use DISTINCT with xPDO->newQuery and if so how do I specify it?
Thanks
I appreciate your help, Thanks