当前位置: 首页>>代码示例>>PHP>>正文


PHP Table\Selection类代码示例

本文整理汇总了PHP中Nette\Database\Table\Selection的典型用法代码示例。如果您正苦于以下问题:PHP Selection类的具体用法?PHP Selection怎么用?PHP Selection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Selection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: appendLimit

 static function appendLimit(Nette\Database\Table\Selection &$query, $limit = NULL, $offset = NULL)
 {
     if (!is_null($limit)) {
         $query->limit($limit, $offset);
     }
     return $query;
 }
开发者ID:trejjam,项目名称:utils,代码行数:7,代码来源:BaseQuery.php

示例2: filterSection

 /**
  * @param Selection $context
  * @param int $sectionId
  * @param string $via [optional]
  * @return Selection
  */
 public function filterSection(Selection $context, $sectionId, $via = '')
 {
     $context->alias($this->sectionTableName, 'alternate_section');
     $filterFactory = new Filter\Factory($this->sectionTableName);
     $nFilter = $filterFactory->createN($context);
     $nFilter->setup('id', $sectionId)->via("{$via}:page_has_section");
     $nFilter->setup('id', $sectionId, 'alternate_section')->via($via);
     return $nFilter->build();
 }
开发者ID:kysela-petr,项目名称:generator-kysela,代码行数:15,代码来源:PageFilter.php

示例3: setModel

 /**
  * Nastavi model
  * @param Nette\Database\Table\Selection
  */
 public function setModel(\Nette\Database\Table\Selection $model)
 {
     if (isset($this->filter['email']) && $this->filter['email'] != '') {
         $model->where('adress REGEXP ?', $this->filter['email']);
     }
     if (isset($this->filter['subject']) && $this->filter['subject'] != '') {
         $model->where('subject REGEXP ?', $this->filter['subject']);
     }
     $this->model = $model;
 }
开发者ID:vsek,项目名称:base,代码行数:14,代码来源:GridEmailLog.php

示例4: apply

 /**
  * @param \Nette\Database\Table\Selection $selection
  * @param string|Callable $callback
  */
 private function apply(Selection $selection, $callback)
 {
     if (!$callback) {
         return;
     }
     if (is_string($callback)) {
         $selection->select($callback);
     } else {
         $callback($selection);
     }
 }
开发者ID:kysela-petr,项目名称:generator-kysela,代码行数:15,代码来源:MenuItemDataSource.php

示例5: getData

 /**
  * @param int $limit
  * @param int $offset
  * @return array
  */
 public function getData($limit = NULL, $offset = NULL)
 {
     if ($limit !== NULL) {
         $this->source->limit($limit, $offset);
     }
     return $this->source->fetchAll();
 }
开发者ID:WebChemistry,项目名称:filter,代码行数:12,代码来源:NetteDataSource.php

示例6: render

 public function render()
 {
     $this->_calendarMonthData->rewind();
     $this->template->data = $this->_calendarMonthData;
     $this->template->setFile(__DIR__ . '/Month.latte');
     $this->template->render();
 }
开发者ID:dansilovsky,项目名称:calendar,代码行数:7,代码来源:MonthControl.php

示例7: process

 /**
  * Default form handler
  */
 public function process()
 {
     /** @var ArrayHash $values */
     $values = $this->values;
     try {
         $this->onBeforeProcess($this, $values);
         if (isset($values->id)) {
             $this->onBeforeUpdate($this, $values);
             $arr = (array) $values;
             unset($arr['id']);
             $row = $this->selection->wherePrimary($values->id)->fetch();
             $row->update($arr);
             $this->onAfterUpdate($row, $this, $values);
         } else {
             $this->onBeforeInsert($this, $values);
             $row = $this->selection->insert($values);
             $this->onAfterInsert($row, $this, $values);
         }
         $this->onAfterProcess($row, $this, $values);
     } catch (\PDOException $e) {
         $this->addError($e->getMessage());
         dump($e);
         Debugger::log($e);
     }
 }
开发者ID:ondrs,项目名称:nette-bootstrap,代码行数:28,代码来源:BaseForm.php

示例8: filter

 /**
  * Filter data
  * @param array $filter
  */
 public function filter(array $filter)
 {
     foreach ($filter as $key => $value) {
         $value = is_numeric($value) ? $value : '%' . $value . '%';
         $this->table->where($key . ' LIKE ?', $value);
     }
 }
开发者ID:drahak,项目名称:tables,代码行数:11,代码来源:DefaultDataSource.php

示例9: validate

 public function validate(BaseControl $control)
 {
     $condition[$control->name] = $control->value;
     if ($this->id) {
         $condition['id!='] = $this->id;
     }
     return $this->selection->where($condition)->count() ? FALSE : TRUE;
 }
