For some reason propel is not generating model for view tables, it doesn\'t even include the structure of the view table if you use the reverse
task. So I have
$con = Propel::getConnection();
You will get your current database connection and you can make any sql query you like,
Another alternative is to define your view by adding and setting "readonly" and "skipSql" attributes to "true" like this:
<table name="BookAuthor" phpName="BookAuthor" readOnly="true" skipSql="true">
<column type="integer" size="10" name="AuthorID" phpName="AuthorID" />
<column type="integer" size="10" name="BookID" phpName="BookID" />
<!-- Some other columns, etc. -->
<foreign-key foreignTable="Author">
<reference local="AuthorID" foreign="ID" /><!-- Assuming you have Author.ID -->
</foreign-key>
<foreign-key foreignTable="Book">
<reference local="BookID" foreign="ID" /><!-- Assuming you have Book.ID -->
</foreign-key>
</table>
Once you've generated you classes (via "propel-gen" command), you will have the benefits as though it were a table, like this:
// Fetch a BookAuthor row (the view)
$oBookAuthor = BookAuthor::create()->findOne();
// Get the Author (physical table)
$oUser = $oBookAuthor->getAuthor();
// and if you want the "Book" (physical table)
$oBook = $oBookAuthor->getBook();
And you don't even need a new connection to the DB