namespace Friendica\Factory\Api\Friendica;
use Friendica\BaseFactory;
-use Friendica\Database\DBA;
+use Friendica\Database\Database;
use Friendica\Network\HTTPException;
use Psr\Log\LoggerInterface;
use Friendica\Factory\Api\Twitter\User as TwitterUser;
{
/** @var twitterUser entity */
private $twitterUser;
+ /** @var Database */
+ private $database;
- public function __construct(LoggerInterface $logger, TwitterUser $twitteruser)
+ public function __construct(LoggerInterface $logger, TwitterUser $twitteruser, Database $dba)
{
parent::__construct($logger);
$this->twitterUser = $twitteruser;
+ $this->dba = $dba;
}
/**
*/
public function createFromId(int $id): array
{
- $group = DBA::selectFirst('group', [], ['id' => $id, 'deleted' => false]);
+ $group = $this->dba->selectFirst('group', [], ['id' => $id, 'deleted' => false]);
if (empty($group)) {
return [];
}
namespace Friendica\Module\Api\Friendica\Group;
use Friendica\Database\DBA;
-use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Module\BaseApi;
use Friendica\Network\HTTPException;
if (!empty($photo)) {
$data = ['photo' => $this->friendicaPhoto->createFromId($photo['resource_id'], null, $uid, $type)];
$this->response->exit('photo_create', $data, $this->parameters['extension'] ?? null);
- return;
} else {
throw new HTTPException\InternalServerErrorException('unknown error - uploading photo failed, see Friendica log for more information');
}