|
|
@@ -1,6 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!-- Reviewed: no -->
|
|
|
-<!-- EN-Revision: 16943 -->
|
|
|
+<!-- EN-Revision: 17054 -->
|
|
|
<sect1 id="zend.db.table.definition">
|
|
|
|
|
|
<title>Zend_Db_Table_Definition</title>
|
|
|
@@ -104,12 +104,18 @@ $authorTable = new Zend_Db_Table('author', $definition);
|
|
|
$authors = $authorTable->fetchAll();
|
|
|
|
|
|
foreach ($authors as $author) {
|
|
|
- echo $author->id . ': ' . $author->first_name . ' ' . $author->last_name . PHP_EOL;
|
|
|
+ echo $author->id
|
|
|
+ . ': '
|
|
|
+ . $author->first_name
|
|
|
+ . ' '
|
|
|
+ . $author->last_name
|
|
|
+ . PHP_EOL;
|
|
|
$books = $author->findDependentRowset('book');
|
|
|
foreach ($books as $book) {
|
|
|
echo ' Book: ' . $book->title . PHP_EOL;
|
|
|
$genreOutputArray = array();
|
|
|
- foreach ($book->findManyToManyRowset('genre', 'book_to_genre') as $genreRow) {
|
|
|
+ $genres = $book->findManyToManyRowset('genre', 'book_to_genre');
|
|
|
+ foreach ($genres as $genreRow) {
|
|
|
$genreOutputArray[] = $genreRow->name;
|
|
|
}
|
|
|
echo ' Genre: ' . implode(', ', $genreOutputArray) . PHP_EOL;
|
|
|
@@ -185,12 +191,18 @@ $authorTable = new Zend_Db_Table('author', $definition);
|
|
|
$authors = $authorTable->fetchAll();
|
|
|
|
|
|
foreach ($authors as $author) {
|
|
|
- echo $author->id . ': ' . $author->first_name . ' ' . $author->last_name . PHP_EOL;
|
|
|
+ echo $author->id
|
|
|
+ . ': '
|
|
|
+ . $author->first_name
|
|
|
+ . ' '
|
|
|
+ . $author->last_name
|
|
|
+ . PHP_EOL;
|
|
|
$books = $author->findDependentRowset(new MyBook());
|
|
|
foreach ($books as $book) {
|
|
|
echo ' Book: ' . $book->title . PHP_EOL;
|
|
|
$genreOutputArray = array();
|
|
|
- foreach ($book->findManyToManyRowset('genre', 'book_to_genre') as $genreRow) {
|
|
|
+ $genres = $book->findManyToManyRowset('genre', 'book_to_genre');
|
|
|
+ foreach ($genres as $genreRow) {
|
|
|
$genreOutputArray[] = $genreRow->name;
|
|
|
}
|
|
|
echo ' Genre: ' . implode(', ', $genreOutputArray) . PHP_EOL;
|