/** * * @param integer $user_id * @param integer $act_id * @param float $value * @param boolean $monetary */ public static function createAccountUser($user_id, $account_id) { /* ------- ACCOUNT_USER CREATION ------- */ //In order to link the user and the account, we need a AccountUser object: $account_user = new AccountUser(); //Set its values: $account_user->setUserId($user_id); $account_user->setAccountId($account_id); //Save it: $saved_account_user = $account_user->save(); return $account_id; }