public function detailsAction() { // set up the usersMapper and // get the logged in user's info from the database $this->getLoggedInUser(); // get user's shipping addresses $shippingMapper = new Application_Model_Mapper_Users_ShippingAddressesMapper(); $this->user->shippingAddresses = $shippingMapper->getShippingAddressesForUser($this->user); // get the default shipping address if it exists $defaultShipping = null; foreach ($this->user->shippingAddresses as $address) { if ($address->shippingAddressID == $this->user->defaultShippingAddressID) { $defaultShipping = $address; } } $this->user->defaultShippingAddress = $defaultShipping; // get list of stores for this user $linksMapper = new Application_Model_Mapper_Stores_StoresUsersLinksMapper(); $options = array('include' => array('linkRole', 'storeName', 'storeDisplayName')); $this->user->storeLinks = $linksMapper->fetchStoreLinksForUserID($this->user->userID, $options); // send the user to the view $this->view->user = $this->user; }