Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Sender.php
Go to the documentation of this file.
1 <?php
11 
16 class Sender extends \Magento\Framework\App\Config\Value
17 {
24  public function beforeSave()
25  {
26  $value = $this->getValue();
27  if (!preg_match("/^[\S ]+$/", $value)) {
28  throw new \Magento\Framework\Exception\LocalizedException(
29  __('The sender name "%1" is not valid. Please use only visible characters and spaces.', $value)
30  );
31  }
32 
33  if (strlen($value) > 255) {
34  throw new \Magento\Framework\Exception\LocalizedException(
35  __('Maximum sender name length is 255. Please correct your settings.')
36  );
37  }
38  return $this;
39  }
40 }
__()
Definition: __.php:13
$value
Definition: gender.phtml:16