$status is a string that describes state the operation should affect and
$operation is a callback which is executed if and only if the status is
not already in effect.
Example:
public function withProduct() {
return $this->ensure('product is joined', function($qb) {
$qb->join('pv.product', 'p');
});
}
Should be used to allow the possibility of several different methods
each wanting to affect a certain state without messing up the query by
duplicate calls to methods. Has the pleasant side effect of describing
the results of operations on a more intimate level than the plain object
API can allow for, making for more self-documenting code.