protected function insertTagKeywords($tagId, array $keywords, $mainLanguageCode, $alwaysAvailable)
    {
        foreach ($keywords as $languageCode => $keyword) {
            $query = $this->handler->createInsertQuery();
            $query
                ->insertInto($this->handler->quoteTable('eztags_keyword'))
                ->set(
                    $this->handler->quoteColumn('keyword_id'),
                    $query->bindValue($tagId, null, PDO::PARAM_INT)
                )->set(
                    $this->handler->quoteColumn('language_id'),
                    $query->bindValue(
                        $this->languageHandler->loadByLanguageCode(
                            $languageCode
                        )->id + (int) ($languageCode === $mainLanguageCode && $alwaysAvailable),
                        null,
                        PDO::PARAM_INT
                    )
                )->set(
                    $this->handler->quoteColumn('keyword'),
                    $query->bindValue($keyword, null, PDO::PARAM_STR)
                )->set(
                    $this->handler->quoteColumn('locale'),
                    $query->bindValue($languageCode, null, PDO::PARAM_STR)
                )->set(
                    $this->handler->quoteColumn('status'),
                    $query->bindValue(1, null, PDO::PARAM_INT)
                );

            $query->prepare()->execute();
        }
    }
protected function insertTagKeywords($tagId, array $keywords, $mainLanguageCode, $alwaysAvailable)
    {
        foreach ($keywords as $languageCode => $keyword) {
            $query = $this->handler->createInsertQuery();
            $query
                ->insertInto($this->handler->quoteTable('eztags_keyword'))
                ->set(
                    $this->handler->quoteColumn('keyword_id'),
                    $query->bindValue($tagId, null, PDO::PARAM_INT)
                )->set(
                    $this->handler->quoteColumn('language_id'),
                    $query->bindValue(
                        $this->languageHandler->loadByLanguageCode(
                            $languageCode
                        )->id + (int) ($languageCode === $mainLanguageCode && $alwaysAvailable),
                        null,
                        PDO::PARAM_INT
                    )
                )->set(
                    $this->handler->quoteColumn('keyword'),
                    $query->bindValue($keyword, null, PDO::PARAM_STR)
                )->set(
                    $this->handler->quoteColumn('locale'),
                    $query->bindValue($languageCode, null, PDO::PARAM_STR)
                )->set(
                    $this->handler->quoteColumn('status'),
                    $query->bindValue(1, null, PDO::PARAM_INT)
                );

            $query->prepare()->execute();
        }
    }
protected function insertTagKeywords ( $ tagId , array $ keywords , $ mainLanguageCode , $ alwaysAvailable ) { foreach ( $ keywords as $ languageCode => $ keyword ) { $ query = $ this -> handler -> createInsertQuery ( ) ; $ query -> insertInto ( $ this -> handler -> quoteTable ( 'eztags_keyword' ) ) -> set ( $ this -> handler -> quoteColumn ( 'keyword_id' ) , $ query -> bindValue ( $ tagId , null , PDO :: PARAM_INT ) ) -> set ( $ this -> handler -> quoteColumn ( 'language_id' ) , $ query -> bindValue ( $ this -> languageHandler -> loadByLanguageCode ( $ languageCode ) -> id + ( int ) ( $ languageCode === $ mainLanguageCode && $ alwaysAvailable ) , null , PDO :: PARAM_INT ) ) -> set ( $ this -> handler -> quoteColumn ( 'keyword' ) , $ query -> bindValue ( $ keyword , null , PDO :: PARAM_STR ) ) -> set ( $ this -> handler -> quoteColumn ( 'locale' ) , $ query -> bindValue ( $ languageCode , null , PDO :: PARAM_STR ) ) -> set ( $ this -> handler -> quoteColumn ( 'status' ) , $ query -> bindValue ( 1 , null , PDO :: PARAM_INT ) ) ; $ query -> prepare ( ) -> execute ( ) ; } }
Inserts keywords for tag with provided tag ID.

@param mixed $tagId
@param array $keywords
@param string $mainLanguageCode
@param bool $alwaysAvailable
Inserts keywords for tag with provided tag ID .