软弹簧 / 通知包
用户通知包
v5.3.0-beta2
2024-09-25 11:36 UTC
Requires
- php: >=8.1
- doctrine/doctrine-bundle: ^2.5
- doctrine/orm: ^2.10 | ^3.0
- softspring/user-bundle: ^5.2
- symfony/console: ^5.4|^6.0|^7.0
- symfony/form: ^5.4|^6.0|^7.0
- symfony/framework-bundle: ^5.4|^6.0|^7.0
- symfony/security-bundle: ^5.4|^6.0|^7.0
- symfony/translation: ^5.4|^6.0|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: 3.64.*
- phpstan/phpstan: ^1.10
- rector/rector: ^1.0
- 5.3.x-dev
- v5.3.0-beta2
- v5.3.0-beta1
- v5.3.0-alpha21
- 5.2.x-dev
- v5.2.7
- v5.2.6
- v5.2.5
- v5.2.4
- v5.2.3
- v5.2.2
- v5.2.1
- v5.2.0
- v5.2.0-rc10
- v5.2.0-rc9
- v5.2.0-rc8
- v5.2.0-rc7
- v5.2.0-rc6
- v5.2.0-rc5
- v5.2.0-rc4
- v5.2.0-rc1
- 5.1.x-dev
- v5.1.25
- v5.1.24
- v5.1.23
- v5.1.22
- v5.1.21
- v5.1.20
- v5.1.19
- v5.1.18
- v5.1.17
- v5.1.16
- v5.1.15
- v5.1.14
- v5.1.13
- v5.1.12
- v5.1.11
- v5.1.10
- v5.1.9
- v5.1.8
- v5.1.7
- v5.1.6
- v5.1.5
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0-rc1
- v5.0.0-beta1
- 4.1.0
- 4.0.0
- dev-dependabot/composer/friendsofphp/php-cs-fixer-3.64.star
This package is auto-updated.
Last update: 2024-09-25 14:22:36 UTC
README
安装
配置包
如果你使用flex,你可能不需要这样做。但如果你不使用或出现问题,你必须将包包含在config/bundles.php文件中
<?php
return [
...
Softspring\NotificationBundle\SfsNotificationBundle::class => ['all' => true],
];
配置ORM
创建你的通知实体
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Softspring\Component\DoctrineTemplates\Entity\Traits\AutoId;
use Softspring\NotificationBundle\Model\Notification as SfsNotification;
/**
* @ORM\Entity()
* @ORM\Table(name="notification")
*/
class Notification extends SfsNotification
{
use AutoId;
/**
* @var User|null
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="notifications")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
/**
* @inheritdoc
*/
public function getUser(): ?UserInterface
{
return $this->user;
}
/**
* @inheritdoc
*/
public function setUser(UserInterface $user): void
{
$this->user = $user;
}
}
创建config/packages/sfs_notification.yaml文件,并配置你的实体
sfs_notification:
notification_class: App\Entity\Notification