Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StringBinary.php
Go to the documentation of this file.
1 <?php
7 
9 
16 {
20  const DEFAULT_TEXT_LENGTH = 255;
21 
25  private $objectManager;
26 
30  private $className;
31 
38  public function __construct(
39  ObjectManagerInterface $objectManager,
40  $className = \Magento\Framework\Setup\Declaration\Schema\Dto\Columns\StringBinary::class
41  ) {
42  $this->objectManager = $objectManager;
43  $this->className = $className;
44  }
45 
49  public function create(array $data)
50  {
51  $data['length'] = isset($data['length']) ? (int) $data['length'] : self::DEFAULT_TEXT_LENGTH;
52  return $this->objectManager->create($this->className, $data);
53  }
54 }
$objectManager
Definition: bootstrap.php:17
__construct(ObjectManagerInterface $objectManager, $className=\Magento\Framework\Setup\Declaration\Schema\Dto\Columns\StringBinary::class)