Would be nice to be able to inject connections objects based on a specified database configured in settings.php. This does not save any lines code as one line is swapped for an annotation. But it will allow us to provide more transaction management features later via dynamic proxy classes.

class deep {
/** @Inject(database="test") */
private $conn;

public function test() {
$result = $conn->query("SELECT name, level FROM {ahole}");

foreach ($result as $record) {
......

Comments

mgiacomi’s picture

Status: Active » Fixed

Fixed by today's commit. Works as documented in the description. Declarative transactions via dynamic proxy and annotations can now move forward.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.