Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BackendModel.php
Go to the documentation of this file.
1 <?php
8 
11 
17 class BackendModel extends Value
18 {
20  const MAX_LIFETIME = 31536000;
21 
23  const MIN_LIFETIME = 60;
24 
28  public function beforeSave()
29  {
30  $value = (int)$this->getValue();
31  if ($value > self::MAX_LIFETIME) {
32  throw new LocalizedException(
33  __(
34  'The Admin session lifetime is invalid. '
35  . 'Set the lifetime to 31536000 seconds (one year) or shorter and try again.'
36  )
37  );
38  } elseif ($value < self::MIN_LIFETIME) {
39  throw new LocalizedException(
40  __('The Admin session lifetime is invalid. Set the lifetime to 60 seconds or longer and try again.')
41  );
42  }
43  return parent::beforeSave();
44  }
45 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
__()
Definition: __.php:13
$value
Definition: gender.phtml:16