// Assume we have a "users" table in our database class UsersPeer extends BaseUsersPeer { public static function getUserById($id) { $c = new Criteria(); $c->add(self::ID, $id); $map = self::getMapBuilder()->getTableMap(); $c->addSelectColumns($map->getSelectFields()); $stmt = self::doSelectStmt($c); return self::populateObject($stmt); } } $user = UsersPeer::getUserById(1); echo $user->getName(); // Assuming there is a "name" column in the "users" tableIn the example code above, we create a custom "UsersPeer" class that extends the generated Propel "BaseUsersPeer" class. We define a static method called "getUserById" which takes an id parameter, creates a Criteria object to filter the query by id, gets the table map using getMapBuilder, adds the table's select fields to the Criteria object, and then executes the query using doSelectStmt and returns the resulting record as a populated object. This code example demonstrates how to use getMapBuilder to get the table map for a specific table in the database, and then use it to build a Criteria object and execute a query. This code is part of the Propel ORM library.