当前位置: 首页>>代码示例>>PHP>>正文


PHP DataObject::set_param方法代码示例

本文整理汇总了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);
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:9,代码来源:_comment.class.php

示例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));
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:9,代码来源:_blog.class.php

示例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);
     }
 }
开发者ID:LFSF,项目名称:oras,代码行数:23,代码来源:_blog.class.php

示例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;
    }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:41,代码来源:_user.class.php

示例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);
     }
 }
开发者ID:LFSF,项目名称:oras,代码行数:16,代码来源:_group.class.php

示例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);
     }
 }
开发者ID:LFSF,项目名称:oras,代码行数:22,代码来源:_widget.class.php

示例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);
 }
开发者ID:LFSF,项目名称:oras,代码行数:9,代码来源:_comment.class.php

示例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;
 }
开发者ID:LFSF,项目名称:oras,代码行数:20,代码来源:_user.class.php


注:本文中的DataObject::set_param方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。