Skip to content

Instantly share code, notes, and snippets.

@mishak87
Last active December 20, 2015 18:09
Show Gist options
  • Save mishak87/6174301 to your computer and use it in GitHub Desktop.
Save mishak87/6174301 to your computer and use it in GitHub Desktop.
Now I feel really stupid
<?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