public function Biblio::save in Bibliography Module 7.3
Override Entity:save().
Clear biblio cache.
Overrides Entity::save
1 call to Biblio::save()
- Biblio::getText in includes/
biblio.controller.inc - Get the text, rendered using a Biblio style plugin.
File
- includes/
biblio.controller.inc, line 45
Class
- Biblio
- Biblio class.
Code
public function save() {
$wrapper = entity_metadata_wrapper('biblio', $this);
if (!$wrapper->biblio_status
->value() && $wrapper->biblio_year
->value()) {
// If Year is populated and Status is not, the status should be Published.
$wrapper->biblio_status
->set('published');
}
if ($wrapper->biblio_status
->value() != 'published') {
// Set the year to 0, to non-published publications, so it's easier to
// group them by year.
$wrapper->biblio_year
->set(0);
}
$this->md5 = BiblioStyleBase::generateBiblioMd5($this);
if (empty($this->_skip_cache)) {
$this->cache = '';
$this->cache_id = '';
}
parent::save();
}