Ejemplo n.º 1
0
 public function testNotes()
 {
     $this->object->setLoadState(KVDthes_Term::LS_NOTES);
     $this->object->setLoadState(KVDthes_Term::LS_REL);
     $this->object->setLoadState(KVDthes_Term::LS_MATCH);
     $this->object->setScopeNote('SN');
     $this->object->setHistoryNote('HN');
     $this->object->setIndexingNote('IN');
     $this->object->setSourceNote('SoN');
     $this->assertEquals('SN', $this->object->getScopeNote());
     $this->assertEquals('HN', $this->object->getHistoryNote());
     $this->assertEquals('IN', $this->object->getIndexingNote());
     $this->assertEquals('SoN', $this->object->getSourceNote());
 }
Ejemplo n.º 2
0
 /**
  * insertNotes
  *
  * @param   KVDthes_Term $term
  * @return  void
  */
 protected function insertNotes(KVDthes_Term $term)
 {
     $sql = sprintf('INSERT INTO %s.notes
                     ( thesaurus_id, term_id, scope_note, source_note, indexing_note, history_note )
                     VALUES ( %s, ?, ?, ?, ?, ?)', $this->parameters['schema'], $this->parameters['thesaurus_id']);
     $stmt = $this->conn->prepare($sql);
     $stmt->bindValue(1, $term->getId(), PDO::PARAM_INT);
     $stmt->bindValue(2, $term->getScopeNote(), PDO::PARAM_STR);
     $stmt->bindValue(3, $term->getSourceNote(), PDO::PARAM_STR);
     $stmt->bindValue(4, $term->getIndexingNote(), PDO::PARAM_STR);
     $stmt->bindValue(5, $term->getHistoryNote(), PDO::PARAM_STR);
     $stmt->execute();
     return $term;
 }