public function create($userName, $name, $email) { $accountFactory = new AccountFactory(); $accountObject = $accountFactory->make('Member'); $this->subscribeObservers($accountObject); $accountObject->create($userName, $name, $email); }
public function testWhitelist() { $factory = new AccountFactory(); $this->assertSame(BankNames::BANK_PLUSGIRO, $factory->createAccount('58056201')->getBankName(), 'When plusgiro is ENABLED 58056201 is considerad a valid plusgiro account'); $factory->whitelistFormats([BankNames::FORMAT_BANKGIRO]); $this->assertSame(BankNames::BANK_BANKGIRO, $factory->createAccount('58056201')->getBankName(), 'When plusgiro is DISABLED 58056201 is considerad a valid bankgiro account'); }
public function create($userName, $name, $email) { $accountFactory = new AccountFactory(); $accountObject = $accountFactory->make('Performer'); $this->subscribeObservers($accountObject); // Temporary we don't want to send remote mail to yahoo users about creation: if (stristr($email, '@yahoo') !== FALSE) { $this->unSubscribeObserver($accountObject); } $accountObject->create($userName, $name, $email); }
public function testAccountCanSaveNewOauthIdAfterHavingItAdded() { $account = AccountFactory::make($this->testAccountId); $oauth_id = 88888888888888.0; $account->setOauthId($oauth_id, 'facebook'); AccountFactory::save($account); $account_dupe = AccountFactory::make($this->testAccountId); $this->assertEquals($oauth_id, $account_dupe->getOauthId()); }
static function factoryAll() { $db = Database::instantiate(Database::TYPE_READ); $query = AccountFactory::SELECTLIST . "\n\t\t\t\t\t\t\tFROM pesapi_account "; $tempArray = array(); if ($result = $db->query($query)) { while ($foo = $db->fetchObject($result)) { $tempArray[] = AccountFactory::createEntry($foo->type, $foo->id, $foo); } $db->freeResult($result); } return $tempArray; }
public function modInvitationList() { $usersInvite = AccountFactory::getModel('usersInvite'); $result = $usersInvite->getList(array('status' => AccountTableUsersInvite::PENDING), '10'); $html = '<ul>'; if (!empty($result)) { foreach ($result as $record) { $date = JXDate::formatDate($record->last_invite_date); $html .= '<li>' . $record->invite_email . ' invited on ' . $date . '</li>'; } } $html .= '</ul>'; return $html; }
/** * Open authorize window * Authorise the app to access user's resource */ public function authenticate() { if ($_POST) { $approved = JRequest::getVar('app_true'); $notApproved = JRequest::getVar('app_false'); $model = AccountFactory::getModel('token'); $mainframe = JFactory::getApplication(); if ($approved) { $user = JFactory::getUser(); if ($model->generateToken($user->id)) { $mainframe->redirect(JRoute::_('index.php?option=com_account&view=account'), JText::_('com_account_ACTION_APPROVED_PERFORMED')); } else { $mainframe->redirect(JRoute::_('index.php?option=com_account&view=account'), JText::_('com_account_ACTION_ERROR'), 'error'); } } else { if ($notApproved) { /* Action for cancel */ echo 'Canceled'; } } } parent::display(); }
<?php include 'AccountFactory.php'; include 'AccountManager.php'; $accountManager = new AccountManager(); $account = AccountFactory::getAccount($accountManager, AccountFactory::ACCOUNT_TYPE_CURRENT); $account->depositFounds(200); $account->displayBalance(); $account->getOverdraft()->appliedAgreedOverdraft(500); $account->displayBalance(); $account->withdrawFunds(300); $account->displayBalance();
/** * Create plusgiro account object using number * * @param string $number * @return PlusGiro * @throws Exception\UnableToCreateAccountException If unable to create */ public function createAccount($number) { return parent::createAccount($number); }
public static function createNew($type, $identifier) { $type = (int) $type; if ($type > 0 and $identifier != "") { $db = Database::instantiate(Database::TYPE_WRITE); $newSettings = array("PUSH_IN_URL" => "", "PUSH_IN_SECRET" => "", "PUSH_OUT_URL" => "", "PUSH_OUT_SECRET" => "", "PUSH_NEUTRAL_URL" => "", "PUSH_NEUTRAL_SECRET" => "", "SYNC_SECRET" => Utility::generatePassword(8)); $settings = serialize($newSettings); $query = "INSERT INTO pesapi_account(\n type,\n name,\n identifier,\n push_in,\n push_out,\n push_neutral,\n settings)\n VALUES(\n '{$type}',\n '',\n '" . $db->dbIn($identifier) . "',\n 0,\n 0,\n 0,\n '" . $db->dbIn($settings) . "')"; if ($db->query($query)) { return AccountFactory::createEntry($type, $db->insertId()); } } return null; }
// If page title is set, add it here. BUT, don't show it // if it is the same as site title (which mean, the title is not set) $docTitle = $document->getTitle(); if (!empty($docTitle) && $docTitle != $config->sitename) { echo '<h1>' . StreamTemplate::escape($docTitle) . '</h1>'; } ?> <jdoc:include type="component" /> <jdoc:include type="modules" name="component_bottom" style="default"/> </div> <div id="sidebar-right" class="grid_3"> <?php // Add guest invite right module $accountView = AccountFactory::getView('invite'); JXModule::addBuffer('right', $accountView->modMemberInvite()); $buffer =& JXModule::getBuffer('right'); foreach ($buffer as $buff) { echo $buff; } ?> <?php /* if($option == 'com_stream' && $view == 'company') { ?> <img src="<?php echo JURI::root().'components/com_stream/assets/images/hot_topics.png'; ?>" /> <?php } */ ?> </div> </div> </div><!-- #eContent -->
public function getPendingEmailCount($all = false) { $inviteModel = AccountFactory::getModel('usersinvite'); $userTbl = JTable::getInstance('AccountUser', 'AccountTable'); $inviteTbl = JTable::getInstance('usersinvite', 'AccountTable'); if ($all) { $filter = array('status' => AccountTableUsersInvite::PENDING); } else { $filter = array('status' => AccountTableUsersInvite::PENDING, 'days_ahead' => '3'); } $num = $inviteModel->getTotal($filter); return $num; }