This method is intended to be overwritten by derived classes in order to
add additional columns to be set in the database. Please do not forget
to call the parent when overwriting this method.
protected setInsertColumns ( eZ\Publish\Core\Persistence\Database\InsertQuery $insertQuery, eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo, eZ\Publish\SPI\Persistence\Content\Field $field ) | ||
$insertQuery | eZ\Publish\Core\Persistence\Database\InsertQuery | |
$versionInfo | eZ\Publish\SPI\Persistence\Content\VersionInfo | |
$field | eZ\Publish\SPI\Persistence\Content\Field |
/** * Sets the required insert columns to $selectQuery. * * This method is intended to be overwritten by derived classes in order to * add additional columns to be set in the database. Please do not forget * to call the parent when overwriting this method. * * @param \ezcQueryInsert $insertQuery * @param VersionInfo $versionInfo * @param Field $field * * @return void */ protected function setInsertColumns(InsertQuery $insertQuery, VersionInfo $versionInfo, Field $field) { $connection = $this->getConnection(); parent::setInsertColumns($insertQuery, $versionInfo, $field); $insertQuery->set($connection->quoteColumn('download_count'), $insertQuery->bindValue($field->value->externalData['downloadCount'], null, \PDO::PARAM_INT)); }
/** * Sets the required insert columns to $selectQuery. * * This method is intended to be overwritten by derived classes in order to * add additional columns to be set in the database. Please do not forget * to call the parent when overwriting this method. * * @param \ezcQueryInsert $insertQuery * @param VersionInfo $versionInfo * @param Field $field * * @return void */ protected function setInsertColumns(InsertQuery $insertQuery, VersionInfo $versionInfo, Field $field) { $connection = $this->getConnection(); parent::setInsertColumns($insertQuery, $versionInfo, $field); $insertQuery->set($connection->quoteColumn('controls'), $insertQuery->bindValue(''))->set($connection->quoteColumn('has_controller'), $insertQuery->bindValue((int) $field->value->externalData['hasController'], null, \PDO::PARAM_INT))->set($connection->quoteColumn('height'), $insertQuery->bindValue((int) $field->value->externalData['height'], null, \PDO::PARAM_INT))->set($connection->quoteColumn('is_autoplay'), $insertQuery->bindValue((int) $field->value->externalData['autoplay'], null, \PDO::PARAM_INT))->set($connection->quoteColumn('is_loop'), $insertQuery->bindValue((int) $field->value->externalData['loop'], null, \PDO::PARAM_INT))->set($connection->quoteColumn('pluginspage'), $insertQuery->bindValue(''))->set($connection->quoteColumn('quality'), $insertQuery->bindValue('high'))->set($connection->quoteColumn('width'), $insertQuery->bindValue((int) $field->value->externalData['width'], null, \PDO::PARAM_INT)); }