Construct an API session configured from global config data file or passed data

@param array $data
@return mixed
324610
public function build(array $data = [])
    {
        if(!$this->oAuth2Credential)
            $this->oAuth();

        $data = $this->mergeData($data);

        $adwordsSession = new AdWordsSessionBuilder();

        return $adwordsSession->withDeveloperToken($data['developerToken'])
                ->withClientCustomerId($data['clientCustomerId'])
                ->withOAuth2Credential($this->oAuth2Credential)
                ->build();
    }
180674
public function create(array $data)
    {
        if ($this->configHandler->hasParameter('is_cron_configured') &&
            $this->configHandler->getParameter('is_cron_configured')) {
            return $this->update($data, new ScheduledTask());
        }

        return null;
    }
133966
public function request(array $data) {
    // Create request
    $request = Loader::request($this->config, $data);
    // Return response
    return Loader::response(
      // Execute
      $this->getHttp()->post($this->getRequestUrl(), (string) $request)->json
      // Attach request
    )->attach('request', $request);
  }
1113931
public static function config_get_configuration_array($data) {
        return array(
            'server' => $data->server,
            'prefix' => $data->prefix,
            'password' => $data->password,
            'serializer' => $data->serializer
        );
    }
1296036
protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'token' => $this->userRepository->createToken(),
            'active' => 1,
        ]);
    }
640675
public function fromArray($data) {

		if(false === is_array($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		$this -> beforeLoad();

		foreach($data as $column => $value) {
			
			$value 	= $this -> convertToDate($value);
			$value 	= $this -> convertJsonToArray($value);
			$col 	= NameConvert :: toCamelcase($column, true);
			$method = 'set' . $col;

			if(true === method_exists($this, $method)) {
				call_user_func_array([$this, $method], [$value]);
			}
			else {
				$this -> addValue($column, $value, $col);
			}
		}

		$this -> afterLoad();

		return $this;
	}
1048209
protected function __apiStore(array $data = null)
    {
        if( is_null($data) ) {
            $data = $this->getInputData();
        }

        (new HCUsersValidator())->validateForm();

        $record = createHCUser(
            array_get($data, 'record.email'),
            array_get($data, 'roles'),
            request()->has('is_active'),
            array_get($data, 'record.password'),
            [],
            request()->has('send_welcome_email'),
            request()->has('send_password')
        );

        return $this->apiShow($record->id);
    }
843220
protected function create(array $data)
    {
        $user = User::create([
            'uuid' => (string) Str::uuid(),
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);

        return $user;
    }
1036680
public function setData(array $data)
    {
        foreach ($data as $key => $val) {
            $setter = $this->setter($key);
            if (is_callable([ $this, $setter ])) {
                $this->{$setter}($val);
            } else {
                $this->{$key} = $val;
            }
        }

        return $this;
    }
168029
public function createGuestSessionToken(array $data = [])
    {
        $token = new GuestSessionToken();

        if (array_key_exists('expires_at', $data)) {
            $token->setExpiresAt(new \DateTime($data['expires_at']));
        }

        if (array_key_exists('guest_session_id', $data)) {
            $token->setToken($data['guest_session_id']);
        }

        if (array_key_exists('success', $data)) {
            $token->setSuccess($data['success']);
        }

        return $token;
    }
310676
function create_session($data){

		$key = Env::getConfig("jwt")->get('key');
		$expiration = Env::getConfig("jwt")->get('token_expiration');
		$cookie_key=   Env::getConfig("jwt")->get('cookie_key');
		$token = array(
				"iss" => $_SERVER['HTTP_HOST'],
				"iat" => time(),
				"nbf" => time(),
				"exp" => time()+($expiration),
				"data" =>  $data
		);

		$jwt = JWT::encode($token, $key);

		$this->setToken($jwt);
		$_SESSION[$cookie_key]=$jwt;
		setcookie($cookie_key,$jwt,time()+$expiration,'/');
		//var_dump($cookie_key);
		Env::getRequest()->setToken($jwt);
		$this->setDefaultDatas($data);
	}
349206
public function passMany(array $data)
    {
        if (!isset($this->_session))
            throw new \Exception('m\Http\Response: No session object available to flash "'.$key.'" to.');

        $this->_session->flashMany($data);

        return $this;
    }
280903
public function loadConfig($data)
    {
        $model = $this->getConfigModel(false);

        $newData = $model->loadFirst(array('grcfg_id_organization' => $data['gor_id_organization']));
        if (empty($newData)) {
            $newData = $model->loadNew();
        }
        $newData['grcfg_id_organization'] = $data['gor_id_organization'];

        return $newData;
    }
564136
public function set(array $data)
    {
        foreach ($data as $key => $value) {
            if (method_exists($this, 'set' . $key)) {
                $this->{'set' . $key}($value);
            } else if ($this->customParamsPrefix . $this->shopCommissionCustomParamKey === $key) {
                $this->setShopCommission($value);
            } else if (0 === strpos($key, $this->customParamsPrefix)) {
                $this->setCustomParam(substr($key, 4), $value);
            }
        }

        $this->auth->set($data);
        $this->client->set($data);

        return $this;
    }
36831
public static function encode( array $data ) {
		$format = ini_get( 'session.serialize_handler' );
		if ( !is_string( $format ) ) {
			throw new \UnexpectedValueException(
				'Could not fetch the value of session.serialize_handler'
			);
		}
		switch ( $format ) {
			case 'php':
				return self::encodePhp( $data );

			case 'php_binary':
				return self::encodePhpBinary( $data );

			case 'php_serialize':
				return self::encodePhpSerialize( $data );

			default:
				throw new \DomainException( "Unsupported format \"$format\"" );
		}
	}
541707
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::REQUIRED_METHOD);
        }

        switch ($data['method']) {
            case self::AUTO:
                $scheduleInstruction = new AutoType($data);

                break;
            case self::DATE_INTERVAL:
                $scheduleInstruction = new DateIntervalType($data);

                break;
            case self::DAY_OF_MONTH:
                $scheduleInstruction = new DayOfMonthType($data);

                break;
            case self::DAY_OF_WEEK:
                $scheduleInstruction = new DayOfWeekType($data);

                break;
            case self::IMMEDIATELY:
                $scheduleInstruction = new ImmediatelyType($data);

                break;
            case self::INTELLIGENT:
                $scheduleInstruction = new IntelligentType($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::UNSUPPORTED_METHOD, implode(',', self::$availableMethods))
                );
        }

        return $scheduleInstruction;
    }
734859
protected function makeDataScript(array $data)
    {
        $script = '';
        foreach ($data as $key => $value) {
            $script .= PHP_EOL . "data.{$key} = '{$value}';";
        }

        return $script;
    }