芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/invoicer.pulsehost.co.uk/vendor/ArrayResult.php
> $data */ public function __construct(private array $data) { $this->columnCount = $data === [] ? 0 : count($data[0]); } public function fetchNumeric(): array|false { $row = $this->fetch(); if ($row === false) { return false; } return array_values($row); } public function fetchAssociative(): array|false { return $this->fetch(); } public function fetchOne(): mixed { $row = $this->fetch(); if ($row === false) { return false; } return reset($row); } /** * {@inheritDoc} */ public function fetchAllNumeric(): array { return FetchUtils::fetchAllNumeric($this); } /** * {@inheritDoc} */ public function fetchAllAssociative(): array { return FetchUtils::fetchAllAssociative($this); } /** * {@inheritDoc} */ public function fetchFirstColumn(): array { return FetchUtils::fetchFirstColumn($this); } public function rowCount(): int { return count($this->data); } public function columnCount(): int { return $this->columnCount; } public function free(): void { $this->data = []; } /** @return array
|false */ private function fetch(): array|false { if (! isset($this->data[$this->num])) { return false; } return $this->data[$this->num++]; } }