/** * @inheritdoc */ public function disableContentContainer(ContentContainerActiveRecord $container) { parent::disableContentContainer($container); foreach (Task::find()->contentContainer($container)->all() as $task) { $task->delete(); } }
protected function getTaskById($id) { $task = Task::find()->contentContainer($this->contentContainer)->readable()->where(['task.id' => $id])->one(); if ($task === null) { throw new HttpException(404, "Could not load task!"); } return $task; }