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


PHP CQuery::insert方法代码示例

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


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

示例1: save

 public function save()
 {
     parent::save();
     // берем все старые записи об участии и создаем их заново
     $q = new CQuery();
     $q->remove(TABLE_EVENT_MEMBERSHIP)->condition("event_id=" . $this->getId())->execute();
     // добавляем заново
     foreach ($this->getMembers()->getItems() as $item) {
         $q = new CQuery();
         $q->insert(TABLE_EVENT_MEMBERSHIP, array("resource_id" => $item->getId(), "event_id" => $this->getId(), "calendar_id" => $this->getCalendar()->getId()));
         $q->execute();
     }
 }
开发者ID:Rustam44,项目名称:ASUPortalPHP,代码行数:13,代码来源:CEvent.class.php

示例2: insert

 public function insert()
 {
     $q = new CQuery();
     $q->insert($this->_table, $this->_items)->execute();
 }
开发者ID:Rustam44,项目名称:ASUPortalPHP,代码行数:5,代码来源:CActiveRecord.class.php

示例3: logUserActivity

 /**
  * Протоколирование действий пользователя
  */
 private function logUserActivity()
 {
     $query = new CQuery($this->getDbLogConnection());
     $query->insert(LOG_TABLE_STATS, array("url" => basename($_SERVER["SCRIPT_NAME"]), "host_ip" => $_SERVER["REMOTE_ADDR"], "port" => $_SERVER["REMOTE_PORT"], "agent" => $_SERVER["HTTP_USER_AGENT"], "user_name" => is_null(CSession::getCurrentUser()) ? 0 : CSession::getCurrentUser()->getId(), "q_string" => $_SERVER['QUERY_STRING'], "referer" => array_key_exists("HTTP_REFERER", $_SERVER) ? $_SERVER["HTTP_REFERER"] : 0, "is_bot" => CUtils::isHTTPRefererIsBot() ? 1 : 0));
     $query->execute();
 }
开发者ID:Rustam44,项目名称:ASUPortalPHP,代码行数:9,代码来源:CApp.class.php

示例4: save

 /**
  * Сохранялка новая, групповая.
  * Блин, как я задолбался уже это писать...
  */
 public function save()
 {
     if ($this->getId() != 0) {
         // удаляем старые вопросы
         $q = new CQuery();
         $q->remove(TABLE_SEB_QUSTIONS_IN_TICKETS)->condition("ticket_id=" . $this->getId())->execute();
     }
     parent::save();
     // сохраняем новые вопросы
     foreach ($this->getQuestions()->getItems() as $i) {
         $q = new CQuery();
         $q->insert(TABLE_SEB_QUSTIONS_IN_TICKETS, array("ticket_id" => $this->getId(), "question_id" => $i->getId()))->execute();
     }
 }
开发者ID:Rustam44,项目名称:ASUPortalPHP,代码行数:18,代码来源:CSEBTicket.class.php

示例5: save

 /**
  * Сохранялка новая, групповая.
  */
 public function save()
 {
     if ($this->getId() != 0) {
         // удаляем старых членов ГАК вместе с председателем
         $q = new CQuery();
         $q->remove(TABLE_SEB_PROTOCOL_MEMBERS)->condition("protocol_id=" . $this->getId())->execute();
     }
     parent::save();
     // сохраняем новыех участников
     foreach ($this->getMembers()->getItems() as $member) {
         $q = new CQuery();
         $q->insert(TABLE_SEB_PROTOCOL_MEMBERS, array("protocol_id" => $this->getId(), "person_id" => $member->getId(), "isMaster" => 0))->execute();
     }
     // председателя тоже сохраняем
     if (!is_null($this->getBoardMaster())) {
         $q = new CQuery();
         $q->insert(TABLE_SEB_PROTOCOL_MEMBERS, array("protocol_id" => $this->getId(), "person_id" => $this->getBoardMaster()->getId(), "isMaster" => 1))->execute();
     }
 }
开发者ID:Rustam44,项目名称:ASUPortalPHP,代码行数:22,代码来源:CSEBProtocol.class.php


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