Same name in other branches
  1. 5.0.x src/Form/AdvaggFormBase.php \Drupal\advagg\Form\AdvaggFormBase
  2. 6.0.x src/Form/AdvaggFormBase.php \Drupal\advagg\Form\AdvaggFormBase
  3. 8.x-3.x src/Form/AdvaggFormBase.php \Drupal\advagg\Form\AdvaggFormBase
  4. 8.x-4.x src/Form/AdvaggFormBase.php \Drupal\advagg\Form\AdvaggFormBase

View AdvAgg information for this site.

Hierarchy

  • class \Drupal\advagg\Form\AdvaggFormBase extends \Drupal\Core\Form\ConfigFormBase

Expanded class hierarchy of AdvaggFormBase

1 file declares its use of AdvaggFormBase
BaseValidatorForm.php in advagg_validator/src/Form/BaseValidatorForm.php

File

src/Form/AdvaggFormBase.php, line 15

Namespace

Drupal\advagg\Form
View source
abstract class AdvaggFormBase extends ConfigFormBase {
    
    /**
     * The AdvAgg file status state information storage service.
     *
     * @var \Drupal\Core\State\StateInterface
     */
    protected $advaggFiles;
    
    /**
     * The AdvAgg aggregates state information storage service.
     *
     * @var \Drupal\Core\State\StateInterface
     */
    protected $advaggAggregates;
    
    /**
     * The request stack.
     *
     * @var \Symfony\Component\HttpFoundation\RequestStack
     */
    protected $requestStack;
    
    /**
     * Constructs a SettingsForm object.
     *
     * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
     *   The factory for configuration objects.
     * @param \Drupal\Core\State\StateInterface $advagg_files
     *   The AdvAgg file status state information storage service.
     * @param \Drupal\Core\State\StateInterface $advagg_aggregates
     *   The AdvAgg aggregate state information storage service.
     * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
     *   The request stack.
     */
    public function __construct(ConfigFactoryInterface $config_factory, StateInterface $advagg_files, StateInterface $advagg_aggregates, RequestStack $request_stack) {
        parent::__construct($config_factory);
        $this->advaggFiles = $advagg_files;
        $this->advaggAggregates = $advagg_aggregates;
        $this->requestStack = $request_stack;
    }
    
    /**
     * {@inheritdoc}
     */
    public static function create(ContainerInterface $container) {
        return new static($container->get('config.factory'), $container->get('state.advagg.files'), $container->get('state.advagg.aggregates'), $container->get('request_stack'));
    }
    
    /**
     * Checks if the form was submitted by AJAX.
     *
     * @return bool
     *   TRUE if the form was submitted via AJAX, otherwise FALSE.
     */
    protected function isAjax() {
        $request = $this->requestStack
            ->getCurrentRequest();
        if ($request->query
            ->has(FormBuilderInterface::AJAX_FORM_REQUEST)) {
            return TRUE;
        }
        return FALSE;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
AdvaggFormBase::$advaggAggregates protected property The AdvAgg aggregates state information storage service.
AdvaggFormBase::$advaggFiles protected property The AdvAgg file status state information storage service.
AdvaggFormBase::$requestStack protected property The request stack.
AdvaggFormBase::create public static function 1
AdvaggFormBase::isAjax protected function Checks if the form was submitted by AJAX.
AdvaggFormBase::__construct public function Constructs a SettingsForm object. 1