Set article assignment
337333
public function setActionArticle()
    {
        $sArticleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxarticleid');
        $sActionId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $oDb->Execute(
            'delete from oxobject2action '
            . 'where oxactionid=' . $oDb->quote($sActionId)
            . ' and oxclass = "oxarticle"'
        );

        $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $oObject2Promotion->init('oxobject2action');
        $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($sActionId);
        $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sArticleId);
        $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxarticle");
        $oObject2Promotion->save();
    }
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();
	}
49877
def plan_to_assignment(plan):
    """"""
    assignment = {}
    for elem in plan['partitions']:
        assignment[
            (elem['topic'], elem['partition'])
        ] = elem['replicas']
    return assignment
149508
def set_extended_elements(self):
        """"""
        self.set_creative_commons()
        self.set_owner()
        self.set_subtitle()
        self.set_summary()
759293
public function assign($aRecord)
    {
        startProfile('articleAssign');

        // load object from database
        parent::assign($aRecord);

        //clear seo urls
        $this->_aSeoUrls = [];

        $this->oxarticles__oxnid = $this->oxarticles__oxid;

        // check for simple article.
        if ($this->_blSkipAssign) {
            return;
        }

        $this->_assignParentFieldValues();
        $this->_assignNotBuyableParent();

        // assign only for a first load time
        if (!$this->isLoaded()) {
            $this->_setShopValues($this);
        }

        $this->_assignStock();
        $this->_assignPersistentParam();
        $this->_assignDynImageDir();
        $this->_assignComparisonListFlag();

        stopProfile('articleAssign');
    }
1072519
def set_doc(self, doc: str):
        """"""
        self.__doc__ = doc
        if hasattr(self, 'module'):
            ref = f'{self.objtype.__name__}.{self.name}'
            self.module.__dict__['__test__'][ref] = doc
1273648
def temporary_assignment(obj, attr, value):
  """"""
  original = getattr(obj, attr, None)
  setattr(obj, attr, value)
  yield
  setattr(obj, attr, original)
87551
def _set_publication_info_field(self, field_name, value):
        """"""
        self._ensure_reference_field('publication_info', {})
        self.obj['reference']['publication_info'][field_name] = value
179481
def set_title(self, title, subtitle=''):
        """"""
        self.title = title
        self.subtitle = subtitle
35862
def setcontents(source, identifier, pointer):
    """"""
    record = Record.get_record(identifier)
    Document(record, pointer).setcontents(source)
1089982
function set(name, element, previous, attrs) {
  if (set.handlers[name]) {
    set.handlers[name](name, element, previous, attrs);
  } else if (attrs[name] != null && previous[name] !== attrs[name]) {
    element.setAttribute(name, attrs[name]);
  }
}
1108862
function unshiftArticle(summary, article) {
    article = SummaryArticle(article);

    var parts = summary.getParts();
    var part = parts.get(0) || SummaryPart();

    var articles = part.getArticles();
    articles = articles.unshift(article);
    part = part.set('articles', articles);

    parts = parts.set(0, part);
    summary = summary.set('parts', parts);

    return indexLevels(summary);
}
203606
function _setAttributes(el, attrs) {
  Object.keys(attrs).forEach((key) => {
    el.setAttribute(key, attrs[key]);
  });
}
1226665
def assign_to(self, obj):
    """"""
    obj.x = self.x
    obj.y = self.y
1247223
def set(self, media, _bytes, overwrite=True, b64encode=False):
        
        data = base64.b64encode(_bytes) if b64encode else Binary(_bytes)
        self._dokuwiki.send('wiki.putAttachment', media, data, ow=overwrite)
262125
def build_pub_dates(article, pub_dates):
    ""
    for pub_date in pub_dates:
        # always want a date type, take it from pub-type if must
        if pub_date.get('date-type'):
            date_instance = ea.ArticleDate(pub_date.get('date-type'),
                                           pub_date.get('date'))
        elif pub_date.get('pub-type'):
            date_instance = ea.ArticleDate(pub_date.get('pub-type'),
                                           pub_date.get('date'))
        # Set more values
        utils.set_attr_if_value(date_instance, 'pub_type', pub_date.get('pub-type'))
        utils.set_attr_if_value(date_instance, 'publication_format',
                                pub_date.get('publication-format'))
        utils.set_attr_if_value(date_instance, 'day', pub_date.get('day'))
        utils.set_attr_if_value(date_instance, 'month', pub_date.get('month'))
        utils.set_attr_if_value(date_instance, 'year', pub_date.get('year'))
        article.add_date(date_instance)
837423
def add_articles(self, articles):
        
        articles_data = []
        for article in articles:
            articles_data.append({
                'thumb_media_id': article['thumb_media_id'],
                'title': article['title'],
                'content': article['content'],
                'author': article.get('author', ''),
                'content_source_url': article.get('content_source_url', ''),
                'digest': article.get('digest', ''),
                'show_cover_pic': article.get('show_cover_pic', 0),
                'need_open_comment': int(article.get('need_open_comment', False)),
                'only_fans_can_comment': int(article.get('only_fans_can_comment', False)),
            })
        return self._post(
            'material/add_news',
            data={
                'articles': articles_data
            }
        )