TijsVerkoyen\Twitter\Twitter::usersContributees PHP Method

usersContributees() public method

Returns a collection of users that the specified user can "contribute" to.
public usersContributees ( string[optional] $userId = null, string[optional] $screenName = null, bool[optional] $includeEntities = null, bool[optional] $skipStatus = null ) : array
$userId string[optional]
$screenName string[optional]
$includeEntities bool[optional]
$skipStatus bool[optional]
return array
    public function usersContributees($userId = null, $screenName = null, $includeEntities = null, $skipStatus = null)
    {
        // validate
        if ($userId == '' && $screenName == '') {
            throw new Exception('Specify an userId or a screenName.');
        }
        // build parameters
        if ($userId != null) {
            $parameters['user_id'] = (string) $userId;
        }
        if ($screenName != null) {
            $parameters['screen_name'] = (string) $screenName;
        }
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : 'false';
        }
        if ($skipStatus !== null) {
            $parameters['skip_status'] = $skipStatus ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('users/contributees.json', $parameters);
    }

Usage Example

 /**
  * Tests Twitter->usersContributees
  */
 public function testUsersContributees()
 {
     $response = $this->twitter->usersContributees(null, 'themattharris');
     foreach ($response as $row) {
         $this->isUser($row);
     }
 }
Twitter