コード例 #1
0
ファイル: Save.php プロジェクト: dextercowley/jissues
 /**
  * Execute the controller.
  *
  * @return  string
  *
  * @since   1.0
  */
 public function execute()
 {
     $app = $this->getContainer()->get('app');
     $app->getUser()->authorize('admin');
     $table = new ProjectsTable($this->getContainer()->get('db'));
     $table->save($app->input->get('project', array(), 'array'));
     // Reload the project.
     $app->getProject(true);
     return parent::execute();
 }
コード例 #2
0
ファイル: ProjectModel.php プロジェクト: dextercowley/jissues
 /**
  * Delete a project.
  *
  * @param   string  $alias  The project alias.
  *
  * @return  $this  Method allows chaining
  *
  * @since   1.0
  */
 public function delete($alias)
 {
     $project = $this->getByAlias($alias);
     // Delete access groups associated with the project
     $this->db->setQuery($this->db->getQuery(true)->delete($this->db->quoteName('#__accessgroups'))->where($this->db->quoteName('project_id') . '=' . (int) $project->project_id))->execute();
     // @todo: cleanup more.
     // Delete the project
     $table = new ProjectsTable($this->db);
     $table->delete($project->project_id);
     return $this;
 }