本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
}
}
}
}
示例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();
}
示例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;
}
示例9: delete
public function delete()
{
parent::delete();
unlink($this->getFilePath());
}
示例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;
}
示例11: delete
public function delete()
{
$success = parent::delete();
if ($success) {
$this->setTopics(array());
@unlink($this->getFilePath());
}
return $success;
}
示例12: delete
function delete()
{
object_kill_visits(null, $this->getId());
object_kill_views($this->getId());
return parent::delete();
}
示例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;
}
示例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;
}
示例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;
}