Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Obadiah\Prayer;
namespace Obadiah\AddressBook;

use Obadiah\App;

Expand All @@ -11,13 +11,15 @@ class Person
/**
* Create Person object.
*
* @param string $first_name Person's first name.
* @param string $last_name Person's last name.
* @param int $id ChurchSuite ID.
* @param string $first_name First name.
* @param string $last_name Last name.
* @param bool $is_child Whether or not this person is a child.
* @param ?string $image_url Optional URL to the person's photo (if they have uploaded one).
* @return void
*/
public function __construct(
public readonly int $id,
public readonly string $first_name,
public readonly string $last_name,
public readonly bool $is_child,
Expand Down
3 changes: 1 addition & 2 deletions src/classes/cache/cache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
namespace Obadiah\Cache;

use Obadiah\App;
use Obadiah\AddressBook\Person;
use Obadiah\Bible\Bible_Plan;
use Obadiah\Calendar\Event;
use Obadiah\ChurchSuite\Api;
use Obadiah\Helpers\Hash;
use Obadiah\Helpers\IO;
use Obadiah\Helpers\Serialise;
use Obadiah\Lectionary\Lectionary;
use Obadiah\Prayer\Person;
use Obadiah\Refresh\Refresh;
use Obadiah\Request\Request;
use Obadiah\Rota\Rota;
use SplFileInfo;

Expand Down
5 changes: 3 additions & 2 deletions src/classes/churchsuite/api.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Obadiah\ChurchSuite;

use Obadiah\App;
use Obadiah\AddressBook\Person;
use Obadiah\Config\Config as C;
use Obadiah\Helpers\Arr;
use Obadiah\Helpers\Curl;
use Obadiah\Helpers\Hash;
use Obadiah\Prayer\Person;
use Obadiah\Prayer\Prayer_Calendar;

App::check();
Expand All @@ -28,7 +28,7 @@ class Api
*/
public function __construct()
{
$this->version = "v1";
$this->version = "v2";
}

/**
Expand Down Expand Up @@ -97,6 +97,7 @@ private function get_people(string $endpoint, string $kind, bool $are_children):
foreach ($response[$kind] as $person) {
$thumb_url = Arr::get(Arr::get(Arr::get($person, "images", []), "md", []), "url");
$person = new Person(
id: Arr::get_integer($person, "id"),
first_name: Arr::get($person, "first_name"),
last_name: Arr::get($person, "last_name"),
is_child: $are_children,
Expand Down
28 changes: 28 additions & 0 deletions src/classes/cli/commands/migrate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Obadiah\Cli\Commands;

use Obadiah\App;
use Obadiah\Cli\Command;

App::check();

class Migrate extends Command
{
/**
* Create command.
*
* @return void
*/
public function __construct() {}

/**
* Migrate to the latest version.
*
* @return void
*/
public function execute(): void
{

}
}
4 changes: 2 additions & 2 deletions src/classes/helpers/hash.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Obadiah\Helpers;

use Obadiah\App;
use Obadiah\Prayer\Person;
use Obadiah\AddressBook\Person;
use Obadiah\Rota\Combined_Service;

App::check();
Expand All @@ -29,7 +29,7 @@ public static function events_query(string $query): string
*/
public static function person(Person $person): string
{
return md5($person->get_full_name());
return md5(sprintf("%s-%s",$person->id, $person->get_full_name(false)));
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/classes/prayer/prayer-calendar.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use DateTimeImmutable;
use Obadiah\App;
use Obadiah\AddressBook\Person;
use Obadiah\Cache\Cache;
use Obadiah\Config\Config as C;
use Obadiah\Helpers\Arr;
Expand Down
2 changes: 1 addition & 1 deletion src/classes/refresh/day.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

use DateTimeImmutable;
use Obadiah\App;
use Obadiah\AddressBook\Person;
use Obadiah\Bible\Day as Readings;
use Obadiah\Cache\Cache;
use Obadiah\Calendar\Event;
use Obadiah\Config\Config as C;
use Obadiah\Helpers\Arr;
use Obadiah\Helpers\Psalms;
use Obadiah\Prayer\Person;

App::check();

Expand Down
2 changes: 1 addition & 1 deletion src/pages/prayer/person-part.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Obadiah\Pages\Prayer;

use Obadiah\App;
use Obadiah\AddressBook\Person;
use Obadiah\Cache\Cache;
use Obadiah\Helpers\Hash;
use Obadiah\Prayer\Person;

App::check();

Expand Down
2 changes: 1 addition & 1 deletion src/pages/refresh/index-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace Obadiah\Pages\Refresh;

use Obadiah\App;
use Obadiah\AddressBook\Person;
use Obadiah\Cache\Cache;
use Obadiah\Config\Config as C;
use Obadiah\Helpers\Image;
use Obadiah\Helpers\Psalms;
use Obadiah\Pages\Parts\Header\Header_Model;
use Obadiah\Prayer\Person;
use Obadiah\Request\Request;
use Obadiah\Response\View;

Expand Down
Loading