本文整理汇总了PHP中collection::save方法的典型用法代码示例。如果您正苦于以下问题:PHP collection::save方法的具体用法?PHP collection::save怎么用?PHP collection::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collection
的用法示例。
在下文中一共展示了collection::save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Book
$aBook->dumpview(true);
$newBook->dumpview(true);
dbm_debug('info', 'Creating the Book "The Art of the Rifle"');
$aBook = new Book();
$aBook->attribs(array('isbn' => '9781581603071', 'author' => 'Jeff Cooper', 'title' => 'The Art of the Rifle', 'pubyear' => '2002'));
$aBook->save();
$aBook->dumpview(true);
dbm_debug('info', 'Creating the Book "The Revolution: A Manifesto"');
$aBook = new Book();
$aBook->attribs(array('title' => 'The Revolution: A Manifesto', 'isbn' => '0-446-53751-9', 'author' => 'Ron Paul', 'pubyear' => '2008'));
$aBook->save();
$aBook->dumpview(true);
dbm_debug('info', 'Creating the Collection "Rich\'s Favorite Books"');
$pub = new collection();
$pub->attribs(array('name' => "Rich's Favorite Books"));
$pub->save();
$pub->dumpview(true);
dbm_debug('heading', 'Testing linking functions. . .');
dbm_debug('info', 'Loading book 2 . . . ');
$greatBook = new Book(2);
// Loads Cooper's book from the database
dbm_debug('info', 'done.');
$greatBook->dumpview(true);
dbm_debug('info', 'Creating a fresh Review . . . ');
$myReview = new Review();
// Create a new review
dbm_debug('info', 'Done.');
dbm_debug('info', 'Table Definitions for $myReview:');
dbm_debug('data', $myReview->getTableDefs());
$myReview->dumpview(true);
dbm_debug('info', 'Setting attributes on the Review . . . ');