本文整理汇总了PHP中Books::books_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Books::books_instance方法的具体用法?PHP Books::books_instance怎么用?PHP Books::books_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Books
的用法示例。
在下文中一共展示了Books::books_instance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance()
{
if (!Books::$books_instance) {
Books::$books_instance = new Books();
}
return Books::$books_instance;
}
示例2: updateAuthorsFull
public function updateAuthorsFull($aids)
{
$documents = array();
Books::$books_instance = false;
// cached books?
Persons::$persons_instance = false;
// cached persons?
$persons = Persons::getInstance()->getByIdsLoaded($aids);
foreach ($persons as $person) {
/* @var $person Person */
$documents[] = $this->prepareAuthorFull($person);
}
$authors = self::$authors;
/* @var $books Apache_Solr_Service */
// удаляем из индекса
$authors->deleteByMultipleIds($aids);
// добавляем в индекс
$authors->addDocuments($documents);
// коммитим изменения
$authors->commit();
// оптимизируем поисковую базу
$authors->optimize();
}