/**
  * findByCriteria
  *
  * @since 30 okt 2007
  * @param KVDdb_Criteria $criteria
  * @return void
  */
 public function findByCriteria(KVDdb_Criteria $criteria)
 {
     $sql = $this->getSelectStatement() . ' ' . $criteria->generateSql(KVDdb_Criteria::MODE_PARAMETERIZED);
     $stmt = $this->_conn->prepare($sql);
     $values = $criteria->getValues();
     for ($i = 0; $i < count($values); $i++) {
         $stmt->bindValue($i + 1, $values[$i]);
     }
     return $this->executeFindMany($stmt);
 }
 /**
  * findByCriteria
  *
  * @param KVDdb_Criteria $c
  * @return KVDdom_DomainObjectCollection
  */
 public function findByCriteria(KVDdb_Criteria $c)
 {
     if ($c->count() == 0) {
         return $this->findAll();
     }
     // criterion toevoegen dat enkel termen uit deze thesaurus toont.
     $c->add(KVDdb_Criterion::equals('thesaurus_id', $this->parameters['thesaurus_id']));
     $c->addAscendingOrder('term');
     $c->addAscendingOrder('qualifier');
     $sql = sprintf('SELECT t.id, term, tt.id AS type_id, tt.name AS type_naam, qualifier, language, sort_key
                      FROM %s.term t
                         LEFT JOIN %s.term_type_code tt ON ( t.type = tt.id )', $this->parameters['schema'], $this->parameters['schema']);
     $sql .= $c->generateSql(KVDdb_Criteria::MODE_PARAMETERIZED);
     $stmt = $this->conn->prepare($sql);
     $values = $c->getValues();
     for ($i = 0; $i < count($values); $i++) {
         $stmt->bindValue($i + 1, $values[$i]);
     }
     $stmt->execute();
     $termen = array();
     while ($row = $stmt->fetch(PDO::FETCH_OBJ)) {
         $termen[$row->id] = $this->doLoad($row->id, $row);
     }
     return new KVDdom_DomainObjectCollection($termen);
 }
 /**
  * getValues
  *
  * @since   1.4
  * @return  array
  */
 public function getValues()
 {
     return $this->criteria->getValues();
 }