本文整理汇总了PHP中DataObject::set_param方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObject::set_param方法的具体用法?PHP DataObject::set_param怎么用?PHP DataObject::set_param使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObject
的用法示例。
在下文中一共展示了DataObject::set_param方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Set author User of this comment
*/
function set_author_User(&$author_User)
{
$this->author_User =& $author_User;
$this->author_user_ID = $author_User->ID;
parent::set_param('author_ID', 'number', $author_User->ID);
}
示例2:
/**
* Set the full URL of the media folder
*
* @param string the full URL
*/
function set_media_url($url)
{
parent::set_param('media_url', 'string', trailing_slash($url));
}
示例3: set
/**
* Set param value
*
* @param string Parameter name
* @return boolean true, if a value has been set; false if it has not changed
*/
function set($parname, $parvalue)
{
global $Settings;
switch ($parname) {
case 'ID':
case 'allowtrackbacks':
case 'blog_in_bloglist':
return parent::set_param($parname, 'number', $parvalue);
break;
case 'shortdesc':
$this->shortdesc = $parvalue;
return parent::set_param('description', 'string', $parvalue);
break;
default:
return parent::set_param($parname, 'string', $parvalue);
}
}
示例4: SQL
/**
* Set email address of the user.
*
* If the email address has changed and we're configured to invalidate the user in this case,
* the user's account gets not active 'emaichanged' status here.
*
* @param string email address to set for the User
* @param boolean Set TRUE if changing of account status is required
* @return boolean true, if set; false if not changed
*/
function set_email($email, $change_status = true)
{
global $Settings;
$r = parent::set_param('email', 'string', utf8_strtolower($email));
if ($change_status) {
// Change user status to 'emailchanged' (if email has changed and Settings are available, which they are not during install):
if ($r && $this->ID != 0 && isset($Settings) && $Settings->get('newusers_revalidate_emailchg') && $this->check_status('is_validated')) {
// Deactivate the account, because the changed email has not been verified yet, but the user account is active:
$this->set('status', 'emailchanged');
}
}
if (preg_match('#@(.+)#i', $email, $ematch)) {
// Set email domain ID
global $DB;
$email_domain = $ematch[1];
$SQL = new SQL();
$SQL->SELECT('dom_ID');
$SQL->FROM('T_basedomains');
$SQL->WHERE('dom_type = \'email\'');
$SQL->WHERE_and('dom_name = ' . $DB->quote($email_domain));
$dom_ID = $DB->get_var($SQL->get());
if (!$dom_ID) {
// The email domains doesn't exist yet, Insert new record
$DB->query('INSERT INTO T_basedomains ( dom_type, dom_name )
VALUES ( \'email\', ' . $DB->quote($email_domain) . ' )');
$dom_ID = $DB->insert_id;
}
$this->set('email_dom_ID', (int) $dom_ID);
}
return $r;
}
示例5: set
/**
* Set param value
*
* @param string Parameter name
* @param mixed Parameter value
* @return boolean true, if a value has been set; false if it has not changed
*/
function set($parname, $parvalue)
{
switch ($parname) {
case 'perm_templates':
return parent::set_param($parname, 'number', $parvalue);
default:
return parent::set_param($parname, 'string', $parvalue);
}
}
示例6: set
/**
* Set param value
*
* @param string parameter name
* @param mixed parameter value
* @return boolean true, if a value has been set; false if it has not changed
*/
function set($parname, $parvalue)
{
$params = $this->get_param_definitions(NULL);
if (isset($params[$parname])) {
// This is a widget specific param:
$this->param_array[$parname] = $parvalue;
// This is what'll be saved to the DB:
$this->set_param('params', 'string', serialize($this->param_array));
return;
}
switch ($parname) {
default:
return parent::set_param($parname, 'string', $parvalue);
}
}
示例7:
/**
* Set the spam karma, as a number.
* @param integer Spam karma (-100 - 100)
* @access protected
*/
function set_spam_karma($spam_karma)
{
return parent::set_param('spam_karma', 'number', $spam_karma);
}
示例8:
/**
* Set email address of the user.
*
* If the email address has changed and we're configured to invalidate the user in this case,
* the user's account gets invalidated here.
*
* @param string email address to set for the User
* @return boolean true, if set; false if not changed
*/
function set_email($email)
{
global $Settings;
$r = parent::set_param('email', 'string', $email);
// Change "validated" status to false (if email has changed and Settings are available, which they are not during install):
if ($r && isset($Settings) && $Settings->get('newusers_revalidate_emailchg')) {
// In-validate account, because (changed) email has not been verified yet:
parent::set_param('validated', 'number', 0);
}
return $r;
}