diff --git a/manual/codes/Advanced components - View - Managing views.php b/manual/codes/Advanced components - View - Managing views.php index e69de29bb..14363d118 100644 --- a/manual/codes/Advanced components - View - Managing views.php +++ b/manual/codes/Advanced components - View - Managing views.php @@ -0,0 +1,15 @@ +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(); +?> diff --git a/manual/codes/Advanced components - View - Using views.php b/manual/codes/Advanced components - View - Using views.php index e69de29bb..6975c0a94 100644 --- a/manual/codes/Advanced components - View - Using views.php +++ b/manual/codes/Advanced components - View - Using views.php @@ -0,0 +1,13 @@ +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(); +?> diff --git a/manual/codes/Basic Components - Collection - Introduction.php b/manual/codes/Basic Components - Collection - Introduction.php index 66d285903..edb2c33e9 100644 --- a/manual/codes/Basic Components - Collection - Introduction.php +++ b/manual/codes/Basic Components - Collection - Introduction.php @@ -1,9 +1,18 @@ openConnection(new PDO("dsn", "username", "pw")); +// initalizing a new collection +$users = new Doctrine_Collection($conn->getTable('User')); + +// alternative (propably easier) +$users = new Doctrine_Collection('User'); + +// adding some data $coll[0]->name = 'Arnold'; $coll[1]->name = 'Somebody'; +// finally save it! $coll->save(); ?> diff --git a/manual/codes/Basic Components - Connection - Introduction.php b/manual/codes/Basic Components - Connection - Introduction.php index e69de29bb..d3f5a12fa 100644 --- a/manual/codes/Basic Components - Connection - Introduction.php +++ b/manual/codes/Basic Components - Connection - Introduction.php @@ -0,0 +1 @@ +