public function isProtected(): bool
{
return $this->isProtected;
}
#[ORM\Entity(repositoryClass: MaterialRepository::class)]
#[SonataAdminProtectedFields\DeleteProtected]
class Material
use Fastbolt\SonataAdminProtectedFields\Protection\Checker\Checker;
class MyChecker implements Checker
{
public function getName(): string
{
return 'my_checker';
}
public function shouldBeProtected(object $item): bool
{
return true;
}
}
use Fastbolt\SonataAdminProtectedFields\Mapping\Attributes as SonataAdminProtectedFields;
#[ORM\Entity(repositoryClass: App\Repository\MyEntityRepository::class)]
#[SonataAdminProtectedFields\DeleteProtected(checker: 'my_checker')]
class MyEntity
{
#[ORM\Column(type: 'string', length: 18)]
#[SonataAdminProtectedFields\WriteProtected(checker: 'my_checker')]
private string $myField = '';
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.