Initializes the repository's prepared statements.

@return void
549585
public function init()
    {

        // initialize the prepared statements
        $this->productSuperLinkStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_SUPER_LINK));
    }
1026627
public function init()
    {

        // invoke the parent instance
        parent::init();

        // initialize the prepared statements
        $this->urlRewritesBySkuStmt = $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::URL_REWRITES_BY_SKU));
    }
609805
public function init()
    {

        // initialize the prepared statements
        $this->categoryDecimalsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_DECIMALS));
        $this->categoryDecimalsByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_DECIMALS_BY_PK_AND_STORE_ID));
    }
605599
protected function init()
    {
        global $wpdb;
        $this->wpdb = $wpdb;
        $this->queryGrammar = new MySqlGrammar();
        $this->postProcessor = new MySqlProcessor();
    }
1181478
public function init()
    {

        // initialize the prepared statements
        $this->productIntsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_INTS));
    }
1313558
private function initialize()
    {
        $this->pdo->exec(
            'CREATE TABLE IF NOT EXISTS `'.$this->table.'` '
            .'(id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED, INDEX(channel) USING HASH, INDEX(level) USING HASH, INDEX(time) USING BTREE)'
        );

        //Read out actual columns
        $actualFields = array();
        $rs = $this->pdo->query('SELECT * FROM `'.$this->table.'` LIMIT 0');
        for ($i = 0; $i < $rs->columnCount(); $i++) {
            $col = $rs->getColumnMeta($i);
            $actualFields[] = $col['name'];
        }

        //Calculate changed entries
        $removedColumns = array_diff(
            $actualFields,
            $this->additionalFields,
            $this->defaultfields
        );
        $addedColumns = array_diff($this->additionalFields, $actualFields);

        //Remove columns
        if (!empty($removedColumns)) {
            foreach ($removedColumns as $c) {
                $this->pdo->exec('ALTER TABLE `'.$this->table.'` DROP `'.$c.'`;');
            }
        }

        //Add columns
        if (!empty($addedColumns)) {
            foreach ($addedColumns as $c) {
                $this->pdo->exec('ALTER TABLE `'.$this->table.'` add `'.$c.'` TEXT NULL DEFAULT NULL;');
            }
        }

        // merge default and additional field to one array
        $this->defaultfields = array_merge($this->defaultfields, $this->additionalFields);

        $this->initialized = true;
    }
294763
public function init()
    {
        $digest = $this->getDigest();
        $this->digestParts = $this->parseDigest((string) $digest);
    }
687696
public function init()
    {

        // initialize the prepared statements
        $this->productVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_VARCHARS));
        $this->productVarcharByAttributeCodeAndEntityTypeIdAndStoreIdAndValueStmt =
                $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_STORE_ID_AND_VALUE));
    }
251761
public function initialize() {
        parent::initialize();

        $this->addClauses([
            self::UNION => 'UNION {flag} (%s)',
            self::USING => 'USING %s'
        ]);

        $this->addKeywords([
            self::AVG_ROW_LENGTH        => 'AVG_ROW_LENGTH',
            self::BIG_RESULT            => 'SQL_BIG_RESULT',
            self::BUFFER_RESULT         => 'SQL_BUFFER_RESULT',
            self::BTREE                 => 'BTREE',
            self::CACHE                 => 'SQL_CACHE',
            self::CONNECTION            => 'CONNECTION',
            self::DATA_DIRECTORY        => 'DATA DIRECTORY',
            self::DEFAULT_CHARACTER_SET => 'DEFAULT CHARACTER SET',
            self::DEFAULT_COMMENT       => 'DEFAULT COMMENT',
            self::DELAYED               => 'DELAYED',
            self::DELAY_KEY_WRITE       => 'DELAY_KEY_WRITE',
            self::DISTINCT_ROW          => 'DISTINCTROW',
            self::FOR_UPDATE_LOCK       => 'FOR UPDATE',
            self::FULLTEXT              => 'FULLTEXT',
            self::HASH                  => 'HASH',
            self::HIGH_PRIORITY         => 'HIGH_PRIORITY',
            self::INDEX_DIRECTORY       => 'INDEX DIRECTORY',
            self::INSERT_METHOD         => 'INSERT_METHOD',
            self::KEY_BLOCK_SIZE        => 'KEY_BLOCK_SIZE',
            self::LOW_PRIORITY          => 'LOW_PRIORITY',
            self::MAX_ROWS              => 'MAX_ROWS',
            self::MIN_ROWS              => 'MIN_ROWS',
            self::NO_CACHE              => 'SQL_NO_CACHE',
            self::PACK_KEYS             => 'PACK_KEYS',
            self::QUICK                 => 'QUICK',
            self::ROW_FORMAT            => 'ROW_FORMAT',
            self::SHARED_LOCK           => 'LOCK IN SHARE MODE',
            self::SMALL_RESULT          => 'SQL_SMALL_RESULT',
            self::SPATIAL               => 'SPATIAL',
            self::STATS_AUTO_RECALC     => 'STATS_AUTO_RECALC',
            self::STATS_PERSISTENT      => 'STATS_PERSISTENT',
            self::UNIQUE                => 'UNIQUE'
        ]);

        $this->addStatements([
            Query::INSERT        => new Statement('INSERT {priority} {ignore} INTO {table} {fields} VALUES {values}'),
            Query::SELECT        => new Statement('SELECT {distinct} {priority} {optimize} {cache} {fields} FROM {table} {joins} {where} {groupBy} {having} {compounds} {orderBy} {limit} {lock}'),
            Query::UPDATE        => new Statement('UPDATE {priority} {ignore} {table} {joins} SET {fields} {where} {orderBy} {limit}'),
            Query::DELETE        => new Statement('DELETE {priority} {quick} {ignore} FROM {table} {joins} {where} {orderBy} {limit}'),
            Query::TRUNCATE      => new Statement('TRUNCATE {table}'),
            Query::CREATE_TABLE  => new Statement("CREATE {temporary} TABLE IF NOT EXISTS {table} (\n{columns}{keys}\n) {options}"),
            Query::CREATE_INDEX  => new Statement('CREATE {type} INDEX {index} ON {table} ({fields}) {using}'),
            Query::DROP_TABLE    => new Statement('DROP {temporary} TABLE IF EXISTS {table}'),
            Query::DROP_INDEX    => new Statement('DROP INDEX {index} ON {table}')
        ]);
    }
