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


PHP SimpleORMap::delete方法代码示例

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


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

示例1: delete

 function delete()
 {
     $old_assign_object = new AssignObject($this->id);
     $ret = parent::delete();
     $old_assign_object->delete();
     return $ret;
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:ResourceAssignment.class.php

示例2: delete

 /**
  * {@inheritdoc }
  */
 public function delete()
 {
     // Resort members
     $query = "UPDATE statusgruppe_user SET position = position - 1 WHERE statusgruppe_id = ? AND position > ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->statusgruppe_id, $this->position));
     return parent::delete();
 }
开发者ID:ratbird,项目名称:hope,代码行数:11,代码来源:StatusgruppeUser.php

示例3: delete

 /**
  * Deletes the asset.
  *
  * @return int indicating how many rows were deleted
  */
 public function delete()
 {
     $filename = $this->getFilepath();
     if (file_exists($filename)) {
         unlink($filename);
     }
     return parent::delete();
 }
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:PluginAsset.php

示例4: delete

 /**
  * Delete all the links to this file and the file itself.
  */
 public function delete()
 {
     $db = DBManager::get();
     if (isset($this->storage_object)) {
         $this->storage_object->delete();
     }
     $stmt = $db->prepare('DELETE FROM file_refs WHERE file_id = ?');
     $stmt->execute(array($this->file_id));
     parent::delete();
 }
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:File.php

示例5: delete

 public function delete()
 {
     // do not delete until one calendar is left
     if (sizeof($this->calendars) > 1) {
         return false;
     }
     $calendars = $this->calendars;
     $ret = parent::delete();
     // only one calendar is left
     if ($ret) {
         $calendars->each(function ($c) {
             $c->delete();
         });
     }
     return $ret;
 }
开发者ID:ratbird,项目名称:hope,代码行数:16,代码来源:EventData.class.php

示例6: afterUpdate

 public function afterUpdate(SimpleORMap $object, $line)
 {
     $old_domains = array_map(function ($domain) {
         return $domain->getID();
     }, $this->old_domains);
     $new_domains = UserDomain::getUserDomainsForUser($object->getId());
     foreach ($new_domains as $domain_id) {
         if (!in_array($domain_id, $old_domains)) {
             if ($domain_id === "alumni") {
                 if (count($new_domains) == 1) {
                     $statement = DBManager::get()->prepare("\n                            SELECT seminar_user.Seminar_id \n                            FROM seminar_user\n                                LEFT JOIN seminar_userdomain ON (seminar_user.Seminar_id = seminar_userdomain.Seminar_id)\n                            WHERE seminar_user.user_id = :user_id\n                                AND seminar_user.Seminar_id NOT IN (SELECT seminar_id FROM seminar_userdomain WHERE userdomain_id = 'alumni')\n                        ");
                     $statement->execute(array('user_id' => $object->getId()));
                     foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $seminar_id) {
                         $seminar = new Seminar($seminar_id);
                         $seminar->deleteMember($object->getId());
                     }
                 }
                 $datafield = Datafield::findOneBySQL("name = 'Ich will weiterhin als Alumni in Stud.IP geführt werden' AND object_type = 'user'");
                 $user_wants_to_stay = DatafieldEntry::findOneBySQL("datafield_id = ? AND range_id = ?", array($datafield->getId(), $object->getId()));
                 if ($user_wants_to_stay['content']) {
                     //In Veranstaltung ALUMNI die Statusgruppe anlegen:
                     $datafield = Datafield::findOneBySQL("name = 'Alumni' AND object_type = 'user'");
                     $entry = DatafieldEntry::findOneBySQL("datafield_id = ? AND range_id = ?", array($datafield->getId(), $object->getId()));
                     $course = Course::findOneByName("ALUMNI");
                     $gruppenname = $entry ? $entry['content'] : null;
                     if ($course && $gruppenname) {
                         $statusgruppe = Statusgruppen::findOneBySQL("name = ? range_id = ?", array($gruppenname, $course->getId()));
                         if (!$statusgruppe) {
                             $statusgruppe = new Statusgruppen();
                             $statusgruppe['name'] = $gruppenname;
                             $statusgruppe['range_id'] = $course->getId();
                             $statusgruppe->store();
                         }
                         if (!$statusgruppe->isMember($object->getId())) {
                             $statusgruppe->addUser($object->getId());
                         }
                     }
                 } else {
                     $object->delete();
                     $deleted = true;
                 }
             }
         }
     }
 }
