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


PHP self::insert方法代码示例

本文整理汇总了PHP中self::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP self::insert方法的具体用法?PHP self::insert怎么用?PHP self::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在self的用法示例。


在下文中一共展示了self::insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: append

 /**
  * 添加回复
  */
 public static final function append()
 {
     $online = front::online();
     if (!$online->user_id) {
         die('Permission Denied!');
     }
     //需要登录
     $time = time();
     while (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
         $post = array('doc_id' => isset($_POST['doc_id']) ? $_POST['doc_id'] : '', 'email' => isset($_POST['email']) ? $_POST['email'] : '', 'content' => isset($_POST['content']) ? $_POST['content'] : '', 'ip' => get_onlineip(), 'create_date' => date('Y-m-d', $time), 'create_time' => date('H:i:s', $time));
         //$post['content'] = htmlentities($content , ENT_COMPAT ,'utf-8') ;
         //pecho($post);
         if (!empty($error)) {
             break;
         }
         $doc_remark = new self();
         $doc_remark->doc_remark_id = null;
         $doc_remark->struct($post);
         $doc_remark->insert('', 'doc_remark_id');
         if ($doc_remark->doc_remark_id) {
             $doc = new doc();
             $doc->doc_id = $doc_remark->doc_id;
             $doc->last_remark = date('Y-m-d H:i:s', $time);
             $doc->update();
         }
         //print_r ( $doc_remark);
         header('Location: ?' . $_GET['query']);
         return;
     }
 }
开发者ID:antsmallant,项目名称:coreapp,代码行数:33,代码来源:doc_remark.php

示例2: scanTags

 public static function scanTags($inputTags)
 {
     if (!is_array($inputTags)) {
         return false;
     }
     $inputTags = array_unique($inputTags);
     $result = [];
     foreach ($inputTags as $v) {
         if (empty($v)) {
             continue;
         }
         $slug = StringHelper::generateCleanStr($v);
         if (!$slug) {
             continue;
         }
         $model = static::find()->andWhere(['name' => $slug])->one();
         if ($model) {
             $result[] = $model->mid;
         } else {
             $tag = new self();
             $tag->name = $tag->slug = $slug;
             if ($tag->insert(false)) {
                 $result[] = $tag->mid;
             }
         }
     }
     return $result;
 }
开发者ID:Penton,项目名称:MoBlog,代码行数:28,代码来源:Tag.php

示例3: add

 /**
  * add new log entry.
  * 
  * @param int    $type    The type of add
  *                        + 1 = insertion
  *                        + 2 = update
  *                        + 3 = deletion
  * @param string $message
  */
 public static function add($type, $message, array $additionalData = [])
 {
     $attrs = ['is_insertion' => $type == 1 ? 1 : 0, 'is_update' => $type == 2 ? 1 : 0, 'is_deletion' => $type == 3 ? 1 : 0, 'message' => $message, 'data_json' => $additionalData];
     $model = new self();
     $model->setAttributes($attrs);
     return $model->insert(false);
 }
开发者ID:gitter-badger,项目名称:luya,代码行数:16,代码来源:Log.php

