public function getRelationsFor($respondentId, $patientNr = null, $organizationId = null, $onlyActive = true)
    {
        static $relationsCache = array();

        if (is_null($respondentId)) {
            $respondentId = $this->loader->getUtil()->getDbLookup()->getRespondentId($patientNr, $organizationId);
        }

        if (!array_key_exists($respondentId, $relationsCache)) {
            $relations = array();
            $filter = array('grr_id_respondent'=>$respondentId);
            if ($onlyActive) {
                $filter['grr_active'] = 1;
            }
            $rawRelations = $this->load($filter);
            foreach ($rawRelations as $relation)
            {
                $relations[$relation['grr_id']] = join(' ', array($relation['grr_type'], $relation['grr_first_name'], $relation['grr_last_name']));
            }
            $relationsCache[$respondentId] = $relations;
        }

        return $relationsCache[$respondentId];
    }
public function getRelationsFor($respondentId, $patientNr = null, $organizationId = null, $onlyActive = true)
    {
        static $relationsCache = array();

        if (is_null($respondentId)) {
            $respondentId = $this->loader->getUtil()->getDbLookup()->getRespondentId($patientNr, $organizationId);
        }

        if (!array_key_exists($respondentId, $relationsCache)) {
            $relations = array();
            $filter = array('grr_id_respondent'=>$respondentId);
            if ($onlyActive) {
                $filter['grr_active'] = 1;
            }
            $rawRelations = $this->load($filter);
            foreach ($rawRelations as $relation)
            {
                $relations[$relation['grr_id']] = join(' ', array($relation['grr_type'], $relation['grr_first_name'], $relation['grr_last_name']));
            }
            $relationsCache[$respondentId] = $relations;
        }

        return $relationsCache[$respondentId];
    }
public function getRelationsFor ( $ respondentId , $ patientNr = null , $ organizationId = null , $ onlyActive = true ) { static $ relationsCache = array ( ) ; if ( is_null ( $ respondentId ) ) { $ respondentId = $ this -> loader -> getUtil ( ) -> getDbLookup ( ) -> getRespondentId ( $ patientNr , $ organizationId ) ; } if ( ! array_key_exists ( $ respondentId , $ relationsCache ) ) { $ relations = array ( ) ; $ filter = array ( 'grr_id_respondent' => $ respondentId ) ; if ( $ onlyActive ) { $ filter [ 'grr_active' ] = 1 ; } $ rawRelations = $ this -> load ( $ filter ) ; foreach ( $ rawRelations as $ relation ) { $ relations [ $ relation [ 'grr_id' ] ] = join ( ' ' , array ( $ relation [ 'grr_type' ] , $ relation [ 'grr_first_name' ] , $ relation [ 'grr_last_name' ] ) ) ; } $ relationsCache [ $ respondentId ] = $ relations ; } return $ relationsCache [ $ respondentId ] ; }
Get the relations for a given respondentId or patientNr + organizationId combination

@param type $respondentId
@param type $patientNr
@param type $organizationId
@return array
Get the relations for a given respondentId or patientNr + organizationId combination