Inserts an Article object to this database.

@param article Object to save into database.
972356
public void add(Article article) {
		// Get Write Access
		SQLiteDatabase db = this.getWritableDatabase();

		// Build Content Values
		ContentValues values = new ContentValues();
		values.put(KEY_TAGS, TextUtils.join("_PCX_", article.getTags()));
		values.put(KEY_MEDIA_CONTENT, Article.MediaContent.toByteArray(article.getMediaContent()));
		values.put(KEY_SOURCE, article.getSource().toString());
		values.put(KEY_IMAGE, article.getImage().toString());
		values.put(KEY_TITLE, article.getTitle());
		values.put(KEY_DESCRIPTION, article.getDescription());
		values.put(KEY_CONTENT, article.getContent());
		values.put(KEY_COMMENTS, article.getComments());
		values.put(KEY_AUTHOR, article.getAuthor());
		values.put(KEY_DATE, article.getDate());
		values.put(KEY_ID, article.getId());

		// Insert & Close
		db.insert(TABLE_ARTICLES, null, values);
		db.close();
	}
173187
protected void insertText(Element e, String text) {
        $(e).materialnote("insertText", SafeHtmlUtils.fromString(text).asString());
    }
1081376
public void add(final int currentArticleID, final long startTime,
			final long endTime, final List<ArticleIndexData> infoList)
	{

		// index_articleID_rc_ts
		if (!infoList.isEmpty()) {

			StringBuilder fullRevBuffer = new StringBuilder();
			StringBuilder revCountBuffer = new StringBuilder();

			boolean first = true;
			ArticleIndexData info;
			while (!infoList.isEmpty()) {

				info = infoList.remove(0);

				if (!first) {
					fullRevBuffer.append(" ");
					revCountBuffer.append(" ");
				}

				fullRevBuffer.append(info.getFullRevisionPrimaryKey());

				revCountBuffer.append(info.getStartRevisionCount());
				revCountBuffer.append(" ");
				revCountBuffer.append(info.getEndRevisionCount());

				first = false;
			}

			boolean sql = !insertStatement.isEmpty();
			if (buffer.length() + fullRevBuffer.length()
					+ revCountBuffer.length() + 20 >= MAX_ALLOWED_PACKET) {
				storeBuffer();
			}


			if(sql) {
				if (buffer.length() > insertStatement.length()) {
					buffer.append(",");
				}
				buffer.append("(");
			}
			buffer.append(currentArticleID);
			buffer.append(",");
			buffer.append(sql?"\'":"\"");
			buffer.append(fullRevBuffer);
			buffer.append(sql?"\'":"\"");
			buffer.append(",");
			buffer.append(sql?"\'":"\"");
			buffer.append(revCountBuffer);
			buffer.append(sql?"\'":"\"");
			buffer.append(",");
			buffer.append(startTime);
			buffer.append(",");
			buffer.append(endTime);
			if(sql) {
				buffer.append(")");
			}else{
				buffer.append("\n");
			}
		}
	}
1185350
public void insert(Document document, QueryOptions options) {
        int writeConcern = 1;
        int ms = 0;
        if (options != null && (options.containsKey("w") || options.containsKey("wtimeout"))) {
            // Some info about params: http://api.mongodb.org/java/current/com/mongodb/WriteConcern.html
//            return dbCollection.insert(dbObject, new WriteConcern(options.getInt("w", 1), options.getInt("wtimeout", 0)));
            writeConcern = options.getInt("w", 1);
            ms = options.getInt("wtimeout", 0);
        }
        dbCollection.withWriteConcern(new WriteConcern(writeConcern, ms));
        dbCollection.insertOne(document);
    }
1101924
public void insert(Object object) {
        EntityManager entityManager = null;
        try {
            entityManager = entityManagers.poll();
            entityManager.getTransaction().begin();
            try {

                entityManager.persist(object);
                entityManager.getTransaction().commit();
            } catch (Exception e) {
                e.printStackTrace();
                entityManager.getTransaction().rollback();
            }
        } finally {
            if(entityManager != null)
                entityManagers.add(entityManager);
        }
    }
