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

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

$view  = new Doctrine_View($query, 'MyView');

// creating a database view
$view->create();

// dropping the view from the database
$view->drop();
?>