AppserverIo\Appserver\Application\Application::getManager PHP Method

getManager() public method

Return the requested manager instance.
public getManager ( string $identifier ) : AppserverIo\Psr\Application\ManagerInterface
$identifier string The unique identifier of the requested manager
return AppserverIo\Psr\Application\ManagerInterface The manager instance
    public function getManager($identifier)
    {
        if (isset($this->managers[$identifier])) {
            return $this->managers[$identifier];
        }
    }

Usage Example

Example #1
0
 /**
  * Test if the NULL will be returned for an invalid manager request.
  *
  * @return void
  */
 public function testGetInvalidManager()
 {
     $this->assertNull($this->application->getManager(MockManager::IDENTIFIER));
 }