Source of file SingleBarcodesDefinition.php
Size: 3,536 Bytes - Last Modified: 2019-01-11T00:06:01+01:00
/Users/sylvainraye/Sites/git/swisspost/src/StructType/SingleBarcodesDefinition.php
| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 | <?phpnamespace Diglin\Swisspost\StructType; use \WsdlToPhp\PackageBase\AbstractStructBase; /** * This class stands for SingleBarcodesDefinition StructType * @subpackage Structs * @date 2019/01/11 * @codeVersion 1.0.0 */class SingleBarcodesDefinition extends AbstractStructBase {/** * The ImageFileType * Meta informations extracted from the WSDL * - documentation: Defines valid formats of images. * - pattern: [a-zA-Z,0-9]{1,5} * @var string */public $ImageFileType; /** * The ImageResolution * @var int */public $ImageResolution; /** * Constructor method for SingleBarcodesDefinition * @uses SingleBarcodesDefinition::setImageFileType() * @uses SingleBarcodesDefinition::setImageResolution() * @param string $imageFileType * @param int $imageResolution */public function __construct($imageFileType = null, $imageResolution = null) { $this ->setImageFileType($imageFileType) ->setImageResolution($imageResolution); } /** * Get ImageFileType value * @return string|null */public function getImageFileType() { return $this->ImageFileType; } /** * Set ImageFileType value * @param string $imageFileType * @return \Diglin\Swisspost\StructType\SingleBarcodesDefinition */public function setImageFileType($imageFileType = null) { // validation for constraint: pattern if (is_scalar($imageFileType) && !preg_match('/[a-zA-Z,0-9]{1,5}/', $imageFileType)) { throw new \InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches "[a-zA-Z,0-9]{1,5}", "%s" given', var_export($imageFileType, true)), __LINE__); } // validation for constraint: string if (!is_null($imageFileType) && !is_string($imageFileType)) { throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($imageFileType)), __LINE__); } $this->ImageFileType = $imageFileType; return $this; } /** * Get ImageResolution value * @return int|null */public function getImageResolution() { return $this->ImageResolution; } /** * Set ImageResolution value * @param int $imageResolution * @return \Diglin\Swisspost\StructType\SingleBarcodesDefinition */public function setImageResolution($imageResolution = null) { // validation for constraint: int if (!is_null($imageResolution) && !is_numeric($imageResolution)) { throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($imageResolution)), __LINE__); } $this->ImageResolution = $imageResolution; return $this; } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values * @see AbstractStructBase::__set_state() * @uses AbstractStructBase::__set_state() * @param array $array the exported values * @return \Diglin\Swisspost\StructType\SingleBarcodesDefinition */public static function __set_state(array $array) { return parent::__set_state($array); } /** * Method returning the class name * @return string __CLASS__ */public function __toString() { return __CLASS__; } } |