Inserts customer items.
190102
protected function _process()
	{
		$this->_msg( 'Adding customer performance data', 0 );


		$context =  $this->_getContext();
		$customerManager = MShop_Customer_Manager_Factory::createManager( $context );

		$customerItem = $customerManager->createItem();
		$customerItem->setCode( 'demo-test' );
		$customerItem->setLabel( 'Test demo unitperf user' );
		$customerItem->setPassword( sha1( microtime(true) . getmypid() . rand() ) );
		$customerItem->setStatus( 1 );

		$addrItem = $customerItem->getPaymentAddress();
		$addrItem->setCompany( 'Test company' );
		$addrItem->setVatID( 'DE999999999' );
		$addrItem->setSalutation( 'mr' );
		$addrItem->setFirstname( 'Testdemo' );
		$addrItem->setLastname( 'Perfuser' );
		$addrItem->setAddress1( 'Test street' );
		$addrItem->setAddress2( '1' );
		$addrItem->setPostal( '1000' );
		$addrItem->setCity( 'Test city' );
		$addrItem->setLanguageId( 'en' );
		$addrItem->setCountryId( 'DE' );
		$addrItem->setEmail( 'me@localhost' );

		$customerManager->saveItem( $customerItem );

		$this->_status( 'done' );
	}
1295495
def insert(self, item, safe=None): # pragma: nocover
		''' '''
		warnings.warn('Insert will be deprecated soon and removed in 1.0. Please use insert',
					  PendingDeprecationWarning)
		self.add(item, safe=safe)
948420
def insert(index, *items)
      inserting(index ... index + items.size) do
        @array.insert(index, *items)
      end
      self
    end
993668
protected function PostInsertHook()
    {
        parent::PostInsertHook();

        // we need to add an customer number to the order... since generation of this number may differ
        // from shop to shop, we have added the method to fetch a new customer number to the shop class
        if (empty($this->sqlData['customer_number']) || empty($this->sqlData['shop_id'])) {
            $aUpdateData = array();
            if (empty($this->sqlData['customer_number'])) {
                $aUpdateData['customer_number'] = $this->GetCustomerNumber();
            }
            if (empty($this->sqlData['shop_id'])) {
                $oShop = TdbShop::GetInstance();
                $aUpdateData['shop_id'] = $oShop->id;
            }
            if (count($aUpdateData) > 0) {
                $this->SaveFieldsFast($aUpdateData);
            }
        }
        TdbDataExtranetGroup::UpdateAutoAssignToUser($this);
    }
283361
public function eventAfterInsert()
    {
        $this->updateNavItemTimesamp();
        $this->reindex($this->nav_item_page_id, $this->placeholder_var, $this->prev_id);
        Log::add(1, ['tableName' => 'cms_nav_item_page_block_item', 'action' => 'insert', 'row' => $this->id, 'pageTitle' => $this->droppedPageTitle, 'blockName' => $this->block->getNameForLog()], 'cms_nav_item_page_block_item', $this->id);
    }
864657
public function addInvoiceItem($params = null)
    {
        $params = $params ?: [];
        $params['customer'] = $this->id;
        $ii = InvoiceItem::create($params, $this->_opts);
        return $ii;
    }
427295
def insert(cls, jobs_data, queue=None, statuses_no_storage=None, return_jobs=True, w=None, j=None):
        

        now = datetime.datetime.utcnow()
        for data in jobs_data:
            if data["status"] == "started":
                data["datestarted"] = now

        no_storage = (statuses_no_storage is not None) and ("started" in statuses_no_storage)
        if no_storage and return_jobs:
            for data in jobs_data:
                data["_id"] = ObjectId()  # Give the job a temporary ID
        else:
            inserted = context.connections.mongodb_jobs.mrq_jobs.insert(
                jobs_data,
                manipulate=True,
                w=w,
                j=j
            )

        if return_jobs:
            jobs = []
            for data in jobs_data:
                job = cls(data["_id"], queue=queue)
                job.set_data(data)
                job.statuses_no_storage = statuses_no_storage
                job.stored = (not no_storage)
                if data["status"] == "started":
                    job.datestarted = data["datestarted"]
                jobs.append(job)

            return jobs
        else:
            return inserted
933191
def insert_data(self, node, data, start, end):
        """"""
        for item in data:
            self.recursive_insert(node, [item[0], item[1]], item[-1], start, end)
