lox/pheasant — pull request #51 by lox (2013-04-18 19:39:01+00:00)
Title: Support for Locking on Objects and Collections

Added easy transactions from objects:

```php
transaction(function($obj) {
$obj->save();
});
```

Added a way get row locks on an object:

```php
transaction(function($obj) {
$obj->lock();
});
```

Note that the above will throw a `StaleObjectException` if the object has changed in the database between the initial select and when the lock is acquired. To prevent this problem, fetch the original object with a lock:

```php
lock()->one();
// act on the llama
$llama->save();
});
```