本文整理汇总了PHP中Provider类的典型用法代码示例。如果您正苦于以下问题:PHP Provider类的具体用法?PHP Provider怎么用?PHP Provider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Provider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProviderDisplayName
function getProviderDisplayName()
{
$provider = new Provider();
$provider->person_id = $this->treating_person_id;
$provider->populate();
return $provider->person->getDisplayName();
}
示例2: __construct
public function __construct(array $data)
{
$this->measureNumber = isset($data['measureNumber']) ? (int) $data['measureNumber'] : 0;
$this->denominator = isset($data['denominator']) ? (int) $data['denominator'] : 0;
$this->numerator = isset($data['numerator']) ? (int) $data['numerator'] : 0;
$this->exclusions = isset($data['exclusions']) ? (int) $data['exclusions'] : 0;
$this->percentage = isset($data['percentage']) ? sprintf('%.2f', $data['percentage']) : 0;
if (isset($data['visitDateStart'])) {
$this->visitDateStart = date('m-d-Y', strtotime($data['visitDateStart']));
} else {
$this->visitDateStart = date('01-01-Y');
}
if (isset($data['visitDateEnd'])) {
$this->visitDateEnd = date('m-d-Y', strtotime($data['visitDateEnd']));
} else {
$this->visitDateEnd = date('12-31-Y');
}
$provider = isset($data['provider']) ? $data['provider'] : '';
if (!$data['provider'] instanceof Provider) {
$providerId = (int) $provider;
$provider = new Provider();
$provider->personId = $providerId;
$provider->populate();
}
$this->provider = $provider;
if (isset($data['fileNumber'])) {
$this->fileNumber = (int) $data['fileNumber'];
}
if (isset($data['numberOfFiles'])) {
$this->numberOfFiles = (int) $data['numberOfFiles'];
}
}
示例3: _createAudit
protected function _createAudit($providerId, $personId, $visitId, $type)
{
$providerId = (int) $providerId;
$personId = (int) $personId;
$visitId = (int) $visitId;
$audit = array();
$audit['objectClass'] = 'GenericAccessAudit';
$audit['objectId'] = $personId . ';' . $visitId;
$audit['type'] = (int) $type;
$audit['userId'] = $providerId;
$audit['patientId'] = $personId;
$values = array();
$provider = new Provider();
$provider->personId = $audit['userId'];
$provider->populate();
$values['provider'] = $provider->toArray();
$patient = new Patient();
$patient->personId = $personId;
$patient->populate();
$values['patient'] = $patient->toArray();
$values['personId'] = $patient->personId;
$visit = new Visit();
$visit->visitId = $visitId;
$visit->populate();
$values['visit'] = $visit->toArray();
$values['visitId'] = $visit->visitId;
$audit['auditValues'] = $values;
Audit::persistManualAuditArray($audit);
}
示例4: registerAction
public function registerAction()
{
$request = $this->getRequest();
$registerForm = new RegisterProvider();
if ($request->isPost()) {
$postData = $request->getPost();
$registerForm->setInputFilter(new RegisterProviderValidator($this->getServiceLocator()));
$registerForm->setData($postData);
if ($registerForm->isValid()) {
$providerData = $registerForm->getData();
$providerData = $this->prepareDataProvider($providerData);
$providerEntity = new Provider();
$providerEntity->exchangeArray($providerData);
$providerData = $providerEntity->getArrayCopy();
$providerDao = $this->getServiceDao('Model\\Dao\\ProviderDao');
$saved = $providerDao->saveProvider($providerData);
if ($saved) {
$this->sendMailRegisterConfirm($providerData);
$this->flashMessenger()->addMessage($providerData['email']);
print_r($providerData);
die;
} else {
throw new \Exception("Not Save Row");
}
} else {
$messages = $registerForm->getMessages();
//print_r($messages);die;
$registerForm->populateValues($postData);
}
}
$view['providerForm'] = $registerForm;
return new ViewModel($view);
}
示例5: __construct
public function __construct($tthis, $context, $data)
{
$this->tthis = $tthis;
$this->context = $context;
$this->data = $data;
$year = 0;
if (isset($tthis->_attributes['year'])) {
$year = (int) $tthis->_attributes['year'];
}
if (!$year > 0) {
$year = date('Y') - 1;
}
// default year to previous
$this->dateStart = date('Y-m-d', strtotime($year . '-01-01'));
$this->dateEnd = date('Y-m-d', strtotime($year . '-12-31'));
$this->providerId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
$providerId = (int) $this->context;
if ($providerId > 0) {
$this->providerId = $providerId;
}
$info = array();
$info['dateStart'] = $this->dateStart;
$info['dateEnd'] = $this->dateEnd;
$provider = new Provider();
$provider->personId = $this->providerId;
$provider->populate();
$info['provider'] = $provider;
self::$info = $info;
}
示例6: testGetProviderException
/**
* @covers mychaelstyle\storage\Factory::getProvider
* @covers mychaelstyle\ProviderFactory::getProvider
* @covers mychaelstyle\storage\Factory::getPackage
* @covers mychaelstyle\storage\Factory::getPath
*/
public function testGetProviderException()
{
// invalid
$def = $this->dsnMap['Local'];
$this->setExpectedException('mychaelstyle\\Exception');
$provider = $this->object->getProvider('', $def['options']);
}
示例7: testArr
public function testArr()
{
$data = ["a" => "b"];
$provider = new Provider($data);
$this->assertEquals($data, $provider->getDataAsArray());
$this->assertEquals($data, $provider->exportFromArray($data));
}
示例8: add
/**
* [add description]
*
* @param Provider $provider [description]
*
* @return [type] [description]
*/
public function add(Provider $provider)
{
$provider->setApplication($this->app);
$providerName = get_class($provider);
if (!isset($this->providers[$providerName])) {
$this->providers[$providerName] = $provider;
}
}
示例9: test_get_user_details_throws_exception_if_user_rejects_application
/**
* @expectedException AdamWathan\EloquentOAuth\Exceptions\ApplicationRejectedException
*/
public function test_get_user_details_throws_exception_if_user_rejects_application()
{
$redirectUri = 'http://myapp.dev/provider/login';
$config = array('id' => '1', 'secret' => 'foobar', 'redirect' => $redirectUri);
$httpClient = M::mock('GuzzleHttp\\Client')->shouldIgnoreMissing();
$input = M::mock('Illuminate\\Http\\Request')->shouldIgnoreMissing();
$provider = new Provider($config, $httpClient, $input);
$httpClient->shouldReceive('post->getBody')->andReturn('abc123');
$httpClient->shouldReceive('get->getBody')->andReturn('{"user_id":"1","nick_name":"john.doe","first_name":"John","last_name":"Doe","email":"john.doe@example.com","photo":"http:\\/\\/example.com\\/photos\\/john_doe.jpg"}');
$input->shouldReceive('has')->andReturn(false);
$details = $provider->getUserDetails();
}
示例10: proceduresAction
public function proceduresAction()
{
$visitId = (int) $this->_getParam('visitId');
$visit = new Visit();
$visit->visitId = $visitId;
if ($visitId > 0) {
$visit->populate();
}
$provider = new Provider();
$providerIterator = $provider->getIter();
$this->view->listProviders = $providerIterator->toArray('personId', 'displayName');
$this->view->providerId = (int) $visit->providerId;
$this->render();
}
示例11: getInstance
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new Provider();
}
return self::$instance;
}
示例12: editAction
public function editAction()
{
$personId = (int) $this->_getParam('personId');
if (isset($this->_session->messages)) {
$this->view->messages = $this->_session->messages;
}
$this->_form = new WebVista_Form(array('name' => 'provider-detail'));
$this->_form->setAction(Zend_Registry::get('baseUrl') . "admin-providers.raw/edit-process");
$this->_provider = new Provider();
$this->_provider->person_id = $personId;
if (!$this->_provider->populate()) {
if ($personId > 0) {
//handle case where person exists but no provider record
$this->view->noProvider = true;
}
//do nothing if personId is 0, no person selected yet
}
$this->_form->loadORM($this->_provider, 'provider');
//var_dump($this->_form);
$this->view->form = $this->_form;
$this->view->person = $this->_provider;
$stations = Enumeration::getEnumArray(Routing::ENUM_PARENT_NAME);
$stations = array_merge(array('' => ''), $stations);
$this->view->stations = $stations;
$specialties = array('' => '');
$listSpecialties = Provider::getListSpecialties();
// temporarily use AM = American Medical Association
foreach ($listSpecialties['AM'] as $specialty) {
$specialties[$specialty['code']] = $specialty['description'];
}
$this->view->specialties = $specialties;
$this->view->colors = Room::getColorList();
$this->render('edit');
}
示例13: getProductsData
/**
* Get products data
*
* @return array
*/
public function getProductsData()
{
$productsData = [];
$provider = new Provider();
foreach ($this->_brands as $brandId => $brand) {
$categoryUrl = $provider->getCategoryUrl(self::STORE_URL, $brandId, self::ALL_CATEGORY_PRODUCTS);
if ($categoryUrl) {
$productUrls[$categoryUrl] = $provider->getProductUrls($this->_addStoreUrl($categoryUrl));
foreach ($productUrls[$categoryUrl] as $index => $productUrl) {
$productData = $provider->getProductData($this->_addStoreUrl($productUrl));
$productsData[$productUrl] = $this->_addBrandToProductData($productData, $brand);
}
}
}
return $productsData;
}
示例14: __Construct
function __Construct($dictionary)
{
parent::__Construct(get_class(), "desktop.html", $dictionary);
//get input params
$paymentConfigCode = Params::Get('state');
$authCode = Params::Get('code');
//load provider (verify code)
$provider = Provider::FromPaymentConfigCode($paymentConfigCode);
if (is_null($provider)) {
//TODO: deal with this
} else {
//check stripe id isn't already set
if (!is_null($provider->getStripeAccountId())) {
//TODO: deal with this
} else {
$stripeAccount = StripeConnector::ConstructAccount($authCode);
if (is_null($stripeAccount)) {
//TODO: deal with this
} else {
//add to provider - clear code
$provider->setStripeAccountId($stripeAccount->getId());
$provider->setPaymentConfigCode(null);
$provider->save();
//notify success
$this->connected = true;
}
}
}
}
示例15: getProviderName
public function getProviderName($provider_id)
{
$provider = Provider::model()->findByPk($provider_id);
if ($provider) {
return $provider->provider_name;
}
return 'Medlatec';
}