示例4: insertQuote

 /**
  * Insert a new quote.
  * @param string $username
  * @param string $text
  * @return Dog_Quote
  */
 public static function insertQuote($username, $text)
 {
     $quote = new self(array('quot_id' => 0, 'quot_text' => $text, 'quot_username' => $username, 'quot_rating' => 0, 'quot_date' => GWF_Time::getDate(14)));
     if (false === $quote->insert()) {
         return false;
     }
     return $quote;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:Dog_Quote.php

示例5: createStatsRow

 /**
  * @param int $userid
  * @return Dog_ScumStats
  */
 private static function createStatsRow($userid)
 {
     $row = new self(array('scums_userid' => $userid, 'scums_games' => 0, 'scums_won' => 0, 'scums_score' => 0));
     if (false === $row->insert()) {
         return false;
     }
     return $row;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:Dog_ScumStats.php

示例6: newMessage

 public static function newMessage($sender, $target, $message)
 {
     $msg = new self(array('chatmsg_time' => time(), 'chatmsg_from' => $sender, 'chatmsg_to' => $target, 'chatmsg_msg' => $message));
     if (false === $msg->insert()) {
         return false;
     }
     return $msg;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:GWF_ChatMsg.php

示例7: fromCollection

 public static function fromCollection(Collection $initialData)
 {
     $tree = new self();
     foreach ($initialData->toArray() as $element) {
         $tree->insert($element);
     }
     return $tree;
 }
开发者ID:nathanklick,项目名称:collections,代码行数:8,代码来源:NaryTree.php

示例8: insertEntry

 public static function insertEntry($siteid, $score, $usercount, $challcount, $comment = '')
 {
     $entry = new self(array('sitehist_sid' => $siteid, 'sitehist_date' => time(), 'sitehist_score' => $score, 'sitehist_usercount' => $usercount, 'sitehist_challcount' => $challcount, 'sitehist_comment' => $comment));
     if (WECHALL_DEBUG_SCORING) {
         echo WC_HTML::message('Inserting Site History Item...');
     }
     return $entry->insert();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:WC_HistorySite.php

示例9: createSecondaryDispatchRunWithChunkedJobList

 private function createSecondaryDispatchRunWithChunkedJobList()
 {
     foreach (array_chunk($this->jobs, self::CHUNK_SIZE, true) as $jobList) {
         $hash = md5(json_encode($jobList));
         $job = new self(Title::newFromText('UpdateDispatcherChunkedJobList::' . $hash), array('job-list' => $jobList));
         $job->insert();
     }
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:8,代码来源:UpdateDispatcherJob.php

示例10: createSlapRow

 public static function createSlapRow($type, $name, $damage)
 {
     $row = new self(array('lsi_id' => 0, 'lsi_type' => $type, 'lsi_name' => $name, 'lsi_damage' => $damage, 'lsi_count_a' => 0, 'lsi_count_as' => 0));
     if (false === $row->insert()) {
         return false;
     }
     return $row;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Dog_SlapItem.php

示例11: newClient

 private static function newClient($userid)
 {
     $client = new self(array('vsc_uid' => $userid, 'vsc_token' => self::generateToken(), 'vsc_modules' => '', 'vsc_designs' => ''));
     if (false === $client->insert()) {
         return false;
     }
     return $client;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:GWF_Client.php

示例12: insertWord

 public static function insertWord($hang_word, $iso = 'en')
 {
     $word = new self(array('hangman_id' => 0, 'hangman_text' => $hang_word, 'hangman_iso' => $iso));
     if (false === $word->insert()) {
         return false;
     }
     return $word;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Hangman_Words.php

示例13: insertToken

 public static function insertToken(Module_Download $module, GWF_Download $dl, $user, $token)
 {
     $expires = $dl->expires() ? GWF_Time::getDate(GWF_Date::LEN_SECOND, time() + $dl->getVar('dl_expire')) : '';
     $row = new self(array('dlt_dlid' => $dl->getID(), 'dlt_uid' => $user === false ? 0 : $user->getID(), 'dlt_token' => $token, 'dlt_expires' => $expires));
     if (false === $row->insert()) {
         return false;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:GWF_DownloadToken.php

示例14: add

 public static function add(CategoryForm $form)
 {
     $category = new self();
     $category->pid = 0;
     $category->name = $form->name;
     $category->status = $form->status;
     $category->addtime = time();
     return $category->insert();
 }
开发者ID:Crocodile26,项目名称:php-1,代码行数:9,代码来源:Category.php

示例15: addChat

 public static function addChat($IDParent, $Text, $IDUser = null)
 {
     if (!isset($IDUser)) {
         $IDUser = Zend_Auth::getInstance()->getIdentity()->IDUser;
     }
     $TheChat = new self();
     $Data = array('IDParent' => $IDParent, 'Text' => $Text, 'IDUser' => $IDUser, 'Date' => new Zend_Db_Expr('NOW()'));
     return $TheChat->insert($Data);
 }
开发者ID:BGCX262,项目名称:zweer-gdr-svn-to-git,代码行数:9,代码来源:Chat.php


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