Create a new open collection.

@param  string  $title
@param  string  $description
@param  \Money\Money|\Duit\MYR|int  $amount
@param  array  $optional

@return \Laravie\Codex\Contracts\Response
541143
public function create(
        string $title,
        string $description,
        $amount,
        array $optional = []
    ): Response {
        $body = \array_merge(\compact('title', 'description', 'amount'), $optional);

        list($headers, $stream) = $this->prepareMultipartRequestPayloads([], $body);

        return $this->stream('POST', 'open_collections', $headers, $body);
    }
587739
public function iApplyAJob($title)
	{
		/* @var $repo JobRepository */
		$repo = $this->getRepository('Jobs/Job');
		$job = $repo->findOneBy(['title' => $title]);
		if(!$job instanceof Job){
			throw new \Exception('There is no job titled: "'.$title.'"');
		}
		$job->setApplyId($job->getId());
		$repo->store($job);

		$url = $this->buildUrl('lang/apply',[
		    'applyId' => $job->getApplyId()
        ]);
		$this->visit($url);
	}
73445
public function getPlural($amount, array $variants, $absence = null)
    {
        if ($amount || $absence === null) {
            $result = RUtils::formatNumber($amount).' '.$this->choosePlural($amount, $variants);
        } else {
            $result = $absence;
        }
        return $result;
    }
44708
public function toWords($amount, $currency, $options = null)
    {
        $dictionary = new EnglishDictionary();
        $numberToTripletsConverter = new NumberToTripletsConverter();
        $tripletTransformer = new EnglishTripletTransformer($dictionary);
        $exponentInflector = new EnglishExponentGetter();

        $numberTransformer = (new NumberTransformerBuilder())
            ->withDictionary($dictionary)
            ->withWordsSeparatedBy(' ')
            ->transformNumbersBySplittingIntoTriplets($numberToTripletsConverter, $tripletTransformer)
            ->useRegularExponents($exponentInflector)
            ->build();

        $decimal = (int) ($amount / 100);
        $fraction = $amount % 100;

        if ($fraction === 0) {
            $fraction = null;
        }

        $currency = strtoupper($currency);

        if (!array_key_exists($currency, EnglishDictionary::$currencyNames)) {
            throw new NumberToWordsException(
                sprintf('Currency "%s" is not available for "%s" language', $currency, get_class($this))
            );
        }

        $currencyNames = EnglishDictionary::$currencyNames[$currency];

        $return = trim($numberTransformer->toWords($decimal));
        $level = ($decimal === 1) ? 0 : 1;

        if ($level > 0) {
            if (count($currencyNames[0]) > 1) {
                $return .= ' ' . $currencyNames[0][$level];
            } else {
                $return .= ' ' . $currencyNames[0][0] . 's';
            }
        } else {
            $return .= ' ' . $currencyNames[0][0];
        }

        if (null !== $fraction) {
            $return .= ' ' . trim($numberTransformer->toWords($fraction));

            $level = $fraction === 1 ? 0 : 1;

            if ($level > 0) {
                if (count($currencyNames[1]) > 1) {
                    $return .= ' ' . $currencyNames[1][$level];
                } else {
                    $return .= ' ' . $currencyNames[1][0] . 's';
                }
            } else {
                $return .= ' ' . $currencyNames[1][0];
            }
        }

        return $return;
    }
1010013
private function addInvoice($money, $options)
    {
        $this->post['amount'] = $this->amount($money / 100);
        $this->post['currency'] = self::$default_currency;
        $this->post['description'] = $options['description'];
    }
301774
public function create($title, $tag = null, $group = null, $description = null) {
        $params = [
            'data' => [
                'title' => $title
            ]
        ];

        if (isset($tag)) {
            $params['data']['tag'] = $tag;
        }

        if (isset($group)) {
            $params['data']['group'] = $group;
        }

        if (isset($group)) {
            $params['data']['description'] = $description;
        }

        $result = $this->api->request(
            'checkmk.statictag.create',
            $params
        );

        if (!array_key_exists('id', $result) ||
            !is_numeric($result['id']) ||
            !array_key_exists('success', $result) ||
            $result['success'] !== true) {
            if (array_key_exists('message', $result)) {
                throw new RuntimeException(sprintf('Bad result: %s', $result['message']));
            } else {
                throw new RuntimeException('Bad result');
            }
        }

        return (int) $result['id'];
    }
438003
public static function buildEvent($text, $title = '', array $options = array()) {
        $event = new Event($text, $title);

        foreach ($options as $property => $value) {
            self::setProperty($event, $property, $value);
        }

        return $event;
    }