开发者ID:Krassmus,项目名称:Fleximport,代码行数:45,代码来源:fleximport_pan_userimport.php

示例7: delete

 /**
  * delete entry from database
  * the object is cleared and turned to new state
  * @return boolean
  */
 public function delete()
 {
     if (!$this->isNew()) {
         // Remove banner file
         unlink($GLOBALS['DYNAMIC_CONTENT_PATH'] . '/banner/' . $this->banner_path);
     }
     return parent::delete();
 }
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:Banner.class.php

示例8: delete

 public function delete()
 {
     $db = DBManager::get();
     $query = "DELETE FROM resources_requests_properties WHERE request_id=" . $db->quote($this->getId());
     $properties_deleted = $db->exec($query);
     // LOGGING
     log_event("RES_REQUEST_DEL", $this->seminar_id, $this->resource_id, "Termin: {$this->termin_id}, Metadate: {$this->metadate_id}", "");
     return parent::delete() || $properties_deleted;
 }
开发者ID:ratbird,项目名称:hope,代码行数:9,代码来源:RoomRequest.class.php

示例9: delete

 public function delete()
 {
     parent::delete();
     unlink($this->getFilePath());
 }
开发者ID:studip,项目名称:PluginMarket,代码行数:5,代码来源:MarketImage.class.php

示例10: delete

 /**
  * @see SimpleORMap::delete()
  */
 function delete()
 {
     $id = $this->getId();
     $object_type = $this->object_type;
     $ret = parent::delete();
     $db = DBManager::get();
     $tables['sem'] = 'seminare';
     $tables['inst'] = 'Institute';
     $tables['user'] = 'user_info';
     $db->exec("UPDATE " . $tables[$object_type] . " SET lock_rule='' WHERE lock_rule = " . $db->quote($id));
     return $ret;
 }
开发者ID:ratbird,项目名称:hope,代码行数:15,代码来源:LockRule.class.php

示例11: delete

 public function delete()
 {
     $success = parent::delete();
     if ($success) {
         $this->setTopics(array());
         @unlink($this->getFilePath());
     }
     return $success;
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:9,代码来源:LernmarktplatzMaterial.php

示例12: delete

 function delete()
 {
     object_kill_visits(null, $this->getId());
     object_kill_views($this->getId());
     return parent::delete();
 }
开发者ID:ratbird,项目名称:hope,代码行数:6,代码来源:StudipNews.class.php

示例13: delete

 /**
  * Delete entry from database.
  * The object is cleared and turned to new state.
  * Posts the Notifications "Document(Will|Did)Delete" if successful.
  * The subject of the notification is the former document.
  *
  * @return boolean  always true
  */
 function delete()
 {
     $to_delete = clone $this;
     NotificationCenter::postNotification('DocumentWillDelete', $to_delete);
     if ($ret = parent::delete()) {
         NotificationCenter::postNotification('DocumentDidDelete', $to_delete);
     }
     return $ret;
 }
开发者ID:ratbird,项目名称:hope,代码行数:17,代码来源:StudipDocument.class.php

示例14: delete

 public function delete()
 {
     $id = $this->getId();
     NotificationCenter::postNotification("PostingWillDelete", $this);
     foreach ((array) self::findBySQL(__CLASS__, "parent_id = " . DBManager::get()->quote($this->getId())) as $child_posting) {
         $child_posting->delete();
     }
     $success = parent::delete();
     if ($success) {
         NotificationCenter::postNotification("PostingHasDeleted", $this);
     }
     DBManager::get()->exec("INSERT INTO blubber_events_queue " . "SET event_type = 'delete', " . "item_id = " . DBManager::get()->quote($id) . ", " . "mkdate = UNIX_TIMESTAMP() " . "");
     return $success;
 }
开发者ID:noackorama,项目名称:blubberforum,代码行数:14,代码来源:ForumPosting.class.php

示例15: delete

 /**
  * Deletes the cycle.
  *
  * @return int number of affected rows
  */
 public function delete()
 {
     $cycle_info = $this->toString();
     $seminar_id = $this->seminar_id;
     $result = parent::delete();
     if ($result) {
         StudipLog::log('SEM_DELETE_CYCLE', $seminar_id, null, $cycle_info);
     }
     return $result;
 }
开发者ID:ratbird,项目名称:hope,代码行数:15,代码来源:SeminarCycleDate.class.php


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