Nette\Database\Table\Selection::createSelectionInstance PHP Method

createSelectionInstance() public method

public createSelectionInstance ( $table = NULL )
    public function createSelectionInstance($table = NULL)
    {
        return new self($this->context, $this->conventions, $table ?: $this->name, $this->cache ? $this->cache->getStorage() : NULL);
    }

Usage Example

コード例 #1
0
ファイル: ActiveRow.php プロジェクト: ricco24/database
 /**
  * Deletes row.
  * @return int number of affected rows
  */
 public function delete()
 {
     $res = $this->table->createSelectionInstance()->wherePrimary($this->getPrimary())->delete();
     if ($res > 0 && ($signature = $this->getSignature(FALSE))) {
         unset($this->table[$signature]);
     }
     return $res;
 }