@param string|array|stdClass $params Campaign name or params object

Publish voucher.

@throws \Voucherify\ClientException
429892
public function publish($params)
    {
        $payload = null;

        if (is_string($params)) {
            $payload = ["campaign" => $params];
        }
        elseif (is_object($params) || is_array($params)) {
            $payload = $params;
        }

        return $this->client->post("/vouchers/publish", $payload, null);
    }
943028
protected function setQueryParams(array $params)
    {
        foreach ($params as $key => $value) {
            $this->setQueryParam($key, $value);
        }
    }
1226549
public function finish( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$catalogManager = MShop_Catalog_Manager_Factory::createManager( $this->_context );
		$indexManager = $catalogManager->getSubManager( 'index' );

		$search = $this->_manager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.id', $params->items ) );
		$search->setSlice( 0, count( $params->items ) );

		foreach( $this->_manager->searchItems( $search ) as $item ) {
			$indexManager->saveItem( $item );
		}

		$this->_clearCache( (array) $params->items );

		return array(
			'success' => true,
		);
	}
1372775
public function preview($params)
    {
        $rst = $this->_request->post($this->_url . "message/mass/preview", $params);
        return $this->_client->rst($rst);
    }
520862
public function setParams($params): void
    {
        if (! \is_array($params) && ! $params instanceof \ArrayAccess) {
            throw new \InvalidArgumentException('Event params are invalid. Expected type is array or \\ArrayAccess. Got ' . \gettype($params));
        }

        $this->params = $params;
    }
84431
public function main(array &$params)
    {
        $selectOptions = [];
        foreach (self::sortFields as $field) {
            $label = $this->languageService->sL($GLOBALS['TCA']['tt_address']['columns'][$field]['label']);
            $label = rtrim($label, ':');

            $selectOptions[] = [
                'field' => $field,
                'label' => $label
            ];
        }

        // add sorting by order of single selection
        $selectOptions[] = [
            'field' => 'singleSelection',
            'label' => $this->languageService->sL('LLL:EXT:tt_address/Resources/Private/Language/locallang_pi1.xlf:pi1_flexform.sortBy.singleSelection')
        ];

        // sort by labels
        $labels = [];
        foreach ($selectOptions as $key => $v) {
            $labels[$key] = $v['label'];
        }
        $labels = array_map('strtolower', $labels);
        array_multisort($labels, SORT_ASC, $selectOptions);

        // add fields to <select>
        foreach ($selectOptions as $option) {
            $params['items'][] = [
                $option['label'],
                $option['field']
            ];
        }
    }
303901
private function createActionInternal(\stdClass $postParams) {
        $entity = $this->generateEntity();
        $this->saveEntity($postParams, $entity, true);
        // since our entity can be manipulated after saving, we need to find it again, just in case.
        /** @var ModelInterface $newEntity */
        $newEntity = $entity->findFirst($entity->getId());
        //Fix if there are two entities created (with bulk insert), and the first fails, but the second succeeds, the second with get the first's errors
        $reflectionClass = new \ReflectionClass($newEntity);
        $reflectionProperty = $reflectionClass->getProperty('_errorMessages');
        $reflectionProperty->setAccessible(true);
        $reflectionProperty->setValue($newEntity, []);
        return $newEntity;
    }
1027782
public function moveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items', 'oldparentid', 'newparentid' ) );
		$this->_setLocale( $params->site );

		$manager = $this->_getManager();

		$ids = array();
		$refId = ( isset( $params->refid ) ? $params->refid : null );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$manager->moveItem( $entry, $params->oldparentid, $params->newparentid, $refId );
			$ids[] = $entry->id;
		}

		$this->_clearCache( $ids );

		return array(
			'success' => true,
		);
	}
403182
public function connect(\stdClass $params): QueryBuilderInterface
	{
		list($dsn, $dbtype, $params, $options) = $this->parseParams($params);

		$dbtype = ucfirst($dbtype);
		$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";

		// Create the database connection
		$db =  ! empty($params->user)
			? new $driver($dsn, $params->user, $params->pass, $options)
			: new $driver($dsn, '', '', $options);

		// Set the table prefix, if it exists
		if (isset($params->prefix))
		{
			$db->setTablePrefix($params->prefix);
		}

		// Create Query Builder object
		$conn = new QueryBuilder($db, new QueryParser($db));


		// Save it for later
		if (isset($params->alias))
		{
			$this->connections[$params->alias] = $conn;
		}
		else
		{
			$this->connections[] = $conn;
		}

		return $conn;
	}
329360
public function saveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$this->_manager->saveItem( $item );
		}

		return array(
			'items' => $params->items,
			'success' => true,
		);
	}
904255
public function send(array $params)
    {
        $params['appid'] = $this->app['config']->app_id;
        $params['openid_count'] = 1;

        return $this->safeRequest('mmpaymkttransfers/send_coupon', $params);
    }
871254
public function updateMember($params)
    {
      $args = Ensure::Input($params);
      $url = URIResource::Make($this->path, array($this->id, "members", $args->val("memberId")));
      $member = $this->client->post($url, $args->get());

      return $this->member($member['id']);
    }
1049032
public function sendVenue(array $params)
    {
        if (isset($params['reply_markup']) && $params['reply_markup'] instanceof Keyboard) {
            $params['reply_markup'] = json_encode($params['reply_markup']);
        }

        return Message::createFromResponse($this->request('sendVenue', $params));
    }
1176611
public function prepareParms($params)
    {
        if (is_array($params)) {
            foreach ($params as $key => $value) {
                array_push($this->setParams, $value);
            }
        } else {
            array_push($this->setParams, $params);
        }
    }
1023064
public function updateClient($params)
    {
        $clientId = $params['client_id'];
        $client = $this->getByID($clientId);
        $client->update($params);
        $client->save();
        return $client;
    }
1164886
public function generateFromURL($params)
    {
        if(empty($params['url']))
            throw new \Exception('Parameter \'url\' must be set' );

        $params = $this->validator->validate($params);

        try {
            return $this->client->sendRequest('pdf', $params, 'POST');
        } catch (\Exception $ex) {
            throw $ex;
        }

    }
689383
public function uploadFile( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site' ) );
		$this->setLocale( $params->site );

		$clientFilename = '';
		$context = $this->getContext();

		$request = $context->getView()->request();
		$dest = $this->storeFile( $request, $clientFilename );

		$result = (object) array(
			'site' => $params->site,
			'items' => array(
				(object) array(
					'job.label' => 'Product text import: ' . $clientFilename,
					'job.method' => 'Product_Import_Text.importFile',
					'job.parameter' => array(
						'site' => $params->site,
						'items' => $dest,
					),
					'job.status' => 1,
				),
			),
		);

		$jobController = \Aimeos\Controller\ExtJS\Factory::createController( $context, 'admin/job' );
		$jobController->saveItems( $result );

		return array(
			'items' => $dest,
			'success' => true,
		);
	}