diff --git a/config/sql/se/ArtistAlternateSpellings.sql b/config/sql/se/ArtistAlternateNames.sql similarity index 82% rename from config/sql/se/ArtistAlternateSpellings.sql rename to config/sql/se/ArtistAlternateNames.sql index 531bf005..1b6f6bec 100644 --- a/config/sql/se/ArtistAlternateSpellings.sql +++ b/config/sql/se/ArtistAlternateNames.sql @@ -1,4 +1,4 @@ -CREATE TABLE `ArtistAlternateSpellings` ( +CREATE TABLE `ArtistAlternateNames` ( `ArtistId` int(10) unsigned NOT NULL, `Name` varchar(255) NOT NULL, `UrlName` varchar(255) NOT NULL, diff --git a/lib/Artist.php b/lib/Artist.php index 8bcd709a..7ced9854 100644 --- a/lib/Artist.php +++ b/lib/Artist.php @@ -4,8 +4,8 @@ use function Safe\date; /** * @property string $UrlName - * @property array $AlternateSpellings - * @property array $_AlternateSpellings + * @property array $AlternateNames + * @property array $_AlternateNames */ class Artist extends PropertiesBase{ public ?int $ArtistId = null; @@ -14,7 +14,7 @@ class Artist extends PropertiesBase{ public ?datetime $Created = null; public ?datetime $Updated = null; protected ?string $_UrlName = null; - protected $_AlternateSpellings; + protected $_AlternateNames; // ******* // GETTERS @@ -35,22 +35,22 @@ class Artist extends PropertiesBase{ /** * @return array */ - protected function GetAlternateSpellings(): array{ - if($this->_AlternateSpellings === null){ - $this->_AlternateSpellings = []; + protected function GetAlternateNames(): array{ + if($this->_AlternateNames === null){ + $this->_AlternateNames = []; $result = Db::Query(' SELECT * - from ArtistAlternateSpellings + from ArtistAlternateNames where ArtistId = ? ', [$this->ArtistId]); foreach($result as $row){ - $this->_AlternateSpellings[] = $row->Name; + $this->_AlternateNames[] = $row->Name; } } - return $this->_AlternateSpellings; + return $this->_AlternateNames; } // ******* @@ -120,9 +120,9 @@ class Artist extends PropertiesBase{ $result = Db::Query(' SELECT a.* from Artists a - left outer join ArtistAlternateSpellings aas using (ArtistId) + left outer join ArtistAlternateNames aan using (ArtistId) where a.UrlName = ? - or aas.UrlName = ? + or aan.UrlName = ? limit 1 ', [$artist->UrlName, $artist->UrlName], 'Artist'); @@ -143,7 +143,7 @@ class Artist extends PropertiesBase{ ', [$this->ArtistId]); Db::Query(' DELETE - from ArtistAlternateSpellings + from ArtistAlternateNames where ArtistId = ? ', [$this->ArtistId]); } @@ -157,7 +157,7 @@ class Artist extends PropertiesBase{ '); Db::Query(' DELETE - from ArtistAlternateSpellings + from ArtistAlternateNames where ArtistId NOT IN (SELECT DISTINCT ArtistId FROM Artworks) '); diff --git a/lib/Artwork.php b/lib/Artwork.php index 91c24e3b..5504daf2 100644 --- a/lib/Artwork.php +++ b/lib/Artwork.php @@ -822,7 +822,7 @@ class Artwork extends PropertiesBase{ $searchString = $this->Name; $searchString .= ' ' . $this->Artist->Name; - $searchString .= ' ' . implode(' ', $this->Artist->AlternateSpellings); + $searchString .= ' ' . implode(' ', $this->Artist->AlternateNames); foreach($this->Tags as $tag){ $searchString .= ' ' . $tag->Name; diff --git a/templates/ArtworkForm.php b/templates/ArtworkForm.php index a70f1911..df2a957a 100644 --- a/templates/ArtworkForm.php +++ b/templates/ArtworkForm.php @@ -21,8 +21,8 @@ $now = new DateTime('now', new DateTimeZone('America/Juneau')); // Latest contin - AlternateSpellings as $alternateSpelling){ ?> - + AlternateNames as $alternateName){ ?> + diff --git a/www/artworks/get.php b/www/artworks/get.php index 427030b1..a780310c 100644 --- a/www/artworks/get.php +++ b/www/artworks/get.php @@ -74,7 +74,7 @@ catch(Exceptions\InvalidPermissionsException){ Artist - Artist->Name) ?>Artist->AlternateSpellings) > 0){ ?> (A.K.A. , ', array_map('Formatter::EscapeHtml', $artwork->Artist->AlternateSpellings)) ?>)Artist->DeathYear !== null){ ?> (d. Artist->DeathYear ?>) + Artist->Name) ?>Artist->AlternateNames) > 0){ ?> (A.K.A. , ', array_map('Formatter::EscapeHtml', $artwork->Artist->AlternateNames)) ?>)Artist->DeathYear !== null){ ?> (d. Artist->DeathYear ?>)