开发者ID:04EO,项目名称:TrainingTaskNette,代码行数:8,代码来源:UniqueValidator.php

示例10: setTexts

  /** Nastavenie textov
 * @param array $texts
 * @return \App\FrontModule\Components\Clanky\AktualneClankyControl
 */
  public function setTexts($texts)
  {
      $this->texts = array_merge($this->texts, $texts);
      return $this;
  }
  /** Nastavenie cesty k titulnemu obrazku clanku
开发者ID:petak23,项目名称:echo-msz,代码行数:10,代码来源:AktualneClanky.php

示例11: render

     if (is_int($pocet) && $pocet > 1) {
         $this->pocet = $pocet;
     }
 }
 /** Zakladny render */
 public function render()
 {
     $this->template->setFile(__DIR__ . '/Last.latte');
     $this->template->h3 = 'Posledných ' . $this->pocet . ' prihlásení';
     $this->template->last = $this->last->order('prihlasenie_datum DESC')->limit($this->pocet);
     $this->template->render();
开发者ID:petak23,项目名称:echo-msz,代码行数:11,代码来源:Last.php

示例12: getProdukt

 /** Nacitanie udajov o produkte
  * @param int $id Id produktu
  * @param int $id_lang Id jazyka
  * @return array|FALSE
  */
 public function getProdukt($id, $id_lang = 1)
 {
     $hlavne_menu_lang = $this->hlavne_menu_lang->where(array("id_hlavne_menu" => $id, "id_lang" => $id_lang));
     if ($hlavne_menu_lang === FALSE) {
         return FALSE;
     }
     $produkt = $this->find($hlavne_menu_lang->hlavne_menu->clanok);
     if ($produkt === FALSE) {
         return FALSE;
     }
     return array("hlavne_menu_lang" => $hlavne_menu_lang, "produkt" => $produkt);
 }
开发者ID:petak23,项目名称:echo-msz,代码行数:17,代码来源:Produkt_lang.php

示例13: buildJoins

 protected function buildJoins($val, $inner = FALSE)
 {
     $driver = $this->selection->getConnection()->getSupplementalDriver();
     $reflection = $this->selection->getConnection()->getDatabaseReflection();
     $joins = array();
     preg_match_all('~\\b([a-z][\\w.:]*[.:])([a-z]\\w*|\\*)(\\s+IS\\b|\\s*<=>)?~i', $val, $matches);
     foreach ($matches[1] as $names) {
         $parent = $this->selection->getName();
         if ($names !== "{$parent}.") {
             // case-sensitive
             preg_match_all('~\\b([a-z][\\w]*|\\*)([.:])~i', $names, $matches, PREG_SET_ORDER);
             foreach ($matches as $match) {
                 list(, $name, $delimiter) = $match;
                 if ($delimiter === ':') {
                     list($table, $primary) = $reflection->getHasManyReference($parent, $name);
                     $column = $reflection->getPrimary($parent);
                 } else {
                     list($table, $column) = $reflection->getBelongsToReference($parent, $name);
                     $primary = $reflection->getPrimary($table);
                 }
                 $joins[$name] = ' ' . (!isset($joins[$name]) && $inner && !isset($match[3]) ? 'INNER' : 'LEFT') . ' JOIN ' . $driver->delimite($table) . ($table !== $name ? ' AS ' . $driver->delimite($name) : '') . ' ON ' . $driver->delimite($parent) . '.' . $driver->delimite($column) . ' = ' . $driver->delimite($name) . '.' . $driver->delimite($primary);
                 $parent = $name;
             }
         }
     }
     return $joins;
 }
开发者ID:cujan,项目名称:atlas-mineralov-a-hornin,代码行数:27,代码来源:SqlBuilder.php

示例14: update

 public function update($data, $forceRegenerateTimes = FALSE)
 {
     parent::update($data);
     if ($forceRegenerateTimes || rand(0, 100) < 10) {
         $this->generateAllTimes();
     }
 }
开发者ID:soundake,项目名称:pd,代码行数:7,代码来源:EventsTerms.php

示例15: access

 public function access($key, $delete = FALSE)
 {
     if ($this->table->connection->getCache() && !isset($this->modified[$key]) && $this->table->access($key, $delete)) {
         $id = isset($this->data[$this->table->primary]) ? $this->data[$this->table->primary] : $this->data;
         $this->data = $this->table[$id]->data;
     }
 }
开发者ID:kovkus,项目名称:r-cms,代码行数:7,代码来源:ActiveRow.php


注:本文中的Nette\Database\Table\Selection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。