Exemple #1
0
                // Item isn't loaded -- create new object and stuff in array
                if (!isset(self::$objectCache[$itemID])) {
                    $item = new Zotero_Item();
                    $item->loadFromRow($row, true);
                    self::$objectCache[$itemID] = $item;
                } else {
                    self::$objectCache[$itemID]->loadFromRow($row, true);
                }
            }
        }
        if (!$itemIDs) {
            // If loading all items, remove old items that no longer exist
            $ids = array_keys(self::$objectCache);
            foreach ($ids as $id) {
                if (!in_array($id, $loadedItemIDs)) {
                    throw new Exception("Unimplemented");
                    //$this->unload($id);
                }
            }
        }
    }
    public static function getSortTitle($title)
    {
        if (!$title) {
            return '';
        }
        return mb_strcut(preg_replace('/^[[({\\-"\'“‘ ]+(.*)[\\])}\\-"\'”’ ]*?$/Uu', '$1', $title), 0, Zotero_Notes::$MAX_TITLE_LENGTH);
    }
}
Zotero_Items::init();