mirror of
https://github.com/friendica/friendica
synced 2025-04-27 07:10:12 +00:00
Move Object\Profile to Model\Profile
This commit is contained in:
parent
52bddd580c
commit
d4ca30a6db
5 changed files with 7 additions and 9 deletions
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file src/Object/Profile.php
|
||||
*/
|
||||
|
||||
namespace Friendica\Object;
|
||||
|
||||
use Friendica\BaseObject;
|
||||
|
||||
class Profile extends BaseObject
|
||||
{
|
||||
/**
|
||||
* @brief Returns a formatted location string from the given profile array
|
||||
*
|
||||
* @param array $profile Profile array (Generated from the "profile" table)
|
||||
*
|
||||
* @return string Location string
|
||||
*/
|
||||
public static function formatLocation(array $profile)
|
||||
{
|
||||
$location = '';
|
||||
|
||||
if ($profile['locality']) {
|
||||
$location .= $profile['locality'];
|
||||
}
|
||||
|
||||
if ($profile['region'] && ($profile['locality'] != $profile['region'])) {
|
||||
if ($location) {
|
||||
$location .= ', ';
|
||||
}
|
||||
|
||||
$location .= $profile['region'];
|
||||
}
|
||||
|
||||
if ($profile['country-name']) {
|
||||
if ($location) {
|
||||
$location .= ', ';
|
||||
}
|
||||
|
||||
$location .= $profile['country-name'];
|
||||
}
|
||||
|
||||
return $location;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue