summaryrefslogtreecommitdiffstats
path: root/lib/Db
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-11-29 16:41:55 -0100
committerMaxence Lange <maxence@artificial-owl.com>2018-11-29 16:41:55 -0100
commitc005273e1f2a5226a3099a698f789b1de6502c2a (patch)
tree749fa00c67ad1e525fed3e8b851a38dcf1f283c0 /lib/Db
parentaaafa82b4b8e1e3ec7e58abb2246e71de3e855b8 (diff)
generate details on account info
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Db')
-rw-r--r--lib/Db/CacheActorsRequest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Db/CacheActorsRequest.php b/lib/Db/CacheActorsRequest.php
index d247396b..7887ad12 100644
--- a/lib/Db/CacheActorsRequest.php
+++ b/lib/Db/CacheActorsRequest.php
@@ -154,6 +154,32 @@ class CacheActorsRequest extends CacheActorsRequestBuilder {
/**
+ * get Cached version of a local Actor, based on the preferred username
+ *
+ * @param string $account
+ *
+ * @return Person
+ * @throws CacheActorDoesNotExistException
+ */
+ public function getFromLocalAccount(string $account): Person {
+ $qb = $this->getCacheActorsSelectSql();
+ $this->limitToPreferredUsername($qb, $account);
+ $this->limitToLocal($qb, true);
+ $this->leftJoinCacheDocuments($qb, 'icon_id');
+
+ $cursor = $qb->execute();
+ $data = $cursor->fetch();
+ $cursor->closeCursor();
+
+ if ($data === false) {
+ throw new CacheActorDoesNotExistException();
+ }
+
+ return $this->parseCacheActorsSelectSql($data);
+ }
+
+
+ /**
* @param string $search
*
* @return Person[]