/** * @param $source * * @return \C2iS\SocialWall\Twitter\Model\SocialUser */ protected function createSocialUser($source) { $user = new SocialUser(); if (isset($source->id_str)) { $user->setId($source->id_str); } if (isset($source->name)) { $user->setName($source->name); } if (isset($source->screen_name)) { $user->setScreenName($source->screen_name); } if (isset($source->location)) { $user->setLocation($source->location); } if (isset($source->description)) { $user->setDescription($source->description); } if (isset($source->protected)) { $user->setProtected($source->protected); } if (isset($source->url)) { $user->setUrl($source->url); } if (isset($source->followers_count)) { $user->setFollowers($source->followers_count); } if (isset($source->friends_count)) { $user->setFriends($source->friends_count); } if (isset($source->listed_count)) { $user->setListed($source->listed_count); } if (isset($source->favourites_count)) { $user->setFavourites($source->favourites_count); } if (isset($source->created_at) && $source->created_at) { $user->setCreatedAt(new \DateTime($source->created_at)); } if (isset($source->time_zone)) { $user->setTimezone($source->time_zone); } if (isset($source->verified)) { $user->setVerified($source->verified); } if (isset($source->lang)) { $user->setLocale($source->lang); } return $user; }
/** * @return string */ public function getLink() { return sprintf('http://twitter.com/%s/status/%s', $this->user->getScreenName(), $this->getId()); }