Last active
December 20, 2015 18:09
-
-
Save mishak87/6174301 to your computer and use it in GitHub Desktop.
Now I feel really stupid
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
<?php | |
use Nette; | |
class TableFactory extends Nette\Object | |
{ | |
/** @var Nette\Database\Connection */ | |
private $connection; | |
/** @var string */ | |
private $tableName; | |
/** | |
* @param \Nette\Database\Connection $connection | |
* @param string $tableName | |
*/ | |
public function __connection(Nette\Database\Connection $connection, $tableName) | |
{ | |
$this->connection = $connection; | |
$this->tableName = $tableName; | |
} | |
public function createTable() | |
{ | |
return $this->connection->table($this->tableName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment