From f1ab2f022fdc780aca0944d90e9a0e844a0820d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:12:17 +0200 Subject: =?UTF-8?q?2024-02-19:=20popravljen=20(prej=C5=A1nji=20commit=20je?= =?UTF-8?q?=20napa=C4=8Den)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/survey/excel/PHPExcel/HashTable.php | 202 ------------------------------ 1 file changed, 202 deletions(-) delete mode 100644 admin/survey/excel/PHPExcel/HashTable.php (limited to 'admin/survey/excel/PHPExcel/HashTable.php') diff --git a/admin/survey/excel/PHPExcel/HashTable.php b/admin/survey/excel/PHPExcel/HashTable.php deleted file mode 100644 index 6011ed5..0000000 --- a/admin/survey/excel/PHPExcel/HashTable.php +++ /dev/null @@ -1,202 +0,0 @@ -addFromSource($pSource); - } - } - - /** - * Add HashTable items from source - * - * @param PHPExcel_IComparable[] $pSource Source array to create HashTable from - * @throws Exception - */ - public function addFromSource($pSource = null) { - // Check if an array was passed - if ($pSource == null) { - return; - } else if (!is_array($pSource)) { - throw new Exception('Invalid array parameter passed.'); - } - - foreach ($pSource as $item) { - $this->add($item); - } - } - - /** - * Add HashTable item - * - * @param PHPExcel_IComparable $pSource Item to add - * @throws Exception - */ - public function add(PHPExcel_IComparable $pSource = null) { - $hash = $pSource->getHashCode(); - if (!isset($this->_items[$hash])) { - $this->_items[$hash] = $pSource; - $this->_keyMap[count($this->_items) - 1] = $hash; - } - } - - /** - * Remove HashTable item - * - * @param PHPExcel_IComparable $pSource Item to remove - * @throws Exception - */ - public function remove(PHPExcel_IComparable $pSource = null) { - $hash = $pSource->getHashCode(); - if (isset($this->_items[$hash])) { - unset($this->_items[$hash]); - - $deleteKey = -1; - foreach ($this->_keyMap as $key => $value) { - if ($deleteKey >= 0) { - $this->_keyMap[$key - 1] = $value; - } - - if ($value == $hash) { - $deleteKey = $key; - } - } - unset($this->_keyMap[count($this->_keyMap) - 1]); - } - } - - /** - * Clear HashTable - * - */ - public function clear() { - $this->_items = array(); - $this->_keyMap = array(); - } - - /** - * Count - * - * @return int - */ - public function count() { - return count($this->_items); - } - - /** - * Get index for hash code - * - * @param string $pHashCode - * @return int Index - */ - public function getIndexForHashCode($pHashCode = '') { - return array_search($pHashCode, $this->_keyMap); - } - - /** - * Get by index - * - * @param int $pIndex - * @return PHPExcel_IComparable - * - */ - public function getByIndex($pIndex = 0) { - if (isset($this->_keyMap[$pIndex])) { - return $this->getByHashCode( $this->_keyMap[$pIndex] ); - } - - return null; - } - - /** - * Get by hashcode - * - * @param string $pHashCode - * @return PHPExcel_IComparable - * - */ - public function getByHashCode($pHashCode = '') { - if (isset($this->_items[$pHashCode])) { - return $this->_items[$pHashCode]; - } - - return null; - } - - /** - * HashTable to array - * - * @return PHPExcel_IComparable[] - */ - public function toArray() { - return $this->_items; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } - } - } -} -- cgit v1.2.3