示例#1
0
文件: Model.php 项目: minwork/minwork
 public function __construct(DatabaseStorageInterface $storage, $id = null, $eventDispatcher = null)
 {
     $this->reset()->setStorage($storage)->setId($id)->setEventDispatcher($eventDispatcher ?? EventDispatcher::getGlobal());
 }
示例#2
0
 public function __construct(RouterInterface $router, EnvironmentInterface $environment, EventDispatcherInterface $eventDisptacher = null)
 {
     $this->setRouter($router)->setEnvironment($environment)->setEventDispatcher($eventDisptacher ?? EventDispatcher::getGlobal());
 }
示例#3
0
 public function __construct(DatabaseStorageInterface $storage, array $models, $eventDispatcher = null)
 {
     $this->reset()->setStorage($storage)->setModels($models)->setEventDispatcher($eventDispatcher ?? EventDispatcher::getGlobal());
 }
示例#4
0
 public function __construct(string $name, bool $canQueue = true, bool $canRevert = false, EventDispatcherInterface $eventDispatcher = null)
 {
     $this->setName($name)->setCanQueue($canQueue)->setCanRevert($canRevert)->setEventDispatcher($eventDispatcher ?? EventDispatcher::getGlobal());
 }