Exemplo n.º 1
0
 /**
  * Query by Example.
  *
  * Match by attributes of passed example instance and return matched rows as an array of Verzekering instances
  *
  * @param PDO $db a PDO Database instance
  * @param Verzekering $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 Verzekering[]
  */
 public static function findByExample(PDO $db, Verzekering $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);
 }