original_string: public function afterFetch()
      {
          /*
           * Override the database columns with the plugin details
           * found in the plugin registration file.
           */
          $manager = PluginManager::instance();
          $pluginObj = $manager->findByIdentifier($this->code);
  
          if ($pluginObj) {
              $pluginInfo = $pluginObj->pluginDetails();
              foreach ($pluginInfo as $attribute => $info) {
                  if (property_exists($this, $attribute)) {
                      $this->{$attribute} = Lang::get($info);
                  }
              }
  
              if ($this->is_disabled) {
                  $manager->disablePlugin($this->code, true);
              }
              else {
                  $manager->enablePlugin($this->code, true);
              }
  
              $this->disabledBySystem = $pluginObj->disabled;
  
              if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) {
                  $this->disabledByConfig = in_array($this->code, $configDisabled);
              }
          }
          else {
              $this->name = $this->code;
              $this->description = Lang::get('system::lang.plugins.unknown_plugin');
              $this->orphaned = true;
          }
      }
code: public function afterFetch()
      {
          /*
           * Override the database columns with the plugin details
           * found in the plugin registration file.
           */
          $manager = PluginManager::instance();
          $pluginObj = $manager->findByIdentifier($this->code);
  
          if ($pluginObj) {
              $pluginInfo = $pluginObj->pluginDetails();
              foreach ($pluginInfo as $attribute => $info) {
                  if (property_exists($this, $attribute)) {
                      $this->{$attribute} = Lang::get($info);
                  }
              }
  
              if ($this->is_disabled) {
                  $manager->disablePlugin($this->code, true);
              }
              else {
                  $manager->enablePlugin($this->code, true);
              }
  
              $this->disabledBySystem = $pluginObj->disabled;
  
              if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) {
                  $this->disabledByConfig = in_array($this->code, $configDisabled);
              }
          }
          else {
              $this->name = $this->code;
              $this->description = Lang::get('system::lang.plugins.unknown_plugin');
              $this->orphaned = true;
          }
      }
code_tokens: public function afterFetch ( ) { /*
           * Override the database columns with the plugin details
           * found in the plugin registration file.
           */ $ manager = PluginManager :: instance ( ) ; $ pluginObj = $ manager -> findByIdentifier ( $ this -> code ) ; if ( $ pluginObj ) { $ pluginInfo = $ pluginObj -> pluginDetails ( ) ; foreach ( $ pluginInfo as $ attribute => $ info ) { if ( property_exists ( $ this , $ attribute ) ) { $ this -> { $ attribute } = Lang :: get ( $ info ) ; } } if ( $ this -> is_disabled ) { $ manager -> disablePlugin ( $ this -> code , true ) ; } else { $ manager -> enablePlugin ( $ this -> code , true ) ; } $ this -> disabledBySystem = $ pluginObj -> disabled ; if ( ( $ configDisabled = Config :: get ( 'cms.disablePlugins' ) ) && is_array ( $ configDisabled ) ) { $ this -> disabledByConfig = in_array ( $ this -> code , $ configDisabled ) ; } } else { $ this -> name = $ this -> code ; $ this -> description = Lang :: get ( 'system::lang.plugins.unknown_plugin' ) ; $ this -> orphaned = true ; } }
docstring: After the model is populated
docstring_tokens: After the model is populated