148813
public void insert(Entity entity) {
        if (entity.getId() == null) {
            String id = dbSqlSessionFactory.getIdGenerator().getNextId();
            entity.setId(id);
        }

        Class<? extends Entity> clazz = entity.getClass();
        if (!insertedObjects.containsKey(clazz)) {
            insertedObjects.put(clazz,
                                new LinkedHashMap<String, Entity>()); // order of insert is important, hence LinkedHashMap
        }

        insertedObjects.get(clazz).put(entity.getId(),
                                       entity);
        entityCache.put(entity,
                        false); // False -> entity is inserted, so always changed
        entity.setInserted(true);
    }
977875
void put(RowCursor cursor)
  {
    boolean isValid;

    do {
      isValid = true;
      
      try (JournalOutputStream os = openItem()) {
        os.write(CODE_PUT);
      
        cursor.writeJournal(os);
        
        isValid = os.complete();
      } catch (IOException e) {
        log.log(Level.FINER, e.toString(), e);
      }
    } while (! isValid);
  }
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();
        }
    }
877001
public function removeArticle($article)
    {
        if ($this->articles->contains($article)) {
            $this->articles->remove($article);
        }
    }
150638
public void addAttribute(String attribute)
    {
        if(this.attributes == null)
            this.attributes = new ArrayList<String>();
        this.attributes.add(attribute);
    }
556303
def create
      @article = Article.new(params[:article])

      respond_to do |format|
        if @article.save
          format.html { redirect_to edit_category_article_path(@article.category, @article), notice: 'Article was successfully created.' }
          format.json { render json: @article, status: :created, location: @article }
        else
          format.html { render action: "new", :category_id => @article.category, :id => @article }
          format.json { render json: @article.errors, status: :unprocessable_entity }
        end
      end
    end
787933
def create(self, section, article):
        
        return CRUDRequest(self).post(article, create=True, id=section)
79902
def save(self, *args, **kwargs):
        
        if self.slug is None or self.slug == "":
            self.slug = slugify(self.name)

        feature_type = super(FeatureType, self).save(*args, **kwargs)

        if self.instant_article_is_dirty:
            index_feature_type_content.delay(self.pk)

        self._db_instant_article = self.instant_article

        # Run all behaviors for `create`
        if self.is_new:
            update_feature_type_rates.delay(self.pk)

        return feature_type
769377
public function create($blogId, Article &$article)
    {
        $data = $article->exportData();
        $endpoint = '/admin/blogs/'.$blogId.'/articles.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'article' => $data
            )
        );
        $article->setData($response['article']);
    }
131300
public function importCitations($oldArticleId, $article)
    {
        $this->consoleOutput->writeln("Reading citations...");

        $citationSql = "SELECT * FROM citations WHERE assoc_id = :id";
        $citationStatement = $this->dbalConnection->prepare($citationSql);
        $citationStatement->bindValue('id', $oldArticleId);
        $citationStatement->execute();

        $orderCounter = 0;
        $citations = $citationStatement->fetchAll();
        foreach ($citations as $pkpCitation) {
            $citation = new Citation();
            $citation->setRaw(!empty($pkpCitation['raw_citation']) ? $pkpCitation['raw_citation'] : '-');
            $citation->setOrderNum(!empty($pkpCitation['seq']) ? $pkpCitation['seq'] : $orderCounter);
            $article->addCitation($citation);

            $orderCounter++;
        }
    }
997187
public function addArticleAcc()
    {
        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $aChosenArt = $this->_getActionIds('oxarticles.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        // adding
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sArtTable = $this->_getViewName('oxarticles');
            $aChosenArt = $this->_getAll(parent::_addFilter("select $sArtTable.oxid " . $this->_getQuery()));
        }

        if ($oArticle->load($soxId) && $soxId && $soxId != "-1" && is_array($aChosenArt)) {
            foreach ($aChosenArt as $sChosenArt) {
                $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
                $oNewGroup->init("oxaccessoire2article");
                $oNewGroup->oxaccessoire2article__oxobjectid = new \OxidEsales\Eshop\Core\Field($sChosenArt);
                $oNewGroup->oxaccessoire2article__oxarticlenid = new \OxidEsales\Eshop\Core\Field($oArticle->oxarticles__oxid->value);
                $oNewGroup->oxaccessoire2article__oxsort = new \OxidEsales\Eshop\Core\Field(0);
                $oNewGroup->save();
            }

            $this->onArticleAccessoryRelationChange($oArticle);
        }
    }
22525
private boolean insert(T element) {
        if (!entries.containsKey(element)) {
            head = createEntry(element, head);
            entries.put(element, head);
            return true;
        }
        return false;
    }