You are here

class OnClearEventArgs in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php \Doctrine\Common\Persistence\Event\OnClearEventArgs

Provides event arguments for the onClear event.

@link www.doctrine-project.org @since 2.2 @author Roman Borschel <roman@code-factory.de> @author Benjamin Eberlei <kontakt@beberlei.de>

Hierarchy

Expanded class hierarchy of OnClearEventArgs

File

vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php, line 33

Namespace

Doctrine\Common\Persistence\Event
View source
class OnClearEventArgs extends EventArgs {

  /**
   * @var \Doctrine\Common\Persistence\ObjectManager
   */
  private $objectManager;

  /**
   * @var string|null
   */
  private $entityClass;

  /**
   * Constructor.
   *
   * @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 \Doctrine\Common\Persistence\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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EventArgs::$_emptyEventArgsInstance private static property Single instance of EventArgs.
EventArgs::getEmptyInstance public static function Gets the single, empty and immutable EventArgs instance.
OnClearEventArgs::$entityClass private property
OnClearEventArgs::$objectManager private property
OnClearEventArgs::clearsAllEntities public function Returns whether this event clears all entities.
OnClearEventArgs::getEntityClass public function Returns the name of the entity class that is cleared, or null if all are cleared.
OnClearEventArgs::getObjectManager public function Retrieves the associated ObjectManager.
OnClearEventArgs::__construct public function Constructor.