use Propel\Runtime\Connection\ConnectionManagerSingle; $connectionManager = new ConnectionManagerSingle(); $connection = $connectionManager->getConfiguration()->getConnectionParameters('mysql'); $connectionParams = [ 'dsn' => $connection['dsn'], 'user' => $connection['user'], 'password' => $connection['password'] ]; $conn = Propel\Runtime\Propel::getConnection($connectionParams);
use Propel\Runtime\ActiveQuery\Criteria; use MyApp\Models\UserQuery; // find all users with age > 18 $users = UserQuery::create() ->filterByAge(['min' => 18], Criteria::GREATER_THAN) ->find(); // print out user emails foreach($users as $user) { echo $user->getEmail(); }This code executes a query against a User model created with Propel Runtime and returns all users with an age greater than 18. In conclusion, Propel Runtime is a crucial package library that provides basic functionality for executing queries and managing database connections in Propel ORM for PHP.