Josip Codes
Josip Codes

Reputation: 9521

Social Engine get user id from profile page

I'm trying to add some features to the users profile page, and for that I would need that users ID - just to clarify, it's not viewers ID I'm chasing, it's the ID of the user whose profile I'm viewing. So, I used $subject = Engine_Api::_()->core()->getSubject('user'); and it returns a big object full of all kinds of data, but don't know how to extract user ID?

Anyone have a clue? (SocialEngine 4 is the platform I'm using)

Upvotes: 0

Views: 1224

Answers (2)

Coder anonymous
Coder anonymous

Reputation: 927

this will get you the userid of the profile..

$profileownerid = Engine_Api::_()->core()->getSubject('user')->getIdentity(); 

Upvotes: 2

Josip Codes
Josip Codes

Reputation: 9521

I've figured it out: $subject_id = $subject->getIdentity(); and voila!

Upvotes: 0

Related Questions