Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HasOptionalParameters.php
Go to the documentation of this file.
1 <?php
7 
9 {
12 
16  private $optionalObjectParameter;
17 
21  private $optionalStringParameter;
22 
26  private $optionalIntegerParameter;
27 
31  private $optionalInterfaceParameter;
32 
36  private $requiredInterfaceParam;
37 
41  private $requiredObjectParameter;
42 
51  public function __construct(
52  TestAssetInterface $requiredInterfaceParameter,
53  Basic $requiredObjectParameter,
54  TestAssetInterface $optionalInterfaceParameter = null,
55  Basic $optionalObjectParameter = null,
56  $optionalStringParameter = self::CONSTRUCTOR_STRING_PARAM_DEFAULT,
57  $optionalIntegerParameter = self::CONSTRUCTOR_INT_PARAM_DEFAULT
58  ) {
59  $this->optionalObjectParameter = $optionalObjectParameter;
60  $this->optionalStringParameter = $optionalStringParameter;
61  $this->optionalIntegerParameter = $optionalIntegerParameter;
62  $this->optionalInterfaceParameter = $optionalInterfaceParameter;
63  $this->requiredInterfaceParam = $requiredInterfaceParameter;
64  $this->requiredObjectParameter = $requiredObjectParameter;
65  }
66 
70  public function getOptionalObjectParameter()
71  {
72  return $this->optionalObjectParameter;
73  }
74 
78  public function getOptionalStringParameter()
79  {
80  return $this->optionalStringParameter;
81  }
82 
86  public function getOptionalIntegerParameter()
87  {
88  return $this->optionalIntegerParameter;
89  }
90 
95  {
96  return $this->optionalInterfaceParameter;
97  }
98 
102  public function getRequiredInterfaceParam()
103  {
104  return $this->requiredInterfaceParam;
105  }
106 
110  public function getRequiredObjectParameter()
111  {
112  return $this->requiredObjectParameter;
113  }
114 }
__construct(TestAssetInterface $requiredInterfaceParameter, Basic $requiredObjectParameter, TestAssetInterface $optionalInterfaceParameter=null, Basic $optionalObjectParameter=null, $optionalStringParameter=self::CONSTRUCTOR_STRING_PARAM_DEFAULT, $optionalIntegerParameter=self::CONSTRUCTOR_INT_PARAM_DEFAULT)