Set postfields array, example: array('screen_name' => 'J7mbo')

@param array $array Array of parameters to send to API

@return TwitterAPIExchange Instance of self for method chaining
540715
public function setPostfields(array $array)
    {
        if (!is_null($this->getGetfield())) 
        { 
            throw new Exception('You can only choose get OR post fields.'); 
        }
        
        if (isset($array['status']) && substr($array['status'], 0, 1) === '@')
        {
            $array['status'] = sprintf("\0%s", $array['status']);
        }
        
        $this->postfields = $array;
        
        return $this;
    }
671565
public function setCollection($array)
    {
        foreach ($array as $key => $object) {
            $class_name = "HelloSign\\{$this->resource_class}";
            $resource = new $class_name;
            $resource->fromObject($object);

            $this->collection[$key] = $resource;
        }

        return $this;
    }
1296615
public function copyFromArray(array &$array)
    {
        // formatted
        $this->setFormatted(
            LanguageUtility::getFromArray('formatted', $array));

        // street_address
        $this->setStreetAddress(
            LanguageUtility::getFromArray('street_address', $array));

        // locality
        $this->setLocality(
            LanguageUtility::getFromArray('locality', $array));

        // region
        $this->setRegion(
            LanguageUtility::getFromArray('region', $array));

        // postal_code
        $this->setPostalCode(
            LanguageUtility::getFromArray('postal_code', $array));

        // country
        $this->setCountry(
            LanguageUtility::getFromArray('country', $array));
    }
1143274
public function doBankTransfer(array $array) 
    {
        $this->formatRequest($array);
        $WSRequest = array(
            'payment'       => $this->payment($array['payment']),
            'creditor'      => $this->creditor($array['creditor']),
            'comment'       => $array['comment'],
            'transactionID' => $array['transactionID'],
            'orderID'       => $array['orderID']
        );
        return $this->webServiceRequest($array, $WSRequest, self::DIRECT_API, 'doBankTransfer');
    }
926332
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            TokenUpdateAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // accessTokenExpiresAt
        $this->setAccessTokenExpiresAt(
            LanguageUtility::getFromArray('accessTokenExpiresAt', $array));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
232835
public function setArray(array $array)
    {
        $this->array = array_values($array);
        $this->arraySize = count($this->array);
        $this->rewind();

        return $this;
    }
254380
public function setDefaultValues($array)
  {
    foreach ($this->fields as $field=>$el) {
      $v = false;
      if (is_array($array)) {
        $v = isset($array[$field]) ? $array[$field] : false;
      }
      $el->setDefaultValue($v);
    }
  }
1314728
public function copyFromArray(array &$array)
    {
        // sns
        $this->setSns(
            Sns::valueOf(
                LanguageUtility::getFromArray('sns', $array)));

        // apiKey
        $this->setApiKey(
            LanguageUtility::getFromArray('apiKey', $array));

        // apiSecret
        $this->setApiSecret(
            LanguageUtility::getFromArray('apiSecret', $array));
    }
788908
protected function doCreateObject(array $array)
    {
        $this->data    = $array;
        $this->product = new Product($this->data);
        $this->setBrands()
             ->setFunctionalNames()
             ->setPromotions()
             ->setProductsToPromotions()
             ->setOptions()
             ->setAttributes()
             ->setMedia();

        return $this->product;
    }
746906
public function fromArray($array) {
		if (is_array($array) && sizeof($array)>0) {
			foreach ( $array as $value ) {
				if (is_array($value)) {
					$this->addImage($value ["src"], @$value ["alt"], @$value ["caption"], @$value ["description"]);
				} else {
					$this->addImage($value);
				}
			}
		}
		return $this;
	}
1090265
public function copyToArray(array &$array)
    {
        $array['accessToken']          = $this->accessToken;
        $array['accessTokenExpiresAt'] = LanguageUtility::orZero($this->accessTokenExpiresAt);
        $array['scopes']               = $this->scopes;
        $array['properties']           = LanguageUtility::convertArrayOfArrayCopyableToArray($this->properties);
    }
406952
public static function createFromAttributeArray(array $array)
	{
		$input = array_change_key_case($array, CASE_LOWER);

		$response = new Response();

		foreach (Response::$attributeMapping as $attribute => $localVariable) {
			$loweredAttribute = strtolower($attribute);

			if (array_key_exists($loweredAttribute, $input)) {
				$response->{$localVariable} = $input[$loweredAttribute];
			}
		}

		return $response;
	}
404880
public function setList($array)
    {
        $listString = '';
        foreach ($array as $key => $value) {
            $listString .= CPS_Term($value, $key);
        }
        $this->setParam('list', $listString);
    }
