删除任务

@param string $id
@return void
776325
public function deleteReserved($id)
    {
        $this->db->transaction(function () use ($id) {
            if ($this->db->name($this->table)->lock(true)->find($id)) {
                $this->db->name($this->table)->where('id', $id)->delete();
            }
        });
    }
166710
public function setId($id)
    {
        if ($this->id) {
            return;
        }
        if (strlen($id) >= 20) {
            $this->id = $id;

            return;
        }
        list($a, $b) = explode(' ', microtime());
        $this->id = preg_replace("/[^\d]/", '', $b.$a.$id);
    }
355392
public function delete($id)
    {
        $this->request->allowMethod('post');

        /** @var Page $page */
        $page = $this->Pages->get($id);

        if ($this->Pages->delete($page)) {
            $this->Flash->success(__d('wasabi_cms', 'The page <strong>{0}</strong> has been deleted.', $page->name));
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }

        $this->redirect(['action' => 'index']);
        return;
    }
610758
public function delete( $id ) {

		$container = $this->read( $id );

		foreach ( $container->getLinkedList() as $linkedId ) {
			$key = $this->getKey( (string)$linkedId );
			$this->cache->delete( $key );
			$this->internalCache->delete( $key );
		}

		$this->cache->delete( $this->getKey( $id ) );
		$this->internalCache->delete( $this->getKey( $id ) );
	}
929520
public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
1210895
public function remove($id)
    {
        if ($this->fileSystem->has($id)) {
            $this->fileSystem->delete($id);
        }
    }
1051375
public function setId($id)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        $context->session_id = $id;
    }
147401
public function delete(string $id)
    {
        $this->request->allowMethod('delete');

        $entity = $this->SavedSearches->find()
            ->enableHydration(true)
            ->where(['id' => $id])
            ->first();

        $success = false;
        if (null !== $entity) {
            Assert::isInstanceOf($entity, EntityInterface::class);
            $success = $this->SavedSearches->delete($entity);
        }

        $this->set('success', $success);
        $success ?
            $this->set('data', []) :
            $this->set('error', 'The saved search could not be deleted. Please, try again.');
        $this->set('_serialize', ['success', 'data', 'error']);
    }
1000818
public function setAttributeId( $id )
	{
		if ( $id == $this->getAttributeId() ) { return; }

		$this->_values['attrid'] = (string) $id;
		$this->setModified();
	}
1087998
public function view($id = null)
    {
        $user = $this->Users->findById($id)
            ->contain(['Groups' => ['fields' => ['label']]])
            ->firstOrFail();

        $this->set(compact('user'));

        if (getConfig('users.login_log')) {
            $this->set('loginLog', $this->LoginRecorder->setConfig('user', $id)->read());
        }
    }
182589
public function set_id( $id ) {
		$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();
	}
943427
public function logout($id = null)
    {
        if ($id !== null) {
            $this->_data['id'] = $id;
        }

        //Reset
        $this->_data['life'] = 0;
        $this->_data['token'] = md5(microtime());
        
        $this->_db->query(
            'UPDATE '.$this->_dbConfig['table']
                         .' SET '.$this->_dbConfig['token'].'="'
                         .$this->_data['token'].'", '
                         .$this->_dbConfig['life'].' = "'
                         .$this->_data['life'].'" WHERE '
                         .$this->_dbConfig['id'].' = '
            .$this->_data['id']
        );
    }
702016
public function remove($id)
    {
        $id = (string) $id;

        $this->validateRemove($id);

        if (!$this->has($id)) {
            return;
        }

        unset($this->items[$id]);
    }
907289
public static function remove($id)
    {
        if (isset(self::$list[$id])) {
            self::$list[$id]->free();
        }
    }
1113571
public static function destroy($id) {
        $model = get_called_class();
        /* @var $model Record */
        $model = new $model;
        $pk = $model->getPkField();
        $model->$pk = $id;
        $model->delete();
    }
557238
public function deleteById($id) {
		$this->provider('cache')->cacheClear('db', $this->getDao()->getTableName());
	    $obj = $this->getConnection()->where($this->getDao()->getTableId(), $id);
        return $obj->delete($this->getDao()->getTableName());
	}
390698
public function delete($id)
    {
        $id = explode(',', $id);

        if ($this->request->isPost() || $this->request->isDelete()) {
            $single = false;
            if (count($id) === 1) {
                $single = true;
            }

            try {
                $this->data['entries'] = array();

                foreach ($id as $value) {
                    $model = $this->collection->findOne($value);

                    if (is_null($model)) {
                        if ($single) {
                            $this->app->notFound();
                        }

                        continue;
                    }

                    $model->remove();

                    $this->data['entries'][] = $model;
                }

                h('notification.info', $this->clazz.' deleted.');

                h('controller.delete.success', array(
                    'models' => $this->data['entries'],
                ));

            } catch (Stop $e) {
                throw $e;
            } catch (Exception $e) {
                h('notification.error', $e);

                if (empty($model)) {
                    $model = null;
                }

                h('controller.delete.error', array(
                    'error' => $e,
                    'model' => $model,
                ));
            }

        }
    }