public function onSubmitCallback(DataContainer $dc)
    {
        // Schedule a news feed update
        if ('tl_news_category' === $dc->table && $dc->id) {
            /** @var Model $modelAdapter */
            $modelAdapter = $this->framework->getAdapter(Model::class);

            $newsIds = $modelAdapter->getReferenceValues('tl_news', 'categories', $dc->id);
            $newsIds = \array_map('intval', \array_unique($newsIds));

            if (\count($newsIds) > 0) {
                $archiveIds = $this->db
                    ->executeQuery('SELECT DISTINCT(pid) FROM tl_news WHERE id IN ('.\implode(',', $newsIds).')')
                    ->fetchAll(\PDO::FETCH_COLUMN, 0);

                $session = $this->session->get('news_feed_updater');
                $session = \array_merge((array) $session, $archiveIds);
                $this->session->set('news_feed_updater', \array_unique($session));
            }
        }
    }
public function onSubmitCallback(DataContainer $dc)
    {
        // Schedule a news feed update
        if ('tl_news_category' === $dc->table && $dc->id) {
            /** @var Model $modelAdapter */
            $modelAdapter = $this->framework->getAdapter(Model::class);

            $newsIds = $modelAdapter->getReferenceValues('tl_news', 'categories', $dc->id);
            $newsIds = \array_map('intval', \array_unique($newsIds));

            if (\count($newsIds) > 0) {
                $archiveIds = $this->db
                    ->executeQuery('SELECT DISTINCT(pid) FROM tl_news WHERE id IN ('.\implode(',', $newsIds).')')
                    ->fetchAll(\PDO::FETCH_COLUMN, 0);

                $session = $this->session->get('news_feed_updater');
                $session = \array_merge((array) $session, $archiveIds);
                $this->session->set('news_feed_updater', \array_unique($session));
            }
        }
    }
public function onSubmitCallback ( DataContainer $ dc ) { // Schedule a news feed update if ( 'tl_news_category' === $ dc -> table && $ dc -> id ) { /** @var Model $modelAdapter */ $ modelAdapter = $ this -> framework -> getAdapter ( Model :: class ) ; $ newsIds = $ modelAdapter -> getReferenceValues ( 'tl_news' , 'categories' , $ dc -> id ) ; $ newsIds = \ array_map ( 'intval' , \ array_unique ( $ newsIds ) ) ; if ( \ count ( $ newsIds ) > 0 ) { $ archiveIds = $ this -> db -> executeQuery ( 'SELECT DISTINCT(pid) FROM tl_news WHERE id IN (' . \ implode ( ',' , $ newsIds ) . ')' ) -> fetchAll ( \ PDO :: FETCH_COLUMN , 0 ) ; $ session = $ this -> session -> get ( 'news_feed_updater' ) ; $ session = \ array_merge ( ( array ) $ session , $ archiveIds ) ; $ this -> session -> set ( 'news_feed_updater' , \ array_unique ( $ session ) ) ; } } }
On data container submit callback.

@param DataContainer $dc
On data container submit callback .