original_string: protected function _createCell($className, $action, $plugin, $options)
      {
          /* @var \Cake\View\Cell $instance */
          $instance = new $className($this->request, $this->response, $this->getEventManager(), $options);
  
          $builder = $instance->viewBuilder();
          $builder->setTemplate(Inflector::underscore($action));
  
          if (!empty($plugin)) {
              $builder->setPlugin($plugin);
          }
          if (!empty($this->helpers)) {
              $builder->setHelpers($this->helpers);
          }
  
          if ($this instanceof View) {
              if (!empty($this->theme)) {
                  $builder->setTheme($this->theme);
              }
  
              $class = get_class($this);
              $builder->setClassName($class);
              $instance->viewClass = $class;
  
              return $instance;
          }
  
          if (method_exists($this, 'viewBuilder')) {
              $builder->setTheme($this->viewBuilder()->getTheme());
          }
  
          if (isset($this->viewClass)) {
              $builder->setClassName($this->viewClass);
              $instance->viewClass = $this->viewClass;
          }
  
          return $instance;
      }
code: protected function _createCell($className, $action, $plugin, $options)
      {
          /* @var \Cake\View\Cell $instance */
          $instance = new $className($this->request, $this->response, $this->getEventManager(), $options);
  
          $builder = $instance->viewBuilder();
          $builder->setTemplate(Inflector::underscore($action));
  
          if (!empty($plugin)) {
              $builder->setPlugin($plugin);
          }
          if (!empty($this->helpers)) {
              $builder->setHelpers($this->helpers);
          }
  
          if ($this instanceof View) {
              if (!empty($this->theme)) {
                  $builder->setTheme($this->theme);
              }
  
              $class = get_class($this);
              $builder->setClassName($class);
              $instance->viewClass = $class;
  
              return $instance;
          }
  
          if (method_exists($this, 'viewBuilder')) {
              $builder->setTheme($this->viewBuilder()->getTheme());
          }
  
          if (isset($this->viewClass)) {
              $builder->setClassName($this->viewClass);
              $instance->viewClass = $this->viewClass;
          }
  
          return $instance;
      }
code_tokens: protected function _createCell ( $ className , $ action , $ plugin , $ options ) { /* @var \Cake\View\Cell $instance */ $ instance = new $ className ( $ this -> request , $ this -> response , $ this -> getEventManager ( ) , $ options ) ; $ builder = $ instance -> viewBuilder ( ) ; $ builder -> setTemplate ( Inflector :: underscore ( $ action ) ) ; if ( ! empty ( $ plugin ) ) { $ builder -> setPlugin ( $ plugin ) ; } if ( ! empty ( $ this -> helpers ) ) { $ builder -> setHelpers ( $ this -> helpers ) ; } if ( $ this instanceof View ) { if ( ! empty ( $ this -> theme ) ) { $ builder -> setTheme ( $ this -> theme ) ; } $ class = get_class ( $ this ) ; $ builder -> setClassName ( $ class ) ; $ instance -> viewClass = $ class ; return $ instance ; } if ( method_exists ( $ this , 'viewBuilder' ) ) { $ builder -> setTheme ( $ this -> viewBuilder ( ) -> getTheme ( ) ) ; } if ( isset ( $ this -> viewClass ) ) { $ builder -> setClassName ( $ this -> viewClass ) ; $ instance -> viewClass = $ this -> viewClass ; } return $ instance ; }
docstring: Create and configure the cell instance.
  
  @param string $className The cell classname.
  @param string $action The action name.
  @param string $plugin The plugin name.
  @param array $options The constructor options for the cell.
  @return \Cake\View\Cell
docstring_tokens: Create and configure the cell instance .