/**
  * Query by Example.
  *
  * Match by attributes of passed example instance and return matched rows as an array of OmbMishandeling instances
  *
  * @param PDO $db a PDO Database instance
  * @param OmbMishandeling $example an example instance defining the conditions. All non-null properties will be considered a constraint, null values will be ignored.
  * @param boolean $and true if conditions should be and'ed, false if they should be or'ed
  * @param array $sort array of DSC instances
  * @return OmbMishandeling[]
  */
 public static function findByExample(PDO $db, OmbMishandeling $example, $and = true, $sort = null)
 {
     $exampleValues = $example->toArray();
     $filter = array();
     foreach ($exampleValues as $fieldId => $value) {
         if (null !== $value) {
             $filter[$fieldId] = $value;
         }
     }
     return self::findByFilter($db, $filter, $and, $sort);
 }