本文整理汇总了PHP中PDOConnect::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP PDOConnect::exists方法的具体用法?PHP PDOConnect::exists怎么用?PHP PDOConnect::exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDOConnect
的用法示例。
在下文中一共展示了PDOConnect::exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChildTypes
/**
* Returns an array containing the type of children owned by the group
* @param int $groupId
* @return array[string]
* @throws Exception
*/
public function getChildTypes($groupId)
{
try {
$types = array();
if (PDOConnect::exists('SELECT GroupID FROM lkdatasetgroup WHERE GroupID = :groupId', array('groupId' => $groupId))) {
$types[] = 'data sets';
}
if (PDOConnect::exists('SELECT GroupID FROM lkdisplaygroupgroup WHERE GroupID = :groupId', array('groupId' => $groupId))) {
$types[] = 'display groups';
}
if (PDOConnect::exists('SELECT GroupID FROM lkcampaigngroup WHERE GroupID = :groupId', array('groupId' => $groupId))) {
$types[] = 'layouts and campaigns';
}
if (PDOConnect::exists('SELECT GroupID FROM lklayoutmediagroup WHERE GroupID = :groupId', array('groupId' => $groupId))) {
$types[] = 'media on layouts';
}
if (PDOConnect::exists('SELECT GroupID FROM lklayoutregiongroup WHERE GroupID = :groupId', array('groupId' => $groupId))) {
$types[] = 'regions on layouts';
}
if (PDOConnect::exists('SELECT GroupID FROM lkmediagroup WHERE GroupID = :groupId', array('groupId' => $groupId))) {
$types[] = 'media';
}
return $types;
} catch (Exception $e) {
Debug::Error($e->getMessage());
throw $e;
}
}
示例2: getChildTypes
/**
* Returns an array containing the type of children owned by the user
* @return array[string]
* @throws Exception
*/
public function getChildTypes()
{
if (!isset($this->userId) || $this->userId == 0) {
return $this->SetError(__('Missing userId'));
}
try {
$types = array();
if (PDOConnect::exists('SELECT LayoutID FROM layout WHERE UserID = :userId', array('userId' => $this->userId))) {
$types[] = 'layouts';
}
if (PDOConnect::exists('SELECT MediaID FROM media WHERE UserID = :userId', array('userId' => $this->userId))) {
$types[] = 'media';
}
if (PDOConnect::exists('SELECT EventID FROM schedule WHERE UserID = :userId', array('userId' => $this->userId))) {
$types[] = 'scheduled layouts';
}
if (PDOConnect::exists('SELECT Schedule_DetailID FROM schedule_detail WHERE UserID = :userId', array('userId' => $this->userId))) {
$types[] = 'schedule detail records';
}
if (PDOConnect::exists('SELECT osr_id FROM oauth_server_registry WHERE osr_usa_id_ref = :userId', array('userId' => $this->userId))) {
$types[] = 'applications';
}
return $types;
} catch (Exception $e) {
Debug::Error($e->getMessage());
throw $e;
}
}