本文整理汇总了PHP中Book::getPublisher方法的典型用法代码示例。如果您正苦于以下问题:PHP Book::getPublisher方法的具体用法?PHP Book::getPublisher怎么用?PHP Book::getPublisher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book::getPublisher方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBookContentArray
/**
* @param Book $book
* @return array
*/
public static function getBookContentArray($book)
{
global $config;
$i = 0;
$preferedData = array();
foreach ($config['cops_prefered_format'] as $format) {
if ($i == 2) {
break;
}
if ($data = $book->getDataFormat($format)) {
$i++;
array_push($preferedData, array("url" => $data->getHtmlLink(), "name" => $format));
}
}
$publisher = $book->getPublisher();
if (is_null($publisher)) {
$pn = "";
$pu = "";
} else {
$pn = $publisher->name;
$link = new LinkNavigation($publisher->getUri());
$pu = $link->hrefXhtml();
}
$serie = $book->getSerie();
if (is_null($serie)) {
$sn = "";
$scn = "";
$su = "";
} else {
$sn = $serie->name;
$scn = str_format(localize("content.series.data"), $book->seriesIndex, $serie->name);
$link = new LinkNavigation($serie->getUri());
$su = $link->hrefXhtml();
}
$cc = $book->getCustomColumnValues($config['cops_calibre_custom_column_list'], true);
return array("id" => $book->id, "hasCover" => $book->hasCover, "preferedData" => $preferedData, "rating" => $book->getRating(), "publisherName" => $pn, "publisherurl" => $pu, "pubDate" => $book->getPubDate(), "languagesName" => $book->getLanguages(), "authorsName" => $book->getAuthorsName(), "tagsName" => $book->getTagsName(), "seriesName" => $sn, "seriesIndex" => $book->seriesIndex, "seriesCompleteName" => $scn, "seriesurl" => $su, "customcolumns_list" => $cc);
}
示例2: testObjectInstances_Fkeys
/**
*
*/
public function testObjectInstances_Fkeys()
{
// Establish a relationship between one employee and account
// and then change the employee_id and ensure that the account
// is not pulling the old employee.
$pub1 = new Publisher();
$pub1->setName('Publisher 1');
$pub1->save();
$pub2 = new Publisher();
$pub2->setName('Publisher 2');
$pub2->save();
$book = new Book();
$book->setTitle("Book Title");
$book->setISBN("1234");
$book->setPublisher($pub1);
$book->save();
$this->assertSame($pub1, $book->getPublisher());
// now change values behind the scenes
$con = Propel::getConnection(BookstoreEmployeeAccountPeer::DATABASE_NAME);
$con->exec("UPDATE " . BookPeer::TABLE_NAME . " SET " . " publisher_id = " . $pub2->getId() . " WHERE id = " . $book->getId());
$book2 = BookPeer::retrieveByPK($book->getId());
$this->assertSame($book, $book2, "Expected same book object instance");
$this->assertEquals($pub1->getId(), $book->getPublisherId(), "Expected book to have OLD publisher id before reload()");
$book->reload();
$this->assertEquals($pub2->getId(), $book->getPublisherId(), "Expected book to have new publisher id");
$this->assertSame($pub2, $book->getPublisher(), "Expected book to have new publisher object associated.");
// Now let's set it back, just to be double sure ...
$con->exec("UPDATE " . BookPeer::TABLE_NAME . " SET " . " publisher_id = " . $pub1->getId() . " WHERE id = " . $book->getId());
$book->reload();
$this->assertEquals($pub1->getId(), $book->getPublisherId(), "Expected book to have old publisher id (again).");
$this->assertSame($pub1, $book->getPublisher(), "Expected book to have old publisher object associated (again).");
}
示例3: printItemRow
/**
* Prints the metadata and prices for an item
* @param Item|Book $item an Item (Section mode) or Book (ISBN mode) object
* @param int $requiredStatus
*/
function printItemRow($item, $status = null)
{
global $app;
?>
<tr>
<th>
<span class="tooltip" style="display: none;">
<img src="<?php
echo $item->getImageUrl();
?>
">
<h1><?php
echo $item->getTitle();
?>
</h1>
<h2><?php
echo $item->getAuthor();
?>
</h2>
<?php
if ($edition = $item->getEdition()) {
?>
<div class="edition"><strong>Edition:</strong> <?php
echo $edition;
?>
</div>
<?php
}
if ($publisher = $item->getPublisher()) {
?>
<div class="publisher"><strong>Publisher:</strong> <?php
echo $publisher;
?>
</div>
<?php
}
if ($isbn = $item->getIsbn()) {
?>
<div class="isbn"><strong>ISBN:</strong> <span class="isbn"><?php
echo $isbn;
?>
</span></div>
<?php
}
?>
</span>
<?php
$indented = $item->isPackageComponent() || $status === SectionHasItem::BOOKSTORE_RECOMMENDED;
$class = $indented ? " packageComponent" : "";
?>
<span class="bookdata <?php
echo $class;
?>
">
<span class="title"><?php
echo $item->getTitle();
?>
</span><br>
<?php
if ($edition || $item->getAuthor()) {
?>
<span class="minimetadata"><?php
echo ($edition ? "{$edition}, " : "") . $item->getAuthor();
?>
</span>
<?php
}
?>
<?php
// e.g. (Recommended)
if ($stat = Item::getStatusText($status)) {
?>
<br/><span class="minimetadata"><?php
echo $stat;
?>
</span>
<?php
}
// sentence about being a package or component
if ($description = $item->getDescription($status)) {
?>
<br/><span class="minimetadata important"><?php
echo $description;
?>
</span>
<?php
}
?>
</span>
</th>
<?php
foreach ($item->prices as $v => $p) {
if ($p === null) {
//.........这里部分代码省略.........