Track a transaction item.

@param string $id
@param string $name
@param array  $options (sku|category|price|quantity)

@return void
503195
public function trackItem($id, $name, array $options = [])
	{
		$options['id'] = $id;
		$options['name'] = $name;
		$this->trackEcommerce(self::ECOMMERCE_ITEM, $options);
	}
675919
public function update($id, $data, array $options = []) {
        return $this->query(Query::UPDATE)
            ->where($this->getPrimaryKey(), $id)
            ->save($data, $options);
    }
1216765
public function addHeader($name, $options)
    {
        $header = new Header($name, $options);
        $header->setTable($this);
        $this->headersObjects[$name] = $header;
    }
4528
public function registerWidget($name, $location, $id)
    {
        $tab = '    ';
        $indent = str_repeat($tab, 5);

        register_sidebar([
            'name'          => $name,
            'id'            => sprintf('%s-%s', $location, $id),
            'class'         => sprintf('%s-%s', $location, $id),
            'before_widget' => sprintf('<div id="%%1$s" class="%s-widget %%2$s">', $location),
            'after_widget'  => sprintf('</div><!-- .%s-widget -->%s', $location, PHP_EOL),
            'before_title'  => sprintf('<h3 class="%s-widget-title">', $location),
            'after_title'   => '</h3>'
        ]);
    }
536757
public static function select($name,
                           $class,
                           $id,
                           array $options,
                           $opt_value = NULL,
                           $label = NULL,
                           $attrs = array())
    {
        $attrs['name'] = $name;
        
        $opts = array();
        foreach($options as $value => $msg)
        {
            $opt_attr = array(
              'value' => $value 
            );
            
            if(($opt_value) && $value == $opt_value)
                $opt_attr['selected'] = 'selected';
            
            $opts[] = self::tag('option', $msg, NULL, NULL, $opt_attr);
            
        }
        
        $opts = self::parseBreak(implode(PHP_EOL, $opts));
        $ret = NULL;
        if($label)
            $ret = PHP_EOL . self::formatLabel($label, $id);
            
        $ret .= self::parseBreak(self::tag('select', $opts, $class, $id, $attrs));
        return $ret;
    }
1070226
protected function registerAttachment($name, $options)
	{
		$options = $this->mergeOptions($options);
		App::make('AttachmentValidator')->validateOptions($options);
		
		$attachment = App::make('Attachment', array('name' => $name, 'options' => $options));
		$attachment->setInstance($this);
		$this->attachedFiles[$name] = $attachment;
	}
1142188
public function createLocationMenuItem(string $name, int $locationId, array $options = []): ?ItemInterface
    {
        try {
            $location = $this->locationService->loadLocation($locationId);
            $contentInfo = $location->getContentInfo();
            $canRead = $this->permissionResolver->canUser('content', 'read', $contentInfo);
        } catch (\Exception $e) {
            return null;
        }

        $defaults = [
            'route' => '_ezpublishLocation',
            'routeParameters' => [
                'locationId' => $locationId,
            ],
        ];

        return $this->createItem($name, array_merge_recursive($defaults, $options));
    }
1109730
public function set($name, $value, array $options = [])
    {
        $options = $this->options($options);
        $value   = parent::set($name, $value, $options);

        return setcookie(
            $this->normalize($name),
            $value,
            $options[self::OPTION_EXPIRE],
            $options[self::OPTION_PATH],
            $options[self::OPTION_DOMAIN],
            false,
            $options[self::OPTION_HTTP_ONLY]
        );
    }
1064003
public function start(string $id, string $name = 'PHPSESSID', array $options = []): self
        {
            if ($this->disabled()) {
                throw new \RuntimeException('PHP sessions are disabled');
            }
            
            if ($this->active()) {
                throw new \RuntimeException('Failed to start the session: already started by PHP.');
            }

            session_name($name);
            session_id($id);
            session_start($options);

            $this->name    = $name;
            $this->id      = $id;
            $this->options = $options;
            $this->data    = $_SESSION;
            return $this;
        }
