Insert a new item into the tree

@param \rstoetter\libsqlphp\cKEY_COLUMN_USAGE_Entry $obj the new item with key column data where we take the data from we need
496057
public function InsertRelation( \rstoetter\libsqlphp\cKEY_COLUMN_USAGE_Entry $obj ) {

        if ( is_null( $obj->m_TABLE_NAME ) ) {
            die( "\n cKEY_COLUMN_USAGE_Entry mit is_null( m_TABLE_NAME ) " );
        }
	
        $obj_found = $this->SearchByKey( $obj->m_TABLE_NAME );
        if ( $obj_found === false ) {            
        
            // if the referencing table does not exist, then insert it in the tree
        
            $obj_new = new cKeyColumnUsageTreeNode( $obj->m_TABLE_NAME );
            
            if ( ! is_null( $obj->m_REFERENCED_TABLE_NAME ) ) {
                $obj_new->GetData( )->AddReferredTableName( $obj->m_REFERENCED_TABLE_NAME );
            }
            
            $this->InsertNode( $obj_new );
            
		} else {
		
            // if the referencing table does exist, then update its references
		
            if ( ! is_null( $obj->m_REFERENCED_TABLE_NAME ) ) {
                $obj_found->GetData( )->AddReferredTableName( $obj->m_REFERENCED_TABLE_NAME );
            }
		}
		
		// if the target table does not exist, then insert it in the tree
		
		if ( ! is_null( $obj->m_REFERENCED_TABLE_NAME ) ) {
		
            $obj_ref = $this->SearchByKey( $obj->m_REFERENCED_TABLE_NAME );
            if ( $obj_ref === false ) {            
                $obj_new = new cKeyColumnUsageTreeNode( $obj->m_REFERENCED_TABLE_NAME );
                $this->InsertNode( $obj_new );
            }
		}
		
	}
1030960
public function addObject($object)
    {
        $item = $this
            ->transformer
            ->toItem($object);

        if ($item instanceof Item) {
            $this->addItem($item);
        }
    }
51666
public boolean add(Object obj) {
        if (obj == null) {
            obj = NULL;
        }

        Entry tab[] = mTable;
        int hash = hashCode(obj);
        int index = (hash & 0x7FFFFFFF) % tab.length;

        for (Entry e = tab[index], prev = null; e != null; e = e.mNext) {
            Object iobj = e.get();
            if (iobj == null) {
                // Clean up after a cleared Reference.
                if (prev != null) {
                    prev.mNext = e.mNext;
                }
                else {
                    tab[index] = e.mNext;
                }
                mCount--;
            }
            else if (e.mHash == hash &&
                     obj.getClass() == iobj.getClass() &&
                     equals(obj, iobj)) {
                // Already in set.
                return false;
            }
            else {
                prev = e;
            }
        }

        if (mCount >= mThreshold) {
            // Cleanup the table if the threshold is exceeded.
            cleanup();
        }

        if (mCount >= mThreshold) {
            // Rehash the table if the threshold is still exceeded.
            rehash();
            tab = mTable;
            index = (hash & 0x7FFFFFFF) % tab.length;
        }

        // Create a new entry.
        tab[index] = new Entry((obj == NULL ? new Null() : obj), hash, tab[index]);
        mCount++;
        return true;
    }
1359607
public function add($obj, $option = [])
    {
        $this->bundle[] = $obj;

        $input_dim = $this->last_dimension ?? $option['input_dim'];
        $obj->init($input_dim, $option);
        $this->last_dimension = $obj->getOutputDim();
    }
554330
public function initializeObject($obj)
    {
        if ($obj instanceof Proxy) {
            $obj->__load();
        } elseif ($obj instanceof PersistentCollectionInterface) {
            $obj->initialize();
        }
    }
670880
protected function _insert()
    {
        // set subscription date
        $this->oxnewssubscribed__oxsubscribed = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s'), \OxidEsales\Eshop\Core\Field::T_RAW);

        return parent::_insert();
    }
835281
protected void addEntry (E entry)
    {
        if (_entryFilter == null || _entryFilter.apply(entry)) {
            int index = _keys.insertSorted(getKey(entry));
            _table.insertDatum(entry, index);
        }
    }
