get('core'); try { $folder = $appData->getFolder('text2image')->getFolder((string)$this->getId()); $images = []; for ($i = 0; $i < $this->getNumberOfImages(); $i++) { $image = new Image(); $image->loadFromFileHandle($folder->getFile((string)$i)->read()); $images[] = $image; } return $images; } catch (NotFoundException|NotPermittedException) { return null; } } /** * @return int * @since 28.0.0 */ final public function getNumberOfImages(): int { return $this->numberOfImages; } /** * @psalm-return self::STATUS_* * @since 28.0.0 */ final public function getStatus(): int { return $this->status; } /** * @psalm-param self::STATUS_* $status * @since 28.0.0 */ final public function setStatus(int $status): void { $this->status = $status; } /** * @param ?DateTime $at * @since 28.0.0 */ final public function setCompletionExpectedAt(?DateTime $at): void { $this->completionExpectedAt = $at; } /** * @return ?DateTime * @since 28.0.0 */ final public function getCompletionExpectedAt(): ?DateTime { return $this->completionExpectedAt; } /** * @return int|null * @since 28.0.0 */ final public function getId(): ?int { return $this->id; } /** * @param int|null $id * @since 28.0.0 */ final public function setId(?int $id): void { $this->id = $id; } /** * @return string * @since 28.0.0 */ final public function getInput(): string { return $this->input; } /** * @return string * @since 28.0.0 */ final public function getAppId(): string { return $this->appId; } /** * @return null|string * @since 28.0.0 */ final public function getIdentifier(): ?string { return $this->identifier; } /** * @return string|null * @since 28.0.0 */ final public function getUserId(): ?string { return $this->userId; } /** * @psalm-return array{id: ?int, status: self::STATUS_*, userId: ?string, appId: string, input: string, identifier: ?string, numberOfImages: int, completionExpectedAt: ?int} * @since 28.0.0 */ public function jsonSerialize(): array { return [ 'id' => $this->getId(), 'status' => $this->getStatus(), 'userId' => $this->getUserId(), 'appId' => $this->getAppId(), 'numberOfImages' => $this->getNumberOfImages(), 'input' => $this->getInput(), 'identifier' => $this->getIdentifier(), 'completionExpectedAt' => $this->getCompletionExpectedAt()->getTimestamp(), ]; } } 9'>artonge/backport/52121/stable29 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Exceptions/BrokenPath.php
blob: c6676f3cd0cb2f81583f5cc06052c6a8e3966c75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 *
 * @author Björn Schießle <bjoern@schiessle.org>
 * @author Morris Jobke <hey@morrisjobke.de>
 *
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

namespace OCA\Files_Sharing\Exceptions;

/**
 * Expected path with a different root
 * Possible Error Codes:
 * 10 - Path not relative to data/ and point to the users file directory

 */
class BrokenPath extends \Exception {
}