mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php namespace Visiosoft\LocationModule\Http\Controller\Admin;
|
|
|
|
use Visiosoft\LocationModule\City\CityModel;
|
|
use Visiosoft\LocationModule\Country\Form\CountryFormBuilder;
|
|
use Visiosoft\LocationModule\Country\Table\CountryTableBuilder;
|
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
|
|
|
class CountriesController extends AdminController
|
|
{
|
|
|
|
/**
|
|
* Display an index of existing entries.
|
|
*
|
|
* @param CountryTableBuilder $table
|
|
* @return \Symfony\Component\HttpFoundation\Response
|
|
*/
|
|
public function index(CountryTableBuilder $table)
|
|
{
|
|
if($this->request->action == "delete") {
|
|
$city = new CityModel();
|
|
foreach ($this->request->id as $item)
|
|
{
|
|
$city->deleteCitiesByCountry($item);
|
|
}
|
|
}
|
|
return $table->render();
|
|
}
|
|
|
|
/**
|
|
* Create a new entry.
|
|
*
|
|
* @param CountryFormBuilder $form
|
|
* @return \Symfony\Component\HttpFoundation\Response
|
|
*/
|
|
public function create(CountryFormBuilder $form)
|
|
{
|
|
return $form->render();
|
|
}
|
|
|
|
/**
|
|
* Edit an existing entry.
|
|
*
|
|
* @param CountryFormBuilder $form
|
|
* @param $id
|
|
* @return \Symfony\Component\HttpFoundation\Response
|
|
*/
|
|
public function edit(CountryFormBuilder $form, $id)
|
|
{
|
|
return $form->render($id);
|
|
}
|
|
}
|