propelorm/Propel2 — pull request #124 by rozwell (2012-01-27 01:14:26+00:00)
Title: Optional condition in AggregateColumn behavior

This is a simple change which allows to add condition to AggregateColumn behavior.
It adds your piece of sql code to the query.

This is how the schema looks like:

```xml

```

And created method:

```php
prepare('SELECT COUNT(status) FROM unit WHERE status=1 AND unit.INVESTMENT_ID = :p1');
$stmt->bindValue(':p1', $this->getId());
$stmt->execute();
return $stmt->fetchColumn();
}
```

Of course you can do the same via overriding the compute method but... why if you can do that in schema with less code?