本文整理汇总了PHP中Topic::GetByFullName方法的典型用法代码示例。如果您正苦于以下问题:PHP Topic::GetByFullName方法的具体用法?PHP Topic::GetByFullName怎么用?PHP Topic::GetByFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Topic
的用法示例。
在下文中一共展示了Topic::GetByFullName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_set_topic
/**
* Campsite set_topic function plugin
*
* Type: function
* Name: set_topic
* Purpose:
*
* @param array
* $p_params[name] The Name of the topic to be set
* $p_params[identifier] The Identifier of the topic to be set
* @param object
* $p_smarty The Smarty object
*/
function smarty_function_set_topic($p_params, &$p_smarty)
{
// gets the context variable
$campsite = $p_smarty->getTemplateVars('gimme');
if (isset($p_params['identifier'])) {
$attrName = 'identifier';
$attrValue = $p_params['identifier'];
$topicId = intval($p_params['identifier']);
} elseif (isset($p_params['name'])) {
$attrName = 'name';
$attrValue = $p_params['name'];
$topic = Topic::GetByFullName($p_params['name']);
if (!is_null($topic) && $topic->exists()) {
$topicId = $topic->getTopicId();
} else {
$campsite->topic->trigger_invalid_value_error($attrName, $attrValue, $p_smarty);
return false;
}
} else {
$property = array_shift(array_keys($p_params));
CampTemplate::singleton()->trigger_error("invalid parameter '{$property}' in set_topic");
return false;
}
if ($campsite->topic->defined && $campsite->topic->identifier == $topicId) {
return;
}
$topicObj = new MetaTopic($topicId);
if ($topicObj->defined) {
$campsite->topic = $topicObj;
} else {
$campsite->topic->trigger_invalid_value_error($attrName, $attrValue, $p_smarty);
}
}
示例2: Topic
/**
* A topic is like a category for a piece of data.
*
* @param int $p_id
*/
public function Topic($p_idOrName = null)
{
parent::DatabaseObject($this->m_columnNames);
if (preg_match('/^[\\d]+$/', $p_idOrName) > 0) {
$this->m_data['id'] = $p_idOrName;
$this->fetch();
} elseif (is_string($p_idOrName) && !empty($p_idOrName)) {
$topic = Topic::GetByFullName($p_idOrName);
if (!is_null($topic)) {
$this->duplicateObject($topic);
}
}
}
示例3: IsValid
public function IsValid($p_value)
{
$topic = Topic::GetByFullName($p_value);
return !is_null($topic);
}