Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
62 lines
1.3 KiB
PHP
62 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Doctrine\Persistence\Event;
|
|
|
|
use Doctrine\Common\EventArgs;
|
|
use Doctrine\Persistence\ObjectManager;
|
|
use function class_exists;
|
|
|
|
/**
|
|
* Provides event arguments for the onClear event.
|
|
*/
|
|
class OnClearEventArgs extends EventArgs
|
|
{
|
|
/** @var ObjectManager */
|
|
private $objectManager;
|
|
|
|
/** @var string|null */
|
|
private $entityClass;
|
|
|
|
/**
|
|
* @param ObjectManager $objectManager The object manager.
|
|
* @param string|null $entityClass The optional entity class.
|
|
*/
|
|
public function __construct($objectManager, $entityClass = null)
|
|
{
|
|
$this->objectManager = $objectManager;
|
|
$this->entityClass = $entityClass;
|
|
}
|
|
|
|
/**
|
|
* Retrieves the associated ObjectManager.
|
|
*
|
|
* @return ObjectManager
|
|
*/
|
|
public function getObjectManager()
|
|
{
|
|
return $this->objectManager;
|
|
}
|
|
|
|
/**
|
|
* Returns the name of the entity class that is cleared, or null if all are cleared.
|
|
*
|
|
* @return string|null
|
|
*/
|
|
public function getEntityClass()
|
|
{
|
|
return $this->entityClass;
|
|
}
|
|
|
|
/**
|
|
* Returns whether this event clears all entities.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function clearsAllEntities()
|
|
{
|
|
return $this->entityClass === null;
|
|
}
|
|
}
|
|
|
|
class_exists(\Doctrine\Common\Persistence\Event\OnClearEventArgs::class);
|