1226575
def insert(queue, items):
    '''
    
    '''
    handle_queue_creation(queue)

    with _conn(commit=True) as cur:
        if isinstance(items, dict):
            items = salt.utils.json.dumps(items)
            cmd = str('''INSERT INTO {0}(data) VALUES('{1}')''').format(queue, items)  # future lint: disable=blacklisted-function
            log.debug('SQL Query: %s', cmd)
            try:
                cur.execute(cmd)
            except psycopg2.IntegrityError as esc:
                return ('Item already exists in this queue. '
                        'postgres error: {0}'.format(esc))
        if isinstance(items, list):
            items = [(salt.utils.json.dumps(el),) for el in items]
            cmd = str("INSERT INTO {0}(data) VALUES (%s)").format(queue)  # future lint: disable=blacklisted-function
            log.debug('SQL Query: %s', cmd)
            try:
                cur.executemany(cmd, items)
            except psycopg2.IntegrityError as esc:
                return ('One or more items already exists in this queue. '
                        'postgres error: {0}'.format(esc))
    return True
824995
public function Insert()
    {
        if ($this->isNewVariant()) {
            $this->sId = $this->sRestriction;
            $variant = $this->DatabaseCopy();
            /** @var TdbShopArticle $product */
            $product = $this->oTable;
            if (!$product->fieldActive) {
                $variantTableEditor = TTools::GetTableEditorManager('shop_article', $variant->id);
                $variantTableEditor->SaveField('variant_parent_is_active', '0');
            }
        } else {
            parent::Insert();
        }
    }
1189993
def insert_check(self, index, check_item):
        """"""
        self.checks.insert(index, check_item)
        for other in self.others:
            other.insert_check(index, check_item)
866792
def insert_right(self, item):
        ''
        k = self._key(item)
        i = bisect_right(self._keys, k)
        self._keys.insert(i, k)
        self._items.insert(i, item)
1249515
def insert(self, s):
        '''
        
        '''
        for c in s:
            self.text.insert(self.cursor_loc, c)
            self.cursor_loc += 1
600236
def insert(self, item, priority):
        """"""

        with self.lock:

            self_data = self.data
            rotate = self_data.rotate
            self_items = self.items
            maxlen = self._maxlen

            try:

                if priority <= self_data[-1][1]:
                    self_data.append((item, priority))
                elif priority > self_data[0][1]:
                    self_data.appendleft((item, priority))
                else:

                    length = len(self_data) + 1
                    mid = length // 2
                    shift = 0

                    while True:

                        if priority <= self_data[0][1]:
                            rotate(-mid)
                            shift += mid
                            mid //= 2
                            if mid == 0:
                                mid += 1

                        else:
                            rotate(mid)
                            shift -= mid
                            mid //= 2
                            if mid == 0:
                                mid += 1

                        if self_data[-1][1] >= priority > self_data[0][1]:
                            self_data.appendleft((item, priority))

                            # When returning to original position, never shift
                            # more than half length of DEPQ i.e. if length is
                            # 100 and we rotated -75, rotate -25, not 75
                            if shift > length // 2:
                                shift = length % shift
                                rotate(-shift)
                            else:
                                rotate(shift)

                            break

                try:
                    self_items[item] += 1
                except TypeError:
                    self_items[repr(item)] += 1

            except IndexError:
                self_data.append((item, priority))
                try:
                    self_items[item] = 1
                except TypeError:
                    self_items[repr(item)] = 1

            if maxlen is not None and maxlen < len(self_data):
                self._poplast()
708822
protected function PostInsertHook()
    {
        parent::PostInsertHook();
        // we need to add an order number to the order... since generation of this number may differ
        // from shop to shop, we have added the method to fetch a new order number to the shop class
        $oShop = TdbShop::GetInstance();
        $iOrderNumber = $oShop->GetNextFreeOrderNumber();
        $aData = $this->sqlData;
        $aData['ordernumber'] = $iOrderNumber;
        $this->LoadFromRow($aData);
        $this->Save();
    }
993042
def insert_after(self, key, new_item, instance=0):
        """"""
        self._insert_item(key, new_item, instance, True)
1007810
protected function _insert()
    {
        // set oxcreate
        $sNow = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
        $this->oxremark__oxcreate = new \OxidEsales\Eshop\Core\Field($sNow, \OxidEsales\Eshop\Core\Field::T_RAW);
        $this->oxremark__oxheader = new \OxidEsales\Eshop\Core\Field($sNow, \OxidEsales\Eshop\Core\Field::T_RAW);

        return parent::_insert();
    }