PHP code example of stichtingsd / soft-deleteable-extension-bundle
1. Go to this page and download the library: Download stichtingsd/soft-deleteable-extension-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stichtingsd / soft-deleteable-extension-bundle example snippets
php
# config/bundles.php
return [
...
new StichtingSD\SoftDeleteableExtensionBundle\StichtingSDSoftDeleteableExtensionBundle(),
];
php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use StichtingSD\SoftDeleteableExtensionBundle\Mapping\Attribute as StichtingSD;
use StichtingSD\SoftDeleteableExtensionBundle\Mapping\Type;
use App\Entity\Tenant;
#[ORM\Entity(repositoryClass: 'App\Repository\UserRepository')]
#[Gedmo\SoftDeleteable(fieldName: 'deletedAt')]
class User
{
...
#[StichtingSD\onSoftDelete(type: Type::CASCADE)]
#[ORM\ManyToOne(targetEntity: Tenant::class)]
#[ORM\JoinColumn(nullable: false)]
private ?Tenant $tenant;
...
}