818548
protected function resource($name, $controller, array $options = [])
    {
        $this->router->resource($name, $controller, $options);
    }
600191
public function delete($id, array $options = []) {
        return $this->query(Query::DELETE)
            ->where($this->getPrimaryKey(), $id)
            ->save([], $options);
    }
838915
public function find($id, array $options = [])
    {
        $event = Arr::get($options, 'event');

        if (!$event) {
            throw new InvalidArgumentException("You must specify the 'event' key in the options array");
        }

        $endpoint = null;

        switch ($event) {
            case 'charge.created':
            case 'charge.succeeded':
            case 'charge.refunded':
            case 'charge.cancelled':
            case 'charge.failed':
            case 'charge.rescored.to.decline':
                $endpoint = 'charges'; break;

            case 'chargeback.created':
            case 'chargeback.accepted':
            case 'chargeback.rejected':
                $endpoint = 'charges'; break;

            case 'fee.refund.succeeded':
            case 'fee.succeeded':
                $endpoint = 'charges'; break;

            case 'order.activated':
            case 'order.cancelled':
            case 'order.completed':
            case 'order.created':
            case 'order.expired':
            case 'order.payment.cancelled':
            case 'order.payment.received':
                $endpoint = 'charges'; break;

            case 'payout.created':
            case 'payout.failed':
            case 'payout.succeeded':
                $endpoint = 'charges'; break;

            case 'spei.received':
                $endpoint = 'charges'; break;

            case 'subscription.charge.failed':
                $endpoint = 'charges'; break;

            case 'transfer.succeeded':
                $endpoint = 'charges'; break;
        }

        if (!$endpoint) {
            throw new InvalidArgumentException(sprintf("The specified event '%s' is not valid", $event));
        }

        /* @var \Shoperti\PayMe\Response $response */
        $response = $this->gateway->commit('get', $this->gateway->buildUrlFromString("{$endpoint}/{$id}"));
        $response->type = $event;

        return $response;
    }
808463
public function add($id, $name = null, $qty = null, $price = null, array $options = [])
    {
        if ($this->isMulti($id)) {
            return array_map(function ($item) {
                return $this->add($item);
            }, $id);
        }

        $cartItem = $this->createCartItem($id, $name, $qty, $price, $options);

        $content = $this->getContent();

        if ($content->has($cartItem->rowId)) {
            $cartItem->qty += $content->get($cartItem->rowId)->qty;
        }

        $content->put($cartItem->rowId, $cartItem);
        
        $this->events->fire('cart.added', $cartItem);

        $this->session->put($this->instance, $content);

        return $cartItem;
    }
1223080
public static function update($id, $params = [], $options = [])
    {
        $url = static::classUrl() . '/' . $id;
        return static::_directRequest('put', $url, $params, $options);
    }
831997
public function sendBlock($id, $data, $name = null)
    {
        $this->send("id: {$id}\n");
        if (strlen($name) && $name !== null) {
            $this->send("event: {$name}\n");
        }
        $this->send($this->wrapData($data)."\n\n");
    }
399270
protected function initTransaction(array $options = [])
    {
        if (!isset($options['transactionId'])) {
            $this->transactionId = IdGenerator::generateId();
            $this->getClient()->sendFrame(
                $this->getProtocol()->getBeginFrame($this->transactionId)
            );
        } else {
            $this->transactionId = $options['transactionId'];
        }
    }
400024
protected function _addIdAttribute($name, array &$options) {
        $names = array(
            $this->getName(),
            $name
        );
        $parent = $this;
        while ($parent = $parent->getParent()) {
            $name = $parent->getName();
            if (!is_null($name)) {
                array_unshift($names, $parent->getName());
            }
        }
        $name = implode('-', $names);
        // if the root form has no name, the id will start with "-"
        $name = ltrim($name, '-');
        $options['id'] = strtolower($name) . '-field';
    }