-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Return proper result when trying to delete used asset
- Loading branch information
Showing
7 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flowpack\Media\Ui\Domain\Model\Dto; | ||
|
||
use Neos\Flow\Annotations as Flow; | ||
|
||
/** | ||
* @Flow\Proxy(false) | ||
*/ | ||
class MutationResult implements \JsonSerializable | ||
{ | ||
|
||
private bool $success; | ||
private ?array $messages; | ||
private ?array $data; | ||
|
||
public function __construct(bool $success, array $messages = null, array $data = null) | ||
{ | ||
$this->success = $success; | ||
$this->messages = $messages; | ||
$this->data = $data; | ||
} | ||
|
||
public function isSuccess(): bool | ||
{ | ||
return $this->success; | ||
} | ||
|
||
public function getMessages(): ?array | ||
{ | ||
return $this->messages; | ||
} | ||
|
||
public function getData(): ?array | ||
{ | ||
return $this->data; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'success' => $this->success, | ||
'messages' => $this->messages, | ||
'data' => $this->data, | ||
]; | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
return $this->toArray(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
interface MutationResult { | ||
success: boolean; | ||
messages: string[]; | ||
data: any[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters