src/Money/Module/Category/Controller/Category.php
public function ajaxList()
    {
        if (!Server::getInstance()->isAjax()) {
            throw new \RuntimeException();
        }

        $accountId =  (int) $this->route->getParameterCollection()->getByName('id')->getValue();

        //~ Retrieve user account / account
        $mapper      = new AccountUserMapper(Database::get('money'));
        $accountUser = $mapper->findByKeys(array('user_id' => Session::getInstance()->get('id'), 'account_id' => $accountId));
        $account     = $accountUser->getAccount();

        //~ Get categories for this account
        $categoryMapper = new CategoryMapper(Database::get('money'));
        $categories     = $categoryMapper->findAllByAccountId($account->getId());

        $this->dataCollection->add('account',    $account);
        $this->dataCollection->add('categories', $categories);

        return $this->getResponse('Partial/Categories', true);
    }
public function ajaxList()
    {
        if (!Server::getInstance()->isAjax()) {
            throw new \RuntimeException();
        }

        $accountId =  (int) $this->route->getParameterCollection()->getByName('id')->getValue();

        //~ Retrieve user account / account
        $mapper      = new AccountUserMapper(Database::get('money'));
        $accountUser = $mapper->findByKeys(array('user_id' => Session::getInstance()->get('id'), 'account_id' => $accountId));
        $account     = $accountUser->getAccount();

        //~ Get categories for this account
        $categoryMapper = new CategoryMapper(Database::get('money'));
        $categories     = $categoryMapper->findAllByAccountId($account->getId());

        $this->dataCollection->add('account',    $account);
        $this->dataCollection->add('categories', $categories);

        return $this->getResponse('Partial/Categories', true);
    }
Load categories.

@return ResponseInterface
@throws \Exception