61262
static function alter($obj)
    {
        $tabela            = strtolower(FuncoesReflections::pegaNomeClasseObjeto($obj));
        $atributosTabela   = FuncoesReflections::pegaAtributosDoObjeto($obj);
        $annotationsTabela = Annotations::getAnnotation($obj);
        $arrFormatado      = [];
        $arrFinal          = [];
        $stringAlterTable  = "";
        for ($i = 0; $i < count($atributosTabela); $i++) {
            for ($j = 0; $j < count($annotationsTabela[$atributosTabela[$i]]); $j++) {
                $arrAtual = explode("=", $annotationsTabela[$atributosTabela[$i]][$j]);
                for ($k = 0; $k < count($arrAtual) - 1; $k++) {
                    $arrFormatado[FuncoesString::substituiOcorrenciasDeUmaString($arrAtual[$k], "@_", "")] = $arrAtual[$k + 1];
                }
            }

            $arrFinal[$i] = $arrFormatado;
        }

        $stringAlterTable .= "ALTER TABLE $tabela \n";
        $primKey = false;
        $columnPrimaryKey = "";

        $columnsTabela = self::columns($tabela);

        $arrayCamposTabela = [];
        for ($i = 0; $i < count($columnsTabela); $i++) {
            array_push($arrayCamposTabela, $columnsTabela[$i]['Field']);
        }

        $arrayDiff = array_diff($atributosTabela, $arrayCamposTabela);
        $arrayDiff = array_values($arrayDiff);

        $stringSql = $stringAlterTable;
        for ($j = 0; $j < count($arrayDiff); $j++) {
            if ($j != count($arrayDiff) - 1) {
                $stringSql .= "ADD " . $arrayDiff[$j];
            } else {
                $stringSql .= "ADD " . $arrayDiff[$j];
            }
            if (array_key_exists('type', $arrFormatado)) {

                $stringSql .= " " . $arrFormatado['type'] . "";

            } else {
                $stringSql .= "";
            }

            if (array_key_exists('size', $arrFormatado)) {

                $stringSql .= "(" . $arrFormatado['size'] . ") ";

            } else {
                $stringSql .= "";
            }

            /**
             * @todo NOT NULL AQUI
            */

            if (array_key_exists('notNull', $arrFormatado)) {
                if ($arrFormatado['notNull'] === "true") {
                    $stringSql .= " NOT NULL ";
                } else {
                    $stringSql .= "";
                };
            } else {
                $stringSql .= "";
            }

            if (array_key_exists('primaryKey', $arrFormatado)) {
                if ($arrFormatado['primaryKey'] === "true") {
                    $stringSql .= " PRIMARY KEY ";
                } else {
                    $stringSql .= "";
                };
            } else {
                $stringSql .= "";
            }

            if (array_key_exists('autoIncrement', $arrFormatado)) {
                if ($arrFormatado['autoIncrement'] === "true") {
                    $stringSql .= " AUTO_INCREMENT ";
                } else {
                    $stringSql .= "";
                };
            } else {
                $stringSql .= "";
            }

            $fileContent = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false;
            if ($fileContent) {
                $pdo = self::getConnection()->prepare($stringSql);
                $pdo->execute();
            }
        }

        $columnsTabela = self::columns($tabela);
        for ($i = 0; $i < count($arrFinal); $i++) {
            if ($columnsTabela[$i]['Field'] != $atributosTabela[$i]) {
                $stringAlterTable .= "CHANGE `" . $columnsTabela[$i]['Field'] . "` `$atributosTabela[$i]` ";
                $stringAlterTable .= strtoupper($arrFinal[$i]['type']) . "(" . $arrFinal[$i]['size'] . ")\n";

                if ($arrFinal[$i])

                    if ($i != count($arrFinal) - 1) {
                        $stringAlterTable .= ", \n";
                    }
            } else {
                $stringAlterTable .= "CHANGE  `$atributosTabela[$i]` `$atributosTabela[$i]` ";

                $stringAlterTable .= strtoupper($arrFinal[$i]['type']) . "(" . $arrFinal[$i]['size'] . ")";

                $respIfNotNull = $columnsTabela[$i]['Null'] == 'NO' ? 'false' : 'true';

                if ($arrFinal[$i]['notNull'] == $respIfNotNull) {
                    $stringAlterTable .= " NOT NULL ";
                } else {
                    $stringAlterTable .= " NULL ";
                }

                if (array_key_exists('default', $arrFinal[$i]) && $arrFinal[$i]['default'] != "none") {
                    $stringAlterTable .= "DEFAULT '" . $arrFinal[$i]['default'] . "'";
                }

                if (array_key_exists('autoIncrement', $arrFinal[$i]) && $arrFinal[$i]['autoIncrement'] != "false") {
                    $stringAlterTable .= " AUTO_INCREMENT ";
                }

                $stringAlterTable .= ", \n";

                if ($arrFinal[$i]['primaryKey'] == "true" and $primKey != true) {
                    $primKey = true;
                    $columnPrimaryKey = $atributosTabela[$i];
                }
                if ($i == count($arrFinal) - 1) {
                    if ($primKey) {
                        $stringAlterTable .= " DROP PRIMARY KEY, ADD PRIMARY KEY(`$columnPrimaryKey`);";
                    } else {
                        $stringAlterTable .= " DROP PRIMARY KEY";
                    }
                }
            }
        }

        $jsonFile = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false;
        if ($jsonFile) {
            $pdo = self::getConnection()->prepare($stringAlterTable);
            if ($pdo->execute()) {
                return true;
            };
        } else {
            return $stringAlterTable;
        }
        return false;
    }
