getObject() 공개 메소드

플러그인의 인스턴스를 반환한다.
public getObject ( ) : AbstractPlugin
리턴 AbstractPlugin
 /**
  * @depends testConstruct
  *
  * @param \Xpressengine\Plugin\PluginEntity $entity
  */
 public function testGetObejct($entity)
 {
     $plugin = $entity->getObject();
     $this->assertInstanceOf('\\Xpressengine\\Tests\\Plugin\\Sample\\PluginSample', $plugin);
     Mockery::mock('alias:Component', '\\Xpressengine\\Plugin\\ComponentInterface', ['setId' => null, 'setComponentInfo' => null]);
     return $plugin;
 }
예제 #2
0
 /**
  * 플러그인을 부트한다.
  *
  * @param PluginEntity $entity 부트시킬 플러그인
  *
  * @return void
  */
 public function bootPlugin(PluginEntity $entity)
 {
     $pluginObj = $entity->getObject();
     // register & boot plugin's components
     $this->register->addByEntity($entity);
     $entity->bootComponents();
     // bind plugin to application
     $this->app->instance(get_class($pluginObj), $pluginObj);
     // boot plugin
     $pluginObj->boot();
     $this->registerViewNamespace($entity);
 }