mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
Replace deprecated ClassUtils
This commit is contained in:
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\Common\Util\ClassUtils;
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||||
use Symfony\Component\Serializer\Annotation\Groups;
|
use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
@@ -463,7 +462,11 @@ class ActivityType
|
|||||||
$property = $field.'Visible';
|
$property = $field.'Visible';
|
||||||
|
|
||||||
// Get the real class name (not the proxy)
|
// Get the real class name (not the proxy)
|
||||||
$realClass = ClassUtils::getClass($this);
|
$class = get_class($this);
|
||||||
|
if (str_contains($class, '__CG__')) {
|
||||||
|
$class = get_parent_class($this);
|
||||||
|
}
|
||||||
|
$realClass = $class;
|
||||||
|
|
||||||
if (!property_exists($realClass, $property)) {
|
if (!property_exists($realClass, $property)) {
|
||||||
throw new \InvalidArgumentException('Field "'.$field.'" not found');
|
throw new \InvalidArgumentException('Field "'.$field.'" not found');
|
||||||
|
Reference in New Issue
Block a user