89819
protected void insertLeafEntry(E entry) {
    lastInsertedEntry = entry;
    // choose subtree for insertion
    IndexTreePath<E> subtree = choosePath(getRootPath(), entry, height, 1);

    if(getLogger().isDebugging()) {
      getLogger().debugFine("insertion-subtree " + subtree);
    }

    N parent = getNode(subtree.getEntry());
    parent.addLeafEntry(entry);
    writeNode(parent);

    // adjust the tree from subtree to root
    adjustTree(subtree);
  }
1069432
private function applyTransaction($obj)
    {
        if(null !== $this->str_next_transaction) {
            $obj->setTransaction($this->str_next_transaction);
            $this->str_next_transaction = null;
        }
        return $obj;
    }
672451
public function add($entry)
    {
        $this->log[] = $entry;
        while (count($this->log) > $this->size) {
            array_shift($this->log);
        }
    }
1197834
def addEntry(self, key='', value=''):
        
        img = resources.find('img/close.png')
        new_item = XTreeWidgetItem()
        new_item.setText(1, nativestring(key))
        new_item.setText(2, nativestring(value))
        new_item.setIcon(0, QtGui.QIcon(img))
        new_item.setFixedHeight(22)
        self.insertTopLevelItem(self.topLevelItemCount() - 1, new_item)
        
        return new_item
1007387
def insert_object(self, db_object):
        
        # Create object using the  to_dict() method.
        obj = self.to_dict(db_object)
        obj['active'] = True
        self.collection.insert_one(obj)
257440
public void insert(E entry, boolean withPreInsert) {
    final Logging log = getLogger();
    if(log.isDebugging()) {
      log.debugFine("insert " + entry.getRoutingObjectID());
    }

    if(!initialized) {
      initialize(entry);
    }

    // choose subtree for insertion
    IndexTreePath<E> subtree = settings.insertStrategy.choosePath(this, entry);
    if(log.isDebugging()) {
      log.debugFine("insertion-subtree " + subtree);
    }

    // determine parent distance
    E parentEntry = subtree.getEntry();
    entry.setParentDistance(distance(parentEntry.getRoutingObjectID(), entry.getRoutingObjectID()));

    // create leaf entry and do pre insert
    if(withPreInsert) {
      preInsert(entry);
    }

    // get parent node
    N parent = getNode(parentEntry);
    parent.addLeafEntry(entry);
    writeNode(parent);

    // adjust the tree from subtree to root
    adjustTree(subtree);

    // test
    if(EXTRA_INTEGRITY_CHECKS) {
      getRoot().integrityCheck(this, getRootEntry());
    }
  }
262062
public function before_insert(Orm\Model $obj)
	{
		if ($obj instanceof SortableInterface)
		{
			$max = $obj->getSortMax();
		}
		else
		{
			$max = $obj->query()->max($this->_property);
		}

		$obj->{$this->_property} = $max + $this->_offset;
	}
320528
public void add(final Object obj) {
		final Class<?> clazz = obj.getClass();

		if (this.clazzes.contains(clazz)) {
			throw new IllegalArgumentException(
					"Only one class-instance per benchmark allowed");
		} else {
			this.clazzes.add(clazz);
			this.objects.add(obj);
		}
	}
728151
private function array_insert(mixed $object, string $key, int $position) : void
    {
        if (0 == count($this->members)) {
            // The array is empty so just add the item
            $this->members[$key] = $object;
        } elseif ($position == count($this->members)) {
            // The item goes at the end of the array
            $this->members[$key] = $object;
        } else {
            $this->members = array_slice($this->members, 0, $position,
                    true) + array($key => $object) + array_slice($this->members, $position, null, true);
        }
    }