@SELECT published FROM modx_site_content WHERE id = 51
Any ideas?
It’s just [*published*] and $modx->getDocumentObject() is not a public API method, but an internal method for use by the parser. getDocument() (as linked on the wiki) is what you want.
How are you using this? There is a placeholder for this in each document, i think it is [*ispublished*] and you can also use the API method $modx->getDocumentObject(’ispublished’,123);
http://wiki.modxcms.com/index.php/API:getDocument
<?php $doc = $modx->getDocuments(array(51), 'published'); return $doc[0]['published']; ?>
Yes, the code it [*published*] but I want only for document 51 and I want to see this status everywhere. My decision may be dumb but so put together and it works.
case "SELECT" : // selects a record from the cms database
$rt = array ();
$replacementVars = array (
'DBASE' => $modx->db->config['dbase'],
'PREFIX' => $modx->db->config['table_prefix']
);
foreach ($replacementVars as $rvKey => $rvValue) {
$modx->setPlaceholder($rvKey, $rvValue);
}
$param = $modx->mergePlaceholderContent($param);
$rs = $modx->db->query("SELECT $param;");
$output = $rs;
break;