mirror of
https://github.com/friendica/friendica
synced 2025-02-22 22:38:14 +00:00
Extract App::setContactId() and App::getContactId() into AppHelper
This commit is contained in:
parent
94b4009397
commit
c0bd3b5ff0
2 changed files with 26 additions and 9 deletions
10
src/App.php
10
src/App.php
|
@ -61,9 +61,7 @@ class App
|
||||||
'videoheight' => 350,
|
'videoheight' => 350,
|
||||||
];
|
];
|
||||||
|
|
||||||
private $timezone = '';
|
|
||||||
private $profile_owner = 0;
|
private $profile_owner = 0;
|
||||||
private $contact_id = 0;
|
|
||||||
private $queue = [];
|
private $queue = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -151,22 +149,26 @@ class App
|
||||||
/**
|
/**
|
||||||
* Set the contact ID
|
* Set the contact ID
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setContactId() instead
|
||||||
|
*
|
||||||
* @param int $contact_id
|
* @param int $contact_id
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setContactId(int $contact_id)
|
public function setContactId(int $contact_id)
|
||||||
{
|
{
|
||||||
$this->contact_id = $contact_id;
|
DI::apphelper()->setContactId($contact_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the contact ID
|
* Get the contact ID
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getContactId() instead
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getContactId(): int
|
public function getContactId(): int
|
||||||
{
|
{
|
||||||
return $this->contact_id;
|
return DI::apphelper()->getContactId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,13 +24,14 @@ final class AppHelper
|
||||||
{
|
{
|
||||||
private $timezone = '';
|
private $timezone = '';
|
||||||
|
|
||||||
|
private $contact_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the timezone
|
* Set the timezone
|
||||||
*
|
*
|
||||||
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
|
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setTimeZone(string $timezone)
|
public function setTimeZone(string $timezone): void
|
||||||
{
|
{
|
||||||
$this->timezone = (new DateTimeZone($timezone))->getName();
|
$this->timezone = (new DateTimeZone($timezone))->getName();
|
||||||
|
|
||||||
|
@ -38,12 +39,26 @@ final class AppHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the timezone
|
* Get the timezone name
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
*/
|
||||||
public function getTimeZone(): string
|
public function getTimeZone(): string
|
||||||
{
|
{
|
||||||
return $this->timezone;
|
return $this->timezone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the contact ID
|
||||||
|
*/
|
||||||
|
public function setContactId(int $contact_id): void
|
||||||
|
{
|
||||||
|
$this->contact_id = $contact_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the contact ID
|
||||||
|
*/
|
||||||
|
public function getContactId(): int
|
||||||
|
{
|
||||||
|
return $this->contact_id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue