Code Duplication    Length = 8-10 lines in 3 locations

lib/Cake/Controller/Controller.php 1 location

@@ 654-661 (lines=8) @@
651
 *
652
 * @return CakeEventManager
653
 */
654
	public function getEventManager() {
655
		if (empty($this->_eventManager)) {
656
			$this->_eventManager = new CakeEventManager();
657
			$this->_eventManager->attach($this->Components);
658
			$this->_eventManager->attach($this);
659
		}
660
		return $this->_eventManager;
661
	}
662
663
/**
664
 * Perform the startup process for this controller.

lib/Cake/Model/Model.php 1 location

@@ 776-784 (lines=9) @@
773
 *
774
 * @return CakeEventManager
775
 */
776
	public function getEventManager() {
777
		if (empty($this->_eventManager)) {
778
			$this->_eventManager = new CakeEventManager();
779
			$this->_eventManager->attach($this->Behaviors);
780
			$this->_eventManager->attach($this);
781
		}
782
783
		return $this->_eventManager;
784
	}
785
786
/**
787
 * Handles custom method calls, like findBy<field> for DB models,

lib/Cake/View/View.php 1 location

@@ 358-367 (lines=10) @@
355
 *
356
 * @return CakeEventManager
357
 */
358
	public function getEventManager() {
359
		if (empty($this->_eventManager)) {
360
			$this->_eventManager = new CakeEventManager();
361
		}
362
		if (!$this->_eventManagerConfigured) {
363
			$this->_eventManager->attach($this->Helpers);
364
			$this->_eventManagerConfigured = true;
365
		}
366
		return $this->_eventManager;
367
	}
368
369
/**
370
 * Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.