本文整理汇总了PHP中Nette\Database\Table\Selection::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Selection::update方法的具体用法?PHP Selection::update怎么用?PHP Selection::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Database\Table\Selection
的用法示例。
在下文中一共展示了Selection::update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($data, $forceRegenerateTimes = FALSE)
{
parent::update($data);
if ($forceRegenerateTimes || rand(0, 100) < 10) {
$this->generateAllTimes();
}
}
示例2: update
public function update($data)
{
$builder = $this->sqlBuilder;
$this->sqlBuilder = new SqlBuilder($this);
$this->where($this->column, $this->active);
$return = parent::update($data);
$this->sqlBuilder = $builder;
return $return;
}
示例3: update
public function update($data)
{
$where = $this->where;
$this->where[0] = "{$this->delimitedColumn} = " . $this->connection->quote($this->active);
$return = parent::update($data);
$this->where = $where;
return $return;
}
示例4: update
public function update($data, $checkData = FALSE)
{
if ($checkData) {
$coords = Geolocation::getCoordsFromText($data['map_coords']);
$data['lat'] = $coords[0];
$data['lon'] = $coords[1];
//$to_code = isset($data['locality_nickname']) ? $data['name']." ".$data['locality_nickname']." ".$data['locality_id'] : $data['name']." ".$data['locality_id'];
//$data['code'] = $data['code'] !='' ? $data['code'] : \Nette\Utils\Strings::webalize($to_code);
$data['code'] = $data['code'] != '' ? $data['code'] : \Nette\Utils\Strings::webalize($data['name']);
if (isset($data['stroller'])) {
$data['stroller'] = $data['stroller'] == 1 ? 1 : 0;
}
if (isset($data['visible'])) {
$data['visible'] = $data['visible'] == 1 ? 1 : 0;
}
if (isset($data['approved'])) {
$data['approved'] = $data['approved'] == 1 ? 1 : 0;
}
if (isset($data['ad_onhomepage'])) {
$data['ad_onhomepage'] = $data['ad_onhomepage'] == 1 ? 1 : 0;
}
if (isset($data['ad'])) {
$data['ad'] = $data['ad'] == 1 ? 1 : 0;
}
if (isset($data['show_in_catalogue'])) {
$data['show_in_catalogue'] = $data['show_in_catalogue'] == 1 ? 1 : 0;
}
if (isset($data['show_in_calendar'])) {
$data['show_in_calendar'] = $data['show_in_calendar'] == 1 ? 1 : 0;
}
$data['changed'] = new \Nette\DateTime();
//$data['ad_shire'] = isset($data['ad_shire']) && $data['ad_shire'] == 0 ? null : $data['ad_shire'];
//$data['ad_category'] = isset($data['ad_category']) && $data['ad_category'] == 0 ? null : $data['ad_category'];
$cats = $data['categories'];
unset($data['categories']);
$this->setCategories($data['id'], $cats);
}
parent::update($data);
}
示例5: update
function update($data)
{
$condition = array($this->where, $this->parameters);
$this->where[0] = "{$this->delimitedColumn} = ?";
$this->parameters[0] = $this->active;
$return = parent::update($data);
list($this->where, $this->parameters) = $condition;
return $return;
}
示例6: update
/**
* Updates all rows in result set.
*
* Joins in UPDATE are supported only in MySQL
*
* @param array|\Traversable $data ($column => $value)
* @return int number of affected rows
* @throws \Nette\InvalidArgumentException
*/
public function update($data)
{
return $this->selection->update($data);
}
示例7: update
public function update($data, $checkData = FALSE)
{
if ($checkData) {
$data['code'] = Nette\Utils\Strings::webalize($data['subject_name'] . " " . $data['name']);
}
$coords = Geolocation::getCoordsFromText($data['subject_gps']);
$data['lat'] = $coords[0];
$data['lon'] = $coords[1];
$data['last_edit_id'] = isset($this->context->user->id) ? $this->context->user->id : NULL;
parent::update($data);
}
示例8: update
public function update($data)
{
parent::update($data);
}