/** * Initialize the update facade. * Set all required properties to update entries in the database. * * @param \PDO $pdo PDO connection. * @param UpdateInterface $update Select statement. * @param DbFactoryInterface $factory Factory to create several objects. * @param string $table Name of the table from which should select (tables can get extended). */ public function __construct(\PDO $pdo, UpdateInterface $update, DbFactoryInterface $factory, $table) { $this->pdo = $pdo; $this->update = $update; $this->factory = $factory; /** @var TableInterface $tableObj */ $tableObj = $this->factory->references('Table', $table); $this->update->table($tableObj); }
/** * Add a table to the query. * * @param string $tableName The name of the table. * @param string|null $alias (Optional) An alias name, if exists. * * @return $this The same instance to concatenate methods. */ public function table($tableName, $alias = null) { $table = $this->factory->references('Table', $tableName, $alias); $this->select->table($table); return $this; }