-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e2dfc9
commit 406eff5
Showing
12 changed files
with
53 additions
and
0 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 |
---|---|---|
|
@@ -580,6 +580,10 @@ public function __construct(?string $wwwFilesystemPath = null){ | |
// METHODS | ||
// ******* | ||
|
||
/** | ||
* @throws \Exception | ||
* @throws \Exceptions\ValidationException | ||
*/ | ||
public function Validate(): void{ | ||
This comment has been minimized.
Sorry, something went wrong. |
||
$now = new DateTimeImmutable(); | ||
$error = new Exceptions\ValidationException(); | ||
|
@@ -739,6 +743,9 @@ public function Validate(): void{ | |
} | ||
} | ||
|
||
/** | ||
* @throws \Exception | ||
This comment has been minimized.
Sorry, something went wrong.
acabal
Member
|
||
*/ | ||
public function CreateOrUpdate(): void{ | ||
try{ | ||
$existingEbook = Ebook::GetByIdentifier($this->Identifier); | ||
|
@@ -750,6 +757,9 @@ public function CreateOrUpdate(): void{ | |
} | ||
} | ||
|
||
/** | ||
* @throws \Exceptions\ValidationException | ||
*/ | ||
private function InsertTagStrings(): void{ | ||
$tags = []; | ||
foreach($this->Tags as $ebookTag){ | ||
|
@@ -758,6 +768,9 @@ private function InsertTagStrings(): void{ | |
$this->Tags = $tags; | ||
} | ||
|
||
/** | ||
* @throws \Exceptions\ValidationException | ||
*/ | ||
private function InsertLocSubjectStrings(): void{ | ||
$subjects = []; | ||
foreach($this->LocSubjects as $locSubject){ | ||
|
@@ -1089,6 +1102,9 @@ public static function GetByIdentifier(?string $identifier): Ebook{ | |
return $result[0]; | ||
} | ||
|
||
/** | ||
* @throws \Exception | ||
*/ | ||
public function Create(): void{ | ||
$this->Validate(); | ||
|
||
|
@@ -1140,6 +1156,9 @@ public function Create(): void{ | |
$this->InsertTocEntries(); | ||
} | ||
|
||
/** | ||
* @throws \Exception | ||
*/ | ||
public function Save(): void{ | ||
$this->Validate(); | ||
|
||
|
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
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
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
If you added
\Exception
because PHPStancalims thatDateTimeImmutable
throws an exception, then this is actually a bug in Safe: thecodingmachine/safe#444 You can use the workaround there instead of adding this generic exception annotation.