X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile.php;h=1076fb2cb3e09f8b95b1915b36f1b6bb5ffbcef6;hb=2eadeca74515802dccc63d7ec84af1bc7d1338d9;hp=25d908dbf93c22c1a24fb41cbd5a204d2478e825;hpb=fdb64eed2f1d24ad38fe4a6bc680e3592647c0a6;p=quix0rs-gnu-social.git diff --git a/classes/Profile.php b/classes/Profile.php index 25d908dbf9..1076fb2cb3 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -352,6 +352,31 @@ class Profile extends Memcached_DataObject return $profile; } + function getApplications($offset = 0, $limit = null) + { + $qry = + 'SELECT a.* ' . + 'FROM oauth_application_user u, oauth_application a ' . + 'WHERE u.profile_id = %d ' . + 'AND a.id = u.application_id ' . + 'AND u.access_type > 0 ' . + 'ORDER BY u.created DESC '; + + if ($offset > 0) { + if (common_config('db','type') == 'pgsql') { + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; + } else { + $qry .= ' LIMIT ' . $offset . ', ' . $limit; + } + } + + $application = new Oauth_application(); + + $cnt = $application->query(sprintf($qry, $this->id)); + + return $application; + } + function subscriptionCount() { $c = common_memcache();