179176
public function copyFromArray(array &$array)
    {
        // developer
        $this->setDeveloper(
            LanguageUtility::getFromArray('developer', $array));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // clientIdAlias
        $this->setClientIdAlias(
            LanguageUtility::getFromArray('clientIdAlias', $array));

        // clientIdAliasEnabled
        $this->setClientIdAliasEnabled(
            LanguageUtility::getFromArrayAsBoolean('clientIdAliasEnabled', $array));

        // clientSecret
        $this->setClientSecret(
            LanguageUtility::getFromArray('clientSecret', $array));

        // clientType
        $this->setClientType(
            ClientType::valueOf(
                LanguageUtility::getFromArray('clientType', $array)));

        // redirectUris
        $this->setRedirectUris(
            LanguageUtility::getFromArray('redirectUris', $array));

        // responseTypes
        $responseTypes = LanguageUtility::getFromArray('responseTypes', $array);
        $this->setResponseTypes(
            LanguageUtility::convertArray(
                $responseTypes, '\Authlete\Types\ResponseType::valueOf'));

        // grantTypes
        $grantTypes = LanguageUtility::getFromArray('grantTypes', $array);
        $this->setGrantTypes(
            LanguageUtility::convertArray(
                $grantTypes, '\Authlete\Types\GrantType::valueOf'));

        // applicationType
        $this->setApplicationType(
            ApplicationType::valueOf(
                LanguageUtility::getFromArray('applicationType', $array)));

        // contacts
        $this->setContacts(
            LanguageUtility::getFromArray('contacts', $array));

        // clientName
        $this->setClientName(
            LanguageUtility::getFromArray('clientName', $array));

        // clientNames
        $clientNames = LanguageUtility::getFromArray('clientNames', $array);
        $this->setClientNames(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $clientNames, __NAMESPACE__ . '\TaggedValue'));

        // logoUri
        $this->setLogoUri(
            LanguageUtility::getFromArray('logoUri', $array));

        // logoUris
        $logoUris = LanguageUtility::getFromArray('logoUris', $array);
        $this->setLogoUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $logoUris, __NAMESPACE__ . '\TaggedValue'));

        // clientUri
        $this->setClientUri(
            LanguageUtility::getFromArray('clientUri', $array));

        // clientUris
        $clientUris = LanguageUtility::getFromArray('clientUris', $array);
        $this->setClientUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $clientUris, __NAMESPACE__ . '\TaggedValue'));

        // policyUri
        $this->setPolicyUri(
            LanguageUtility::getFromArray('policyUri', $array));

        // policyUris
        $policyUris = LanguageUtility::getFromArray('policyUris', $array);
        $this->setPolicyUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $policyUris, __NAMESPACE__ . '\TaggedValue'));

        // tosUri
        $this->setTosUri(
            LanguageUtility::getFromArray('tosUri', $array));

        // tosUris
        $tosUris = LanguageUtility::getFromArray('tosUris', $array);
        $this->setTosUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $tosUris, __NAMESPACE__ . '\TaggedValue'));

        // jwksUri
        $this->setJwksUri(
            LanguageUtility::getFromArray('jwksUri', $array));

        // jwks
        $this->setJwks(
            LanguageUtility::getFromArray('jwks', $array));

        // sectorIdentifier
        $this->setSectorIdentifierUri(
            LanguageUtility::getFromArray('sectorIdentifier', $array));

        // subjectType
        $this->setSubjectType(
            SubjectType::valueOf(
                LanguageUtility::getFromArray('subjectType', $array)));

        // idTokenSignAlg
        $this->setIdTokenSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('idTokenSignAlg', $array)));

        // idTokenEncryptionAlg
        $this->setIdTokenEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('idTokenEncryptionAlg', $array)));

        // idTokenEncryptionEnc
        $this->setIdTokenEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('idTokenEncryptionEnc', $array)));

        // userInfoSignAlg
        $this->setUserInfoSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('userInfoSignAlg', $array)));

        // userInfoEncryptionAlg
        $this->setUserInfoEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('userInfoEncryptionAlg', $array)));

        // userInfoEncryptionEnc
        $this->setUserInfoEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('userInfoEncryptionEnc', $array)));

        // requestSignAlg
        $this->setRequestSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('requestSignAlg', $array)));

        // requestEncryptionAlg
        $this->setRequestEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('requestEncryptionAlg', $array)));

        // requestEncryptionEnc
        $this->setRequestEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('requestEncryptionEnc', $array)));

        // tokenAuthMethod
        $this->setTokenAuthMethod(
            ClientAuthMethod::valueOf(
                LanguageUtility::getFromArray('tokenAuthMethod', $array)));

        // tokenAuthSignAlog
        $this->setTokenAuthSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('tokenAuthSignAlg', $array)));

        // defaultMaxAge
        $this->setDefaultMaxAge(
            LanguageUtility::getFromArray('defaultMaxAge', $array));

        // authTimeRequired
        $this->setAuthTimeRequired(
            LanguageUtility::getFromArrayAsBoolean('authTimeRequired', $array));

        // defaultAcrs
        $this->setDefaultAcrs(
            LanguageUtility::getFromArray('defaultAcrs', $array));

        // loginUri
        $this->setLoginUri(
            LanguageUtility::getFromArray('loginUri', $array));

        // requestUris
        $this->setRequestUris(
            LanguageUtility::getFromArray('requestUris', $array));

        // description
        $this->setDescription(
            LanguageUtility::getFromArray('description', $array));

        // descriptions
        $descriptions = LanguageUtility::getFromArray('descriptions', $array);
        $this->setDescriptions(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $descriptions, __NAMESPACE__ . '\TaggedValue'));

        // createdAt
        $this->setCreatedAt(
            LanguageUtility::getFromArray('createdAt', $array));

        // modifiedAt
        $this->setModifiedAt(
            LanguageUtility::getFromArray('modifiedAt', $array));

        // extension
        $extension = LanguageUtility::getFromArray('extension', $array);
        $this->setExtension(
            LanguageUtility::convertArrayToArrayCopyable(
                $extension, __NAMESPACE__ . '\ClientExtension'));

        // tlsClientAuthSubjectDn
        $this->setTlsClientAuthSubjectDn(
            LanguageUtility::getFromArray('tlsClientAuthSubjectDn', $array));

        // tlsClientCertificateBoundAccessTokens
        $this->setTlsClientCertificateBoundAccessTokens(
            LanguageUtility::getFromArrayAsBoolean('tlsClientCertificateBoundAccessTokens', $array));

        // selfSignedCertificateKeyId
        $this->setSelfSignedCertificateKeyId(
            LanguageUtility::getFromArray('selfSignedCertificateKeyId', $array));

        // softwareId
        $this->setSoftwareId(
            LanguageUtility::getFromArray('softwareId', $array));

        // softwareVersion
        $this->setSoftwareVersion(
            LanguageUtility::getFromArray('softwareVersion', $array));

        // authorizationSignAlg
        $this->setAuthorizationSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('authorizationSignAlg', $array)));

        // authorizationEncryptionAlg
        $this->setAuthorizationEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('authorizationEncryptionAlg', $array)));

        // authorizationEncryptionEnc
        $this->setAuthorizationEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('authorizationEncryptionEnc', $array)));
    }
