-
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Database: deprecated Connection::setDatabaseReflection() and setCache…
…Storage(), methods are replaced with setSelectionFactory() (BC break)
- Loading branch information
Showing
8 changed files
with
122 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Nette Framework (http://nette.org) | ||
* | ||
* Copyright (c) 2004 David Grudl (http://davidgrudl.com) | ||
* | ||
* For the full copyright and license information, please view | ||
* the file license.txt that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nette\Database\Table; | ||
|
||
use Nette; | ||
|
||
|
||
|
||
/** | ||
* Table\Selection factory. | ||
* | ||
* @author David Grudl | ||
*/ | ||
class SelectionFactory extends Nette\Object | ||
{ | ||
/** @var Nette\Database\Connection */ | ||
private $connection; | ||
|
||
/** @var Nette\Database\IReflection */ | ||
private $reflection; | ||
|
||
/** @var Nette\Caching\IStorage */ | ||
private $cacheStorage; | ||
|
||
|
||
public function __construct(Nette\Database\Connection $connection, Nette\Database\IReflection $reflection = NULL, Nette\Caching\IStorage $cacheStorage = NULL) | ||
{ | ||
$this->connection = $connection; | ||
$this->reflection = $reflection ?: new Nette\Database\Reflection\ConventionalReflection; | ||
$this->cacheStorage = $cacheStorage; | ||
} | ||
|
||
|
||
|
||
/** @return Selection */ | ||
public function create($table) | ||
{ | ||
return new Selection($this->connection, $table, $this->reflection, $this->cacheStorage); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters