/** * Fetch Organisatie which references this Hulpverleners. Will return null in case reference is invalid. * `hulpverleners`.`organisatie` -> `organisatie`.`id` * * @param PDO $db a PDO Database instance * @param array $sort array of DSC instances * @return Organisatie */ public function fetchOrganisatie(PDO $db, $sort = null) { $filter = array(Organisatie::FIELD_ID => $this->getOrganisatie()); $result = Organisatie::findByFilter($db, $filter, true, $sort); return empty($result) ? null : $result[0]; }
/** * Fetch Organisatie's which this Persoon references. * `persoon`.`id` -> `organisatie`.`id` * * @param PDO $db a PDO Database instance * @param array $sort array of DSC instances * @return Organisatie[] */ public function fetchOrganisatieCollection(PDO $db, $sort = null) { $filter = array(Organisatie::FIELD_ID => $this->getId()); return Organisatie::findByFilter($db, $filter, true, $sort); }