576711
public function createSmtpTransportFromArray(array $array)
    {
        $options = [
            'host' => (string) array_get($array, 'server'),
        ];
        $username = (string) array_get($array, 'username', '');
        if ($username !== '') {
            $options['connection_class'] = 'login';
            $options['connection_config'] = [
                'username' => $username,
                'password' => (string) array_get($array, 'password'),
            ];
        }
        $port = array_get($array, 'port');
        if ($port) {
            $options['port'] = (int) $array['port'];
        }
        $encryption = array_get($array, 'encryption');
        if ($encryption) {
            $options['connection_config']['ssl'] = (string) $encryption;
        }
        $mpc = array_get($array, 'messages_per_connection');
        $messagesPerConnection = $mpc ? (int) $mpc : 0;

        $smtp = new SmtpTransport(new SmtpOptions($options));

        if ($messagesPerConnection >= 1) {
            $result = new LimitedSmtpTransport($smtp, $messagesPerConnection);
        } else {
            $result = $smtp;
        }

        return $result;
    }
1311737
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            TokenIssueAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // responseContent
        $this->setResponseContent(
            LanguageUtility::getFromArray('responseContent', $array));

        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // accessTokenExpiresAt
        $this->setAccessTokenExpiresAt(
            LanguageUtility::getFromArray('accessTokenExpiresAt', $array));

        // accessTokenDuration
        $this->setAccessTokenDuration(
            LanguageUtility::getFromArray('accessTokenDuration', $array));

        // refreshToken
        $this->setRefreshToken(
            LanguageUtility::getFromArray('refreshToken', $array));

        // refreshTokenExpiresAt
        $this->setRefreshTokenExpiresAt(
            LanguageUtility::getFromArray('refreshTokenExpiresAt', $array));

        // refreshTokenDuration
        $this->setRefreshTokenDuration(
            LanguageUtility::getFromArray('refreshTokenDuration', $array));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // clientIdAlias
        $this->setClientIdAlias(
            LanguageUtility::getFromArray('clientIdAlias', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
1132620
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            AuthorizationIssueAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // responseContent
        $this->setResponseContent(
            LanguageUtility::getFromArray('responseContent', $array));
    }