public function onCreateTable(\Extasy\ORM\QueryBuilder $queryBuilder) { $queryBuilder->addFields(sprintf('`%s` int not null default 0', $this->szFieldName)); if (!empty($this->fieldInfo['index'])) { $queryBuilder->addFields(sprintf('index `search_%s` (`%s`)', $this->szFieldName, $this->szFieldName)); } }
public function onUpdate(\Extasy\ORM\QueryBuilder $query) { $query->setSet($this->szFieldName, serialize($this->aValue)); }
public function onCreateTable(\Extasy\ORM\QueryBuilder $queryBuilder) { $queryBuilder->addFields(sprintf('`%s` int not null default 0', $this->szFieldName)); }
public function Update(\Extasy\ORM\QueryBuilder $query) { $query->setSet($this->szFieldName, $this->aValue); $this->generateImage(); }
public function onCreateTable(\Extasy\ORM\QueryBuilder $queryBuilder) { $queryBuilder->addFields(sprintf('`%s` int not null auto_increment', $this->szFieldName)); $queryBuilder->addFields(sprintf('primary key (`%s`) ', $this->szFieldName)); $queryBuilder->setTableOptions('AUTO_INCREMENT=1'); }
function onUpdate(\Extasy\ORM\QueryBuilder $query) { $this->formatValue(); // $query->setSet($this->szFieldName, $this->aValue); }
public function createDatabaseTable($dropTable = false) { $fields = static::getFieldsInfo(); if ($dropTable) { $sql = sprintf('DROP TABLE IF EXISTS `%s`', $fields['table']); DB::post($sql); } $queryBuilder = new \Extasy\ORM\QueryBuilder('create'); $queryBuilder->setTableName($fields['table']); foreach ($this->columns as $column) { $column->onCreateTable($queryBuilder); } $sql = $queryBuilder->prepare(); DB::post($sql); }
function onUpdate(\Extasy\ORM\QueryBuilder $query) { $this->aValue = $this->calculateValue(); $query->setSet($this->szFieldName, $this->aValue); }
public function delete() { $queryBuilder = new QueryBuilder('delete'); $queryBuilder->setFrom(static::getTableName()); foreach ($this->columns as $column) { $column->onDelete($queryBuilder); } $sql = $queryBuilder->prepare(); DB::post($sql); EventController::callEvent('document_delete', $this); // unset all columns foreach ($this->columns as $key => $row) { unset($this->columns[$key]); } $this->columns = []; }
/** * (non-PHPdoc) * @see \Extasy\Columns\BaseColumn::onInsert() */ function onInsert(\Extasy\ORM\QueryBuilder $query) { $values = serialize($this->aValue); $query->setSet($this->szFieldName, $this->aValue); }
/** * */ public function onUpdate(\Extasy\ORM\QueryBuilder $query) { $value = $this->getSerializedValue(); $query->setSet($this->szFieldName, $value); }
public function onCreateTable(\Extasy\ORM\QueryBuilder $queryBuilder) { $queryBuilder->addFields(sprintf('`%s` datetime not null default "0000-00-00 00:00:00"', $this->szFieldName)); }
public function onCreateTable(\Extasy\ORM\QueryBuilder $queryBuilder) { $queryBuilder->addFields(sprintf('`%s` bool not null default 0', $this->szFieldName)); $queryBuilder->addFields(sprintf('index `search_%s` (`%s`)', $this->szFieldName, $this->szFieldName)); }