Advanced components - View - Using views.php 359 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
$conn = Doctrine_Manager::getInstance()
        ->openConnection(new PDO("dsn","username","password"));

$query = new Doctrine_Query($conn);
$query->from('User.Phonenumber')->limit(20);

// hook the query into appropriate view
$view  = new Doctrine_View($query, 'MyView');

// now fetch the data from the view
$coll  = $view->execute();
?>