Наследование: extends eZ\Publish\Core\Persistence\Database\Query
Пример #1
0
 /**
  * Sets field (ezcontentobject_attribute) values to the given query.
  *
  * @param \eZ\Publish\Core\Persistence\Database\InsertQuery $q
  * @param Content $content
  * @param Field $field
  * @param StorageFieldValue $value
  */
 protected function setInsertFieldValues(InsertQuery $q, Content $content, Field $field, StorageFieldValue $value)
 {
     $q->insertInto($this->dbHandler->quoteTable('ezcontentobject_attribute'))->set($this->dbHandler->quoteColumn('contentobject_id'), $q->bindValue($content->versionInfo->contentInfo->id, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('contentclassattribute_id'), $q->bindValue($field->fieldDefinitionId, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('data_type_string'), $q->bindValue($field->type))->set($this->dbHandler->quoteColumn('language_code'), $q->bindValue($field->languageCode))->set($this->dbHandler->quoteColumn('version'), $q->bindValue($field->versionNo, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('data_float'), $q->bindValue($value->dataFloat))->set($this->dbHandler->quoteColumn('data_int'), $q->bindValue($value->dataInt, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('data_text'), $q->bindValue($value->dataText))->set($this->dbHandler->quoteColumn('sort_key_int'), $q->bindValue($value->sortKeyInt, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('sort_key_string'), $q->bindValue(mb_substr($value->sortKeyString, 0, 255)))->set($this->dbHandler->quoteColumn('language_id'), $q->bindValue($this->languageMaskGenerator->generateLanguageIndicator($field->languageCode, $this->isLanguageAlwaysAvailable($content, $field->languageCode)), null, \PDO::PARAM_INT));
 }
Пример #2
0
 /**
  * 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 \eZ\Publish\Core\Persistence\Database\InsertQuery $insertQuery
  * @param VersionInfo $versionInfo
  * @param Field $field
  *
  * @return void
  */
 protected function setInsertColumns(InsertQuery $insertQuery, VersionInfo $versionInfo, Field $field)
 {
     $connection = $this->getConnection();
     $insertQuery->set($connection->quoteColumn('contentobject_attribute_id'), $insertQuery->bindValue($field->id, null, \PDO::PARAM_INT))->set($connection->quoteColumn('filename'), $insertQuery->bindValue($this->removeMimeFromPath($field->value->externalData['id'])))->set($connection->quoteColumn('mime_type'), $insertQuery->bindValue($field->value->externalData['mimeType']))->set($connection->quoteColumn('original_filename'), $insertQuery->bindValue($field->value->externalData['fileName']))->set($connection->quoteColumn('version'), $insertQuery->bindValue($versionInfo->versionNo, null, \PDO::PARAM_INT));
 }