diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-10 15:24:51 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-14 21:21:16 +0200 |
commit | a17c5b5f05ca4c7cf4f0d0d640f95ae283b1796a (patch) | |
tree | 4ece4b944cae0316eed272a2f44b304142a4d912 /includes/venue.php | |
parent | 558544fcef3335216d225bb587129a424db8d7af (diff) | |
download | gigologadmin-a17c5b5f05ca4c7cf4f0d0d640f95ae283b1796a.tar.gz gigologadmin-a17c5b5f05ca4c7cf4f0d0d640f95ae283b1796a.tar.bz2 gigologadmin-a17c5b5f05ca4c7cf4f0d0d640f95ae283b1796a.zip |
Use (object) notation to create plain objects.
Diffstat (limited to 'includes/venue.php')
-rw-r--r-- | includes/venue.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/includes/venue.php b/includes/venue.php index 9b4a3af..896f448 100644 --- a/includes/venue.php +++ b/includes/venue.php @@ -1,5 +1,4 @@ <?php - // SPDX-FileCopyrightText: 2021 Andrea Chirulescu <andrea.chirulescu@gmail.com> // SPDX-FileCopyrightText: 2021 Harald Eilertsen <haraldei@anduin.net> // @@ -30,11 +29,11 @@ if ( !class_exists('GiglogAdmin_Venue') ) { } static function create($name,$city) - { if(empty($city)) $city='Oslo'; - $attrs = new stdClass(); - $attrs->wpgvenue_name = $name; - $attrs->wpgvenue_city = $city; - $venue = new GiglogAdmin_Venue($attrs); + { + $venue = new GiglogAdmin_Venue((object) [ + 'wpgvenue_name' => $name, + 'wpgvenue_city' => !empty($city) ? $city : 'Oslo', + ]); $venue->save(); return $venue; |