265721
public function init()
    {

        // initialize the prepared statements
        $this->customerAddressDecimalsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_DECIMALS));
    }
374371
public function init()
    {

        // initialize the prepared statements
        $this->customerAddressTextsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_TEXTS));
    }
314811
public function init()
    {

        // initialize the prepared statements
        $this->productSuperAttributeLabelStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_SUPER_ATTRIBUTE_LABEL));
    }
493367
protected function prepareStatements()
    {
        if (!empty($this->statements)) {
            return;
        }
        $this->statements['load'] = $this->db->prepare(
            'SELECT * FROM `' . $this->options['table'] . '` WHERE `userId` = :userId '
            . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'
        );

        $this->statements['save'] = $this->db->prepare(
            'INSERT INTO `' .
            $this->options['table'] .
            '` (`userId`, `scope`, `name`, `args`, `cachedUntil`, `xml`) VALUES ' .
            '(:userId, :scope, :name, :args, :cachedUntil, :xml)'
        );

        $this->statements['delete'] = $this->db->prepare(
            'DELETE FROM`' . $this->options['table'] . '` WHERE `userId` = :userId '
            . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'
        );
    }
974644
private void prepareStatements() throws DatabaseException {
        for (PreparedStatementCveDb key : values()) {
            PreparedStatement preparedStatement = null;
            try {
                final String statementString = statementBundle.getString(key.name());
                if (key == INSERT_VULNERABILITY || key == INSERT_CPE) {
                    preparedStatement = connection.prepareStatement(statementString, new String[]{"id"});
                } else {
                    preparedStatement = connection.prepareStatement(statementString);
                }
            } catch (SQLException ex) {
                throw new DatabaseException(ex);
            } catch (MissingResourceException ex) {
                if (!ex.getMessage().contains("key MERGE_PROPERTY")) {
                    throw new DatabaseException(ex);
                }
            }
            if (preparedStatement != null) {
                preparedStatements.put(key, preparedStatement);
            }
        }
    }
759689
public function init()
    {
        $this->renameTableQueries = array();
        $this->dropCheckQueries = array();
        $this->dropForeignKeyQueries = array();
        $this->dropIndexQueries = array();
        $this->dropPrimaryKeyQueries = array();
        $this->dropColumnQueries = array();
        $this->alterColumnQueries = array();
        $this->createColumnQueries = array();
        $this->createPrimaryKeyQueries = array();
        $this->createIndexQueries = array();
        $this->createForeignKeyQueries = array();
        $this->createCheckQueries = array();
    }
824293
public function init()
    {
        $this->fillFromConfig([
            'buttons',
            'search',
        ]);

        /*
         * Prepare the search widget (optional)
         */
        if (isset($this->search)) {

            if (is_string($this->search)) {
                $searchConfig = $this->makeConfig(['partial' => $this->search]);
            }
            else {
                $searchConfig = $this->makeConfig($this->search);
            }

            $searchConfig->alias = $this->alias . 'Search';
            $this->searchWidget = $this->makeWidget('Backend\Widgets\Search', $searchConfig);
            $this->searchWidget->bindToController();
        }
    }
431436
public function prepare()
    {
        if (null === $this->statement) {
            $this->statement = $this->db->prepare($this->getSql());
        }

        return $this;
    }