This commit is contained in:
2024-01-31 11:36:25 +07:00
parent caef156a05
commit 4561bd68d1
125 changed files with 9117 additions and 58 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace Hura8\Components\Brand\AdminController;
use Hura8\Components\Brand\Controller\bBrandController;
use Hura8\Interfaces\iEntityAdminController;
use Hura8\Traits\AdminEntityBaseControllerTraits;
class ABrandController extends bBrandController implements iEntityAdminController
{
use AdminEntityBaseControllerTraits;
public function getGroupByFirstLetter() {
return $this->objBrandModel->getGroupByFirstLetter();
}
protected function deleteFileBeforeDeleteItem($item_id): bool
{
// delete thumb files
$item_info = $this->getInfo($item_id);
if($item_info['thumbnail']) {
foreach (static::$resized_sizes as $size => $value) {
$file_local_path = PUBLIC_DIR . "/". static::$image_folder . "/". $size. IMAGE_FILE_SEPARATOR . $item_info['thumbnail'];
unlink($file_local_path);
}
// remove original file
$file_local_path = PUBLIC_DIR . "/". static::$image_folder . "/". $item_info['thumbnail'];
unlink($file_local_path);
}
//delete media files?
// todo:
// ok
return true;
}
}