setIsMulti() публичный Метод

public setIsMulti ( mixed $isMulti )
$isMulti mixed
Пример #1
0
 public function test_it_sets_is_multi()
 {
     $Framework = new \Devise\Support\Framework();
     $Framework->Session = m::mock('Mock\\Session');
     $Framework->Session->shouldReceive('put')->times(1);
     $Manager = new Manager($Framework);
     $Manager->setIsMulti(true);
 }
Пример #2
0
 /**
  * Ads orderBy to the current query in builder
  *
  * @param  QueryBuilder    $query
  * @param  Model  $model
  * @return void
  */
 public function handleSorting(&$query, $model)
 {
     if ($this->Input->has('clearSort')) {
         $this->Manager->clearStack();
     }
     if ($this->Input->has('multisort')) {
         $this->Manager->setIsMulti(true);
     }
     $sortStack = $this->Manager->getStack();
     if ($this->Input->has('orderBy') || count($sortStack) > 0) {
         if (!$this->Input->has('multisort') && !$this->Manager->getIsMulti() && $this->Input->has('orderBy')) {
             $this->Manager->clearStack();
         }
         $this->Manager->addToStack($this->Input->all());
         $sortStack = $this->Manager->getStack();
         foreach ($sortStack as $sort) {
             $query = $this->appendSort($query, $model, $sort);
         }
     } else {
         if (count($this->defaultOrderBy) > 0) {
             $query = $this->sortByDefault($query, $model);
         }
     }
 }