Mark one or more contact records as deleted

@param array   $ids   Record identifiers
@param boolean $force Remove record(s) irreversible (unsupported)
345689
function delete($ids, $force = true)
    {
        if (!is_array($ids)) {
            $ids = explode(self::SEPARATOR, $ids);
        }

        $ids = $this->db->array2list($ids, 'integer');

        // flag record as deleted (always)
        $this->db->query(
            "UPDATE " . $this->db->table_name($this->db_name, true).
            " SET `del` = 1, `changed` = ".$this->db->now().
            " WHERE `user_id` = ?".
                " AND `contact_id` IN ($ids)",
            $this->user_id
        );

        $this->cache = null;

        return $this->db->affected_rows();
    }
692726
protected function deleteByIds(ActivityListener $listener, array $ids)
    {
        $logs = Logs::query()->whereIn('id', $ids);
        if (!$logs->delete()) {
            return $listener->deleteFailed();
        }
        return $listener->deleteSuccess();
    }
497676
protected function detachUsingCustomClass($ids)
    {
        $results = 0;

        foreach ($this->parseIds($ids) as $id) {
            $results += $this->newPivot([
                $this->foreignPivotKey => $this->parent->{$this->parentKey},
                $this->relatedPivotKey => $id,
            ], true)->delete();
        }

        return $results;
    }
