コード例 #1
0
 /**
  * XXX:
  * @return array(_data_source) or NULL
  */
 function create(_data_source $data_source, $registry_object_key, $class, $title, $status, $slug, $record_owner, $harvestID)
 {
     $ro = new _registry_object();
     $ro->_initAttribute("data_source_id", $data_source->getAttribute('data_source_id'), TRUE);
     $ro->_initAttribute("key", $registry_object_key, TRUE);
     $ro->_initAttribute("class", $class, TRUE);
     $ro->_initAttribute("title", $title, TRUE);
     $ro->_initAttribute("status", $status, TRUE);
     $ro->_initAttribute("slug", $slug, TRUE);
     $ro->_initAttribute("record_owner", $record_owner, TRUE);
     $ro->create();
     // Some extras
     $ro->setAttribute("created", time());
     $ro->setAttribute("harvest_id", $harvestID);
     $ro->save();
     return $ro;
 }
コード例 #2
0
 /**
  * XXX: 
  * @return array(_data_source) or NULL
  */
 function create($key, $slug)
 {
     $ds = new _data_source();
     // Compulsory attributes
     $ds->_initAttribute("key", $key, TRUE);
     $ds->_initAttribute("slug", $slug, TRUE);
     // Some extras
     $ds->setAttribute("created", time());
     $ds->create();
     return $ds;
 }