src/Service/EntityManager/ReductionManager.php
/**
     * Prepare all reduction entities before persist.
     */
Prepare all reduction entities before persist.
Prepare all reduction entities before persist .
public function prepare(Reduction $reduction, User $user, ?string $clientIp): Reduction
    {
        $reduction->setSlug(SeoSlugger::uniqueSlugify($reduction->getTitle()));
        $reduction->setUser($user);
        $reduction->setClientIp($clientIp);
        if ($user->isAdmin()) {
            $reduction->setIsActive(true);
        }
        return $reduction;
    }
public function prepare ( Reduction $ reduction , User $ user , ? string $ clientIp ) : Reduction { $ reduction -> setSlug ( SeoSlugger :: uniqueSlugify ( $ reduction -> getTitle ( ) ) ) ; $ reduction -> setUser ( $ user ) ; $ reduction -> setClientIp ( $ clientIp ) ; if ( $ user -> isAdmin ( ) ) { $ reduction -> setIsActive ( true ) ; } return $ reduction ; }
Prepare all reduction entities before persist.
Prepare all reduction entities before persist .
// An admin doesn't need a verification.