1364170
public function costsDelete(array $ids)
    {
        if (!count($ids)) {
            throw new \InvalidArgumentException(
                'Parameter `ids` must contains a data'
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            '/costs/delete',
            "POST",
            ['ids' => json_encode($ids)]
        );
    }
1254431
public function autoExport(array $ids)
    {
        $this->exportPosts = array_replace($this->exportPosts, $ids);
        $this->exportPosts = array_unique($this->exportPosts);
    }
1230686
public function sync($ids, $detaching = true)
    {
        $changes = array(
            'attached' => array(), 'detached' => array(), 'updated' => array()
        );

        // get them as collection
        if ($ids instanceof Collection) $ids = $ids->modelKeys();

        // First we need to attach the relationships that do not exist
        // for this model so we'll spin throuhg the edges of this model
        // for the specified type regardless of the direction and create
        // those that do not exist.

        // Let's fetch the existing edges first.
        $edges = $this->edges();
        // Collect the current related models IDs out of related models.
        $current = array_map(function(Relation $edge){ return $edge->getRelated()->getKey(); }, $edges->toArray());

        $records = $this->formatSyncList($ids);

        $detach = array_diff($current, array_keys($records));

        // Next, we will take the differences of the currents and given IDs and detach
        // all of the entities that exist in the "current" array but are not in the
        // the array of the IDs given to the method which will complete the sync.
        if ($detaching && count($detach) > 0)
        {
            $this->detach($detach);

            $changes['detached'] = (array) array_map('intval', $detach);
        }

        // Now we are finally ready to attach the new records. Note that we'll disable
        // touching until after the entire operation is complete so we don't fire a
        // ton of touch operations until we are totally done syncing the records.
        $changes['attached'] = $records;
        $changes['updated']  = $current;

        // Now we are finally ready to attach the new records. Note that we'll disable
        // touching until after the entire operation is complete so we don't fire a
        // ton of touch operations until we are totally done syncing the records.
        $changes = array_merge(
            $changes, $this->attachNew($records, $current, false)
        );

        $this->touchIfTouching();

        return $changes;
    }
292352
protected function forbidAbilitiesToEveryone(array $ids)
    {
        $attributes = Models::scope()->getAttachAttributes() + ['forbidden' => true];

        $records = array_map(function ($id) use ($attributes) {
            return ['ability_id' => $id] + $attributes;
        }, $ids);

        Models::query('permissions')->insert($records);
    }
1015900
public function delete(array $ids)
    {
        if (!count($ids)) {
            return;
        }
        $ids_str = implode(',', $ids);
        $db = Db::obtain();
        $slots = $db->fetchArrayPDO(
            'SELECT id FROM ' . Db::realTablename('slots') . ' WHERE match_id IN (' . $ids_str . ')',
            array()
        );
        $slotsFormatted = array();
        foreach ($slots as $slot) {
            array_push($slotsFormatted, $slot['id']);
        }
        if (count($slotsFormatted)) {
            $slots_str = implode(',', $slotsFormatted);
            $db->exec('DELETE FROM ' . Db::realTablename('ability_upgrades') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('additional_units') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('slots') . ' WHERE id IN (' . $slots_str . ')');
        }
        $db->exec('DELETE FROM ' . Db::realTablename('picks_bans') . ' WHERE match_id IN (' . $ids_str . ')');
        $db->exec('DELETE FROM ' . Db::realTablename('matches') . ' WHERE match_id IN (' . $ids_str . ')');
    }
190581
public function removePermission($ids)
    {
        $ids = is_array($ids) ? $ids : func_get_args();

        $this->permissions()->detach($ids);
    }
47955
public function deleteItems( array $ids )
	{
		$path = 'mshop/customer/manager/typo3/delete';
		$this->deleteItemsBase( $ids, $path, false, 'uid' );

		$manager = $this->getObject()->getSubManager( 'address' );
		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
		$search->setConditions( $search->compare( '==', 'customer.address.parentid', $ids ) );
		$manager->deleteItems( array_keys( $manager->searchItems( $search ) ) );

		$manager = $this->getObject()->getSubManager( 'lists' );
		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
		$search->setConditions( $search->compare( '==', 'customer.lists.parentid', $ids ) );
		$manager->deleteItems( array_keys( $manager->searchItems( $search ) ) );

		$manager = $this->getObject()->getSubManager( 'property' );
		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
		$search->setConditions( $search->compare( '==', 'customer.property.parentid', $ids ) );
		$manager->deleteItems( array_keys( $manager->searchItems( $search ) ) );
	}
1086359
public function deleteRoles(array $ids): void
	{
		if ($this->isAjax()) {
			$roles = $this->orm->aclRoles->findById($ids);
			foreach ($roles as $role) {
				$this->orm->aclRoles->remove($role);
			}
			$this->orm->flush();
			$this['permissionsList']->reload();
		} else {
			$this->terminate();
		}
	}
430411
public function delete(string $id, bool $force = false)
    {
        return $this->curl->delete($this->url.'/'.$id.'?'.http_build_query(['force' => $force]));
    }
495502
protected function disassociateAuthority(Model $authority, array $ids)
    {
        $this->getAbilitiesPivotQuery($authority, $ids)
             ->where($this->constraints())
             ->delete();
    }
362159
public static function destroy($ids)
    {
        // We'll initialize a count here so we will return the total number of deletes
        // for the operation. The developers can then check this number as a boolean
        // type value or get this total count of records deleted for logging, etc.
        $count = 0;

        $ids = is_array($ids) ? $ids : func_get_args();

        // We will actually pull the models from the database table and call delete on
        // each of them individually so that their events get fired properly with a
        // correct set of attributes in case the developers wants to check these.
        $key = with($instance = new static)->getKeyName();

        foreach ($instance->whereIn($key, $ids)->get() as $model) {
            if ($model->delete()) {
                ++$count;
            }
        }

        return $count;
    }
268563
public function deleteByIds($ids)
    {
        $qb = $this->createQueryBuilder('filter')->delete()->where(
            'filter.id IN (:ids)'
        )->setParameter('ids', $ids);
        $qb->getQuery()->execute();
    }
602599
protected function touch($force = false)
    {
        if (true === $this->getState()->is('deleted')) {
            return $this;
        }
        if (true === $this->getState()->is('empty') || true === $force) {
            $record = $this->store->retrieveRecord($this->getType(), $this->getId());
            $this->initialize($record['properties']);
            $this->getState()->setLoaded();
        }
        return $this;
    }
593719
protected function disassociateEveryone(array $ids)
    {
        $query = Models::query('permissions')
            ->whereNull('entity_id')
            ->where($this->constraints())
            ->whereIn('ability_id', $ids);

        Models::scope()->applyToRelationQuery($query, $query->from);

        $query->delete();
    }