/** * Constructor * * @param array $data * @throws \InvalidArgumentException */ public function __construct(array $data) { $this->data = [self::KEY_PREFIX => '', 'connection' => ['default' => [self::KEY_HOST => '', self::KEY_NAME => '', self::KEY_USER => '', self::KEY_PASS => '', self::KEY_MODEL => 'mysql4', self::KEY_INIT_STATEMENTS => 'SET NAMES utf8;', self::KEY_ACTIVE => '1']]]; $data = $this->update($data); $this->checkData($data); parent::__construct($data); }
/** * Constructor * * @param array $data * @throws \InvalidArgumentException */ public function __construct(array $data) { if (!isset($data[self::KEY_ENCRYPTION_KEY])) { throw new \InvalidArgumentException('No encryption key provided'); } parent::__construct($data); }
/** * HNHBK constructor. * @param string $messageLength * @param string $dialogId * @param int $messageNumber */ public function __construct($messageLength, $dialogId, $messageNumber) { if (strlen($messageLength) != 12) { $messageLength = str_pad((int) $messageLength + static::HEADER_LENGTH + strlen($dialogId) + strlen($messageNumber), 12, '0', STR_PAD_LEFT); } parent::__construct(static::NAME, 1, static::VERSION, array($messageLength, 300, $dialogId, $messageNumber)); }
/** * @param AbstractSegment $that * @return integer|double Negative is this is smaller, positive if that is smaller, or 0 if equals. */ public function compare(AbstractSegment $that) { $thoseElements = count($that->elements); $theseElements = count($this->elements); if (!$thoseElements || !$theseElements) { return count($that->elements) - count($this->elements); } elseif ($thoseElements > $theseElements) { return -$that->compare($this); } foreach ($this->elements as $key => $value) { if ($result = $this->compareElements($value, $that[$key])) { return $result; } } return 0; }
/** * Constructor * * @param array $data * @throws \InvalidArgumentException */ public function __construct(array $data) { if (!isset($data[self::KEY_DATE])) { throw new \InvalidArgumentException('Install date not provided'); } parent::__construct($data); }
/** * Constructor * * @param array $data * @throws \InvalidArgumentException */ public function __construct(array $data = []) { $this->data = ['default_setup' => [self::KEY_CONNECTION => 'default']]; if (!$this->validate($data)) { throw new \InvalidArgumentException('Invalid resource configuration.'); } parent::__construct($this->update($data)); }
/** * Constructor * * @param array $data * @throws \InvalidArgumentException */ public function __construct(array $data) { if (!isset($data[self::KEY_SAVE])) { $data = [self::KEY_SAVE => 'files']; } elseif ($data[self::KEY_SAVE] !== 'files' && $data[self::KEY_SAVE] !== 'db') { throw new \InvalidArgumentException("Invalid session_save location {$data[self::KEY_SAVE]}"); } parent::__construct($data); }
/** * Constructor * * @param array $data * @throws \InvalidArgumentException */ public function __construct(array $data) { if (empty($data[self::KEY_FRONTNAME])) { throw new \InvalidArgumentException("No backend frontname provided."); } if (!preg_match('/^[a-zA-Z0-9_]+$/', $data[self::KEY_FRONTNAME])) { throw new \InvalidArgumentException("Invalid backend frontname {$data[self::KEY_FRONTNAME]}"); } parent::__construct($data); }
/** * {@inheritdoc} */ protected function formatRemoveSegment($data) { return array_map('urldecode', parent::formatRemoveSegment($data)); }
/** * HKSYN constructor. * @param int $segmentNumber * @param int $syncMode */ public function __construct($segmentNumber, $syncMode = self::SYNC_MODE_NEW_CUSTOMER_ID) { parent::__construct(static::NAME, $segmentNumber, static::VERSION, array($syncMode)); }
/** * Constructor * * @param array $data */ public function __construct(array $data) { $this->validate($data); parent::__construct($data); }
/** * HKVVB constructor. * @param int $segmentNumber * @param int $bpdVersion * @param int $updVersion * @param int $dialogLanguage * @param string $productName * @param string $productVersion */ public function __construct($segmentNumber, $bpdVersion = self::DEFAULT_BPD_VERSION, $updVersion = self::DEFAULT_UPD_VERSION, $dialogLanguage = self::LANG_DEFAULT, $productName = self::DEFAULT_PRODUCT_NAME, $productVersion = self::DEFAULT_PRODUCT_VERSION) { parent::__construct(static::NAME, $segmentNumber, static::VERSION, array($bpdVersion, $updVersion, $dialogLanguage, $productName, $productVersion)); }
/** * HKSAL constructor. * @param int $version * @param int $segmentNumber * @param mixed $ktv * @param array $allAccounts */ public function __construct($version, $segmentNumber, $ktv, $allAccounts) { parent::__construct(static::NAME, $segmentNumber, $version, array($ktv, $allAccounts)); }
/** * HKEND constructor. * @param $segmentNumber * @param $dialogId */ public function __construct($segmentNumber, $dialogId) { parent::__construct(static::NAME, $segmentNumber, static::VERSION, array($dialogId)); }