當前位置: 首頁>>代碼示例>>PHP>>正文


PHP collection::attribs方法代碼示例

本文整理匯總了PHP中collection::attribs方法的典型用法代碼示例。如果您正苦於以下問題:PHP collection::attribs方法的具體用法?PHP collection::attribs怎麽用?PHP collection::attribs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在collection的用法示例。


在下文中一共展示了collection::attribs方法的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);
開發者ID:rmbwebs,項目名稱:amortize,代碼行數:31,代碼來源:test_generic.php


注:本文中的collection::attribs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。