Frontend\Modules\Profiles\Engine\Profile::loadProfile PHP Method

loadProfile() private method

Load a user profile by id.
private loadProfile ( integer $id )
$id integer Profile id to load.
    private function loadProfile($id)
    {
        // get profile data
        $profileData = (array) FrontendModel::getContainer()->get('database')->getRecord('SELECT p.id, p.email, p.status, p.display_name, p.url, UNIX_TIMESTAMP(p.registered_on) AS registered_on
             FROM profiles AS p
             WHERE p.id = ?', (int) $id);
        // set properties
        $this->setId($profileData['id']);
        $this->setUrl($profileData['url']);
        $this->setEmail($profileData['email']);
        $this->setStatus($profileData['status']);
        $this->setDisplayName($profileData['display_name']);
        $this->setRegisteredOn($profileData['registered_on']);
        // get the groups (only the ones we still have access to)
        $this->groups = (array) FrontendModel::getContainer()->get('database')->getPairs('SELECT pg.id, pg.name
             FROM profiles_groups AS pg
             INNER JOIN profiles_groups_rights AS pgr ON pg.id = pgr.group_id
             WHERE pgr.profile_id = :id AND (pgr.expires_on IS NULL OR pgr.expires_on >= NOW())', array(':id' => (int) $id));
    }