public function replaceOptContentTable(AbstractClassContent $content)
    {
        if (null === $content->getMainNode()) {
            return $this;
        }

        $command = 'REPLACE';
        if (!$this->replaceSupported) {
            // REPLACE command not supported, remove first then insert
            $this->removeOptContentTable($content);
            $command = 'INSERT';
        }

        $meta = $this->_em->getClassMetadata('BackBee\ClassContent\Indexes\OptContentByModified');
        $query = $command.' INTO '.$meta->getTableName().
                ' ('.$meta->getColumnName('_uid').', '.
                $meta->getColumnName('_label').', '.
                $meta->getColumnName('_classname').', '.
                $meta->getColumnName('_node_uid').', '.
                $meta->getColumnName('_modified').', '.
                $meta->getColumnName('_created').')'.
                ' VALUES (:uid, :label, :classname, :node_uid, :modified, :created)';

        $params = array(
            'uid' => $content->getUid(),
            'label' => $content->getLabel(),
            'classname' => AbstractClassContent::getShortClassname($content),
            'node_uid' => $content->getMainNode()->getUid(),
            'modified' => date('Y-m-d H:i:s', $content->getModified()->getTimestamp()),
            'created' => date('Y-m-d H:i:s', $content->getCreated()->getTimestamp()),
        );

        $types = array(
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
        );

        return $this->executeUpdate($query, $params, $types);
    }
public function replaceOptContentTable(AbstractClassContent $content)
    {
        if (null === $content->getMainNode()) {
            return $this;
        }

        $command = 'REPLACE';
        if (!$this->replaceSupported) {
            // REPLACE command not supported, remove first then insert
            $this->removeOptContentTable($content);
            $command = 'INSERT';
        }

        $meta = $this->_em->getClassMetadata('BackBee\ClassContent\Indexes\OptContentByModified');
        $query = $command.' INTO '.$meta->getTableName().
                ' ('.$meta->getColumnName('_uid').', '.
                $meta->getColumnName('_label').', '.
                $meta->getColumnName('_classname').', '.
                $meta->getColumnName('_node_uid').', '.
                $meta->getColumnName('_modified').', '.
                $meta->getColumnName('_created').')'.
                ' VALUES (:uid, :label, :classname, :node_uid, :modified, :created)';

        $params = array(
            'uid' => $content->getUid(),
            'label' => $content->getLabel(),
            'classname' => AbstractClassContent::getShortClassname($content),
            'node_uid' => $content->getMainNode()->getUid(),
            'modified' => date('Y-m-d H:i:s', $content->getModified()->getTimestamp()),
            'created' => date('Y-m-d H:i:s', $content->getCreated()->getTimestamp()),
        );

        $types = array(
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
            \Doctrine\DBAL\Connection::PARAM_STR_ARRAY,
        );

        return $this->executeUpdate($query, $params, $types);
    }
public function replaceOptContentTable ( AbstractClassContent $ content ) { if ( null === $ content -> getMainNode ( ) ) { return $ this ; } $ command = 'REPLACE' ; if ( ! $ this -> replaceSupported ) { // REPLACE command not supported, remove first then insert $ this -> removeOptContentTable ( $ content ) ; $ command = 'INSERT' ; } $ meta = $ this -> _em -> getClassMetadata ( 'BackBee\ClassContent\Indexes\OptContentByModified' ) ; $ query = $ command . ' INTO ' . $ meta -> getTableName ( ) . ' (' . $ meta -> getColumnName ( '_uid' ) . ', ' . $ meta -> getColumnName ( '_label' ) . ', ' . $ meta -> getColumnName ( '_classname' ) . ', ' . $ meta -> getColumnName ( '_node_uid' ) . ', ' . $ meta -> getColumnName ( '_modified' ) . ', ' . $ meta -> getColumnName ( '_created' ) . ')' . ' VALUES (:uid, :label, :classname, :node_uid, :modified, :created)' ; $ params = array ( 'uid' => $ content -> getUid ( ) , 'label' => $ content -> getLabel ( ) , 'classname' => AbstractClassContent :: getShortClassname ( $ content ) , 'node_uid' => $ content -> getMainNode ( ) -> getUid ( ) , 'modified' => date ( 'Y-m-d H:i:s' , $ content -> getModified ( ) -> getTimestamp ( ) ) , 'created' => date ( 'Y-m-d H:i:s' , $ content -> getCreated ( ) -> getTimestamp ( ) ) , ) ; $ types = array ( \ Doctrine \ DBAL \ Connection :: PARAM_STR_ARRAY , \ Doctrine \ DBAL \ Connection :: PARAM_STR_ARRAY , \ Doctrine \ DBAL \ Connection :: PARAM_STR_ARRAY , \ Doctrine \ DBAL \ Connection :: PARAM_STR_ARRAY , \ Doctrine \ DBAL \ Connection :: PARAM_STR_ARRAY , \ Doctrine \ DBAL \ Connection :: PARAM_STR_ARRAY , ) ; return $ this -> executeUpdate ( $ query , $ params , $ types ) ; }
Replaces content in optimized tables.

@param  AbstractClassContent $content

@return IndexationRepository
Replaces content in optimized tables .