<?php

ARC2
::inc('Class');

class 
ARC2_GraphTimestampTrigger extends ARC2_Class {

  function 
__construct($a '', &$caller) {/* caller is a store */
    
parent::__construct($a$caller);
  }
  
  function 
ARC2_GraphTimestampTrigger($a '', &$caller) {
    
$this->__construct($a$caller);
  }

  function 
__init() {
    
parent::__init();
    
$this->store $this->caller;
  }

  function 
go() { /* automatically called by store or endpoint */
    
$a $this->a;
    
$graph $a['query_infos']['query']['target_graph'];
    
$now date('c');
    
$q "INSERT INTO <$graph> { <$graph> dct:created '$now' . }";
    
// TODO - check update / created
    
$this->store->query($q);
  }

}