本文整理匯總了PHP中Publication::getColumnNames方法的典型用法代碼示例。如果您正苦於以下問題:PHP Publication::getColumnNames方法的具體用法?PHP Publication::getColumnNames怎麽用?PHP Publication::getColumnNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Publication
的用法示例。
在下文中一共展示了Publication::getColumnNames方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetPublications
/**
* Return all publications as an array of Publication objects.
*
* @param string $p_name
* @param int $p_aliasId
* @param array $p_sqlOptions
*
* @return array
*/
public static function GetPublications($p_name = null, $p_aliasId = null, $p_sqlOptions = null)
{
global $g_ado_db;
if (is_null($p_sqlOptions)) {
$p_sqlOptions = array();
}
if (!isset($p_sqlOptions["ORDER BY"])) {
$p_sqlOptions["ORDER BY"] = array("Name" => "ASC");
}
$tmpPub = new Publication();
$columns = $tmpPub->getColumnNames(true);
$queryStr = 'SELECT ' . implode(',', $columns) . ', Aliases.Name as Alias' . ', URLTypes.Name as URLType' . ', Languages.OrigName as NativeName' . ' FROM Publications, Languages, Aliases, URLTypes' . ' WHERE Publications.IdDefaultAlias = Aliases.Id ' . ' AND Publications.IdURLType = URLTypes.Id ' . ' AND Publications.IdDefaultLanguage = Languages.Id ';
if (is_string($p_name)) {
$queryStr .= " AND Publications.Name=" . $g_ado_db->escape($p_name);
}
if (is_numeric($p_aliasId)) {
$queryStr .= " AND Publications.IdDefaultAlias={$p_aliasId}";
}
$queryStr = DatabaseObject::ProcessOptions($queryStr, $p_sqlOptions);
$publications = DbObjectArray::Create('Publication', $queryStr);
return $publications;
}