Commit graph

31 commits

Author SHA1 Message Date
Alex Cabal
fbcafb8f1d Improve type hints 2025-03-27 16:46:05 -05:00
Alex Cabal
5066252355 Use 'insert ... returning' instead of 'Db::GetLastInsertedId()' 2025-03-10 13:03:31 -05:00
Alex Cabal
7f5ffb4aea Use shorthand assignment for basic getters 2025-02-27 16:03:26 -06:00
Mike Colagrosso
f0bfa7a43b Rewrite DeleteUnused() queries using new indices 2024-12-31 22:31:00 -06:00
Mike Colagrosso
d6dd10be9c Clean up unused Tags, LocSubjects, and Collections
On `Ebook::Save()` and `Ebook::Delete()`, remove any unreferenced `Tag`,
`LocSubject`, and `Collection` records. These are analogous to these lines in
`Ebook::Create()`:

```
$this->CreateTags();
$this->CreateLocSubjects();
$this->CreateCollections();
```

`EbookPlaceholder`s can't have `Tags` or `LocSubjects` at the moment, but other
mistakes in production that are later corrected could leave unused `Tags` and
`LocSubjects`.

Context: https://github.com/standardebooks/web/pull/447#issuecomment-2555734692
2024-12-26 12:10:13 -06:00
Alex Cabal
adfe07aad9 Add beginning of a project management system to placeholders 2024-12-14 19:13:03 -06:00
Alex Cabal
23b5c8ef31 Allow admin to view collection metadata 2024-12-14 11:32:02 -06:00
Alex Cabal
cb1cfc8c21 Add accounting bit to Collections table 2024-12-14 00:02:21 -06:00
Alex Cabal
b7b63a4be5 Refactor functions out of Library 2024-11-10 23:05:31 -06:00
Alex Cabal
acb30b897c Add PropertyFromHttp trait and update codebase to use new pattern 2024-11-10 22:23:43 -06:00
Alex Cabal
be5574eaec Move enums into their own namespace 2024-11-08 16:34:21 -06:00
Mike Colagrosso
432723eafe Correct return type and typo in GetUrl() 2024-11-04 13:16:56 -06:00
Mike Colagrosso
85307a7c7e Standardize trim and other validation of nullable and non-nullable properties 2024-11-04 13:16:56 -06:00
Mike Colagrosso
221c2ff347 Validate Collection name 2024-11-04 13:16:56 -06:00
Mike Colagrosso
2273367c6d Collection validation: Pass enum to InvalidCollectionTypeException, not value 2024-11-04 13:16:56 -06:00
Mike Colagrosso
9a4da8f961 Fix PHPStan errors for CollectionType enum
Use the `value` property of PHP enums to get the underlying string for functions that expect a string.

Followup to #392
2024-11-04 13:16:56 -06:00
Mike Colagrosso
b792dec9e5 Make collection type (series, set) an enum 2024-11-04 13:16:56 -06:00
Mike Colagrosso
ee29c526f8 Add a CollectionMembership class 2024-11-04 13:16:56 -06:00
Mike Colagrosso
2098b265a8 Rename the constructor Ebook::__construct() to static Ebook::FromFilesystem()
Also added `GetFoo()` methods for all the derived properties like `GetUrl()`, `GetHasDownloads()`, etc. Removed that logic from the constructor so that it's reusable in `Ebook::FromFilesystem()` and `Ebook::GetByIdentifier()`
2024-11-04 13:16:56 -06:00
Mike Colagrosso
63d411a2e6 Initial code changes to insert/update Ebook records 2024-11-04 13:16:56 -06:00
Alex Cabal
783c09864f Add type hints for remaining classes 2024-01-08 16:08:57 -06:00
Alex Cabal
c95d8c4954 Fix collection sorting in bulk downloads 2022-07-11 11:01:15 -05:00
Alex Cabal
fc1db3a3d4 Break bulk downloads into sections, add authors bulk download, and refactor bulk download generation code 2022-07-10 12:56:28 -05:00
Alex Cabal
9d923605d8 Add database and ORM scaffolding 2021-12-09 13:13:16 -06:00
Alex Cabal
aed7db7fc1 Improve how collections are organized and internally and printed to HTML 2020-05-22 16:22:46 -05:00
Alex Cabal
c8cacc4ace Add series number to collection headline 2020-05-22 16:03:59 -05:00
Alex Cabal
8efec57abd Sort collections by their sequence number 2020-05-21 15:49:48 -05:00
Alex Cabal
986183a83f Remove trailing slashes from URLs 2020-05-02 21:03:22 -05:00
Alex Cabal
def275ab3c Remove closing tags from pure PHP files 2019-04-03 16:25:00 -05:00
Alex Cabal
6f86a1899b Improve tag and collection browsing and pagination 2019-02-26 18:36:26 -06:00
Alex Cabal
cfa54122d6 Add support for tag browsing and collection browsing 2019-02-26 17:05:23 -06:00