function save($type, $id, $reference)
{
add_reference($type, $id, $reference);
-
- references::save_last($reference, $type);
+ if ($reference != 'auto')
+ $this->save_last($reference, $type);
}
function get($type, $id)
delete_reference($type, $id);
}
+ function update($type, $id, $reference)
+ {
+ update_reference($type, $id, $reference);
+ if ($reference != 'auto')
+ $this->save_last($reference, $type);
+ }
+
function exists($type, $reference)
{
return (find_reference($type, $reference) != null);
function save_last($reference, $type)
{
- $next = references::increment($reference);
+ $next = $this->increment($reference);
save_next_reference($type, $next);
}