<?php
namespace Claromentis\Design\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array();
use Claromentis\Design\Model\Theme;
use Claromentis\Design\Repository\ThemeRepository;
class EditTheme
{
    protected $theme_repo;
    protected $acl;
    public function __construct(ThemeRepository $theme_repo)
    {
        $this->theme_repo = $theme_repo;
    }
    
    
    
    
    
    
    
    public function EditTheme(Theme $theme)
    {
        $_231341bedbbeea0ba9fa8da63ef63dc1 = false;
        if ($theme->id === 0) {
            $theme->SetPriority($this->theme_repo->FindNextPriority());
            $_231341bedbbeea0ba9fa8da63ef63dc1 = true;
        }
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            $theme->SetBaseVi(null);
        }
        $theme->Validate();
        $this->theme_repo->Save($theme);
        return $theme;
    }
}