785438
public function addDescription($title, $description, $titleAttribs = [], $descAttribs = [])
    {
        $this->addTitle($title, $titleAttribs)
            ->addDesc($description, $descAttribs);

        return $this;
    }
1067379
public static function createStandard(string $title, string $text, CardImage $cardImage = null): self
    {
        $card = new self();

        $card->title = $title;
        $card->text  = $text;
        $card->image = $cardImage;

        return $card;
    }
635643
public function invoiceFor($description, $amount, array $options = [])
    {
        if (!$this->stripe_id) {
            throw new InvalidArgumentException('User is not a customer. See the createAsStripeCustomer method.');
        }

        $options = array_merge([
            'customer' => $this->stripe_id,
            'amount' => $amount,
            'currency' => $this->preferredCurrency(),
            'description' => $description,
        ], $options);

        StripeInvoiceItem::create(
            $options, ['api_key' => $this->getStripeKey()]
        );

        return $this->invoice();
    }
369148
public function createVideoForBroadcasting(string $mediaId, string $title, string $description)
    {
        return $this->httpPostJson('media/uploadvideo', [
            'media_id' => $mediaId,
            'title' => $title,
            'description' => $description,
        ]);
    }
1235170
public function setHome($title, $url=NULL) {
		
		$path			= new \stdClass();
		$path->title	= $title;
		$path->url		= $url;
		$path->active	= count($this->paths) > 1 ? FALSE : TRUE;
		
		$this->paths[0] = $path;
		
	}
1114468
public static function select(string $description, $options, $default = null, $allowExit = true): array
    {
        if (!$description = \trim($description)) {
            Show::error('Please provide a description text!', 1);
        }

        $sep     = ','; // ',' ' '
        $options = \is_array($options) ? $options : \explode(',', $options);

        // If default option is error
        if (null !== $default && !isset($options[$default])) {
            Show::error("The default option [{$default}] don't exists.", true);
        }

        if ($allowExit) {
            $options['q'] = 'quit';
        }

        $text = "<comment>$description</comment>";
        foreach ($options as $key => $value) {
            $text .= "\n  <info>$key</info>) $value";
        }

        Console::write($text);
        $defText = $default ? "[default:<comment>{$default}</comment>]" : '';
        $filter  = function ($val) use ($options) {
            return $val !== 'q' && isset($options[$val]);
        };

        beginChoice:
        $r = Console::readln("Your choice{$defText} : ");
        $r = $r !== '' ? \str_replace(' ', '', \trim($r, $sep)) : '';

        // empty
        if ($r === '') {
            goto beginChoice;
        }

        // exit
        if ($r === 'q') {
            Console::write("\n  Quit,ByeBye.", true, true);
        }

        $rs = \strpos($r, $sep) ? \array_filter(\explode($sep, $r), $filter) : [$r];

        // error, try again
        if (!$rs) {
            goto beginChoice;
        }

        return $rs;
    }
1345833
public function createViewLink($title, $options = [])
    {
        return $this->Html->link(
            $title,
            ['action' => 'view', $this->getContext()->get($this->getViewVar('primaryKey'))],
            $options
        );
    }
918473
public static function multiSelect(string $description, $options, $default = null, bool $allowExit = true): array
    {
        return Checkbox::select($description, $options, $default, $allowExit);
    }
473356
public static function createOrAppendsToTitle($title, $append) {
		
		$oWikiPage = new WikiPage ( $title );
		if ($oWikiPage->exists ()) {
			$Revision = Revision::newFromTitle ( $title );
			$WikiPageContent = $Revision->getContent ( Revision::RAW )->serialize (); // or: $WikiMarkup = WikiPage::getContent(...)->serialize();
			$oContent = ContentHandler::makeContent ( $WikiPageContent . "\n$append", $title );
			
			$Result = $oWikiPage->doEditContent ( $oContent, "auto-inserted by runStatistics", EDIT_UPDATE );
			if ($Result->ok) {
				return;
			} 
			throw new \Exception("Error saving: ".$title->getPrefixedText());
		} else {
			$oContent = ContentHandler::makeContent ( $append, $title );
			$Result = $oWikiPage->doEditContent ( $oContent, "auto-inserted by runStatistics", EDIT_NEW );
			if ($Result->ok) {
				return;
			} 
			throw new \Exception("Error saving: ".$title->getPrefixedText());
		}
	}
563332
public function addCollection($title)
    {
        $collections = $this->getCollections();

        /** @var Collection $collection */
        $collection = $this->getExtensions()->createElement($this, 'app:collection');
        $collection->addTitle($title);

        $collections[] = $collection;
        $this->setCachedProperty('collections', $collections);

        return $collection;
    }