Esempio n. 1
0
 /**
  * Parse user array
  *
  * @param array $array
  *
  * @return \Evolution7\SocialApi\Entity\User
  */
 public function parseUserArray($array)
 {
     // Create User
     $user = new User();
     $user->setPlatform(Config::PLATFORM_TWITTER);
     $user->setId($this->getArrayValue('id_str', $array));
     $user->setHandle($this->getArrayValue('screen_name', $array));
     $user->setName($this->getArrayValue('name', $array));
     $user->setUrl('https://twitter.com/' . $user->getHandle());
     $imageUrl = $this->getArrayValue('profile_image_url_https', $array);
     if (!is_null($imageUrl)) {
         $user->setImageUrl(str_replace('https://', '//', $imageUrl));
     }
     $this->users[$user->getId()] = $user;
     return $user;
 }
Esempio n. 2
0
 /**
  * Parse user array
  *
  * @param array $array
  *
  * @return \Evolution7\SocialApi\Entity\User
  */
 public function parseUserArray($array)
 {
     // Create User
     $user = new User();
     $user->setPlatform(Config::PLATFORM_INSTAGRAM);
     $user->setId($this->getArrayValue('id', $array));
     $user->setHandle($this->getArrayValue('username', $array));
     $user->setName($this->getArrayValue('full_name', $array));
     $user->setUrl('http://instagram.com/' . $user->getHandle());
     $user->setImageUrl($this->getArrayValue('profile_picture', $array));
     $this->users[$user->getId()] = $user;
     return $user;
 }