profile_id = $user->id; $oau->application_id = $app->id; $oau->limit(1); $result = $oau->find(true); return empty($result) ? null : $oau; } }