当前位置: 首页>>代码示例>>PHP>>正文


PHP Branch::findOne方法代码示例

本文整理汇总了PHP中Branch::findOne方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::findOne方法的具体用法?PHP Branch::findOne怎么用?PHP Branch::findOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Branch的用法示例。


在下文中一共展示了Branch::findOne方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUserBranchName

 /** Zwraca nazwę jednostki przez którą użytkownik będzie łączył sie z Def,
  *  jeżeli wybrany DEF nie jest głównym defem usera zwrócona zostanie defaultowa jednostka
  *
  * @param string $BaCode - backend_application_code z tabeli backendApplication
  * @return string - jednostka przez którą user powinien łączyć się z DEF
  */
 public static function getUserBranchName($BaCode)
 {
     $BaCode = strtolower($BaCode);
     $user = Zend_Auth::getInstance()->getIdentity();
     $branchName = null;
     $branch = new Branch();
     if (strtolower($user->jednostka['application_code']) == strtolower($BaCode)) {
         $branchName = $user->jednostka['symbol_def'];
     } else {
         $branchName = $user->default_branches[$BaCode]['symbol_def'];
     }
     $branchName = $branch->findOne($user->id_branch);
     return $branchName->symbol_def;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:20,代码来源:Factory.php

示例2: describe

 public function describe()
 {
     $this->unserialize();
     $old = $this->old_serialized;
     $new = $this->new_serialized;
     switch ($this->priority) {
         case Logic_Log_Admin::USEREDIT:
             if ($old instanceof Row_User && $new instanceof Row_User) {
                 $oldData = $old->toArray();
                 $newData = $new->toArray();
                 $changes = array();
                 $headers = $old->getHeaderMappings();
                 $translate = Zend_Registry::get('Zend_Translate');
                 foreach ($oldData as $col => $val) {
                     if ($newData[$col] != $val) {
                         $description = isset($headers[$col]) ? $translate->_($headers[$col]['title']) : $col;
                         $description .= ': z "' . $oldData[$col] . '" na "' . $newData[$col] . '"';
                         $description = $description;
                         $changes[] = $description;
                     }
                 }
                 return 'Zmieniono ' . implode(', ', $changes);
             }
         case Logic_Log_Admin::ROLEADD:
         case Logic_Log_Admin::ROLEDELETE:
             $role = new Role();
             if ($old instanceof Row_ProfileRole) {
                 $row = $role->findOne($old->id_role);
                 return 'Odebrano rolę ' . $row->role_name;
             } elseif ($new instanceof Row_ProfileRole) {
                 $row = $role->findOne($new->id_role);
                 return 'Przyznano rolę ' . $row->role_name;
             }
             break;
         case Logic_Log_Admin::PROFILEADD:
         case Logic_Log_Admin::PROFILEDELETE:
             $branch = new Branch();
             if ($old instanceof Row_Profile) {
                 $row = $branch->findOne($old->id_branch);
                 return 'Usunięto profil ' . $row->branch_name;
             } elseif ($new instanceof Row_Profile) {
                 $row = $branch->findOne($new->id_branch);
                 return 'Dodano profil ' . $row->branch_name;
             }
             break;
         case Logic_Log_Admin::USERLOCK:
             $newData = $new->toArray();
             $description = 'Dodano blokadę konta';
             $from = date('Y-m-d', strtotime($newData['timelock_start']));
             $to = date('Y-m-d', strtotime($newData['timelock_end']));
             if ($from != '1970-01-01') {
                 $description .= ' od ' . $from;
             }
             if ($to != '1970-01-01') {
                 $description .= ' do ' . $to;
             }
             if (!empty($newData['lock_reason'])) {
                 $description .= ', powód blokady: ' . $newData['lock_reason'];
             } else {
                 $description .= ', nie podano powodu blokady';
             }
             return $description;
             break;
         case Logic_Log_Admin::USERUNLOCK:
             return 'Odblokowano konto użytkownika';
             break;
         case Logic_Log_Admin::USERDELETE:
             $newData = $new->toArray();
             $time = '';
             if (!empty($newData['last_lock_at'])) {
                 $time = date('Y-m-d', strtotime($newData['last_lock_at']));
             } else {
                 $time = date('Y-m-d', strtotime($newData['timelock_start']));
             }
             $description = 'Trwale dezaktywowano konto użytkownika od ' . $time;
             if (!empty($newData['lock_reason'])) {
                 $description .= ', powód blokady: ' . $newData['lock_reason'];
             } else {
                 $description .= ', nie podano powodu blokady';
             }
             return $description;
             break;
         case Logic_Log_Admin::INTERESTCHANGE:
             $negotiationId = array_shift(array_keys($new));
             $oldData = $old[$negotiationId];
             $newData = $new[$negotiationId];
             $descriptionArray = array();
             foreach ($oldData as $step => $options) {
                 foreach ($options as $optionKey => $option) {
                     if ($option != $newData[$step][$optionKey]) {
                         $descriptionArray[] = 'krok ' . $step . ' - wariant ' . $optionKey . ': zmiana z ' . number_format($option, 3) . '% na ' . number_format($newData[$step][$optionKey], 3) . '%';
                     }
                 }
             }
             return implode(', ', $descriptionArray);
             break;
     }
 }
开发者ID:knatorski,项目名称:SMS,代码行数:98,代码来源:AdminPanel.php

示例3: getSmsDataForContent

 /**
  *
  * @param bigint $id - id kontaktu
  * @param integer $contentType - id rodzaju akcji po ktorej wybieramy odpowiednia tresc smsa.
  * @return <type>
  *
  * Ustalamy tresc wiadomosci do sms-a.
  */
 public function getSmsDataForContent($id, $contentType, $responsible_adviser = null, $responsible_branch = null)
 {
     $modelContact = new Contact();
     $dataContact = $modelContact->findOne($id);
     /**
      * Zabezpieczenie przeciwko pustemu opiekunowi w wypadku umawiania spotkania z oddzialu przez doradce.
      */
     if ($dataContact['id_guardian'] == '') {
         $dataContact['id_guardian'] = Zend_Auth::getInstance()->getIdentity()->id;
     }
     $this->pl = array('Ą', 'ą', 'Ż', 'ż', 'ź', 'Ź', 'Ć', 'ć', 'Ń', 'ń', 'Ł', 'ł', 'Ś', 'ś', 'Ę', 'ę', 'Ó', 'ó');
     $this->notpl = array('A', 'a', 'Z', 'z', 'z', 'Z', 'C', 'c', 'N', 'n', 'L', 'l', 'S', 's', 'E', 'e', 'O', 'o');
     $modelUser = new User();
     try {
         $dataUser = $modelUser->findOne($dataContact['id_guardian']);
         $userFirstName = str_replace($this->pl, $this->notpl, $dataUser['first_name']);
         $userSurname = str_replace($this->pl, $this->notpl, $dataUser['surname']);
         $smsData['user'] = $userFirstName . ' ' . $userSurname;
         $smsData['advisor_phone'] = $dataUser['phone'];
     } catch (Exception $e) {
         throw new $e();
     }
     $formatHelper = new Base_View_Helper_Format();
     $modelMeeting = new Meeting();
     $dataMeeting = $dataContact->getNextEvent();
     $dataMeeting = $dataMeeting->toArray();
     if ($dataMeeting != null) {
         if ($dataMeeting['event_at'] != null) {
             $values['meeting_at'] = $formatHelper->Format($dataMeeting['event_at'], 'date_time_simple');
         }
     }
     $modelBranch = new Branch();
     if ($responsible_branch != "" && $responsible_branch != null) {
         $dataBranch = $modelBranch->findOne($responsible_branch);
     } else {
         $dataBranch = $modelBranch->findOne($dataMeeting['responsible_branch']);
     }
     $smsData['branch'] = str_replace($this->pl, $this->notpl, $dataBranch['city']) . ' ' . str_replace($this->pl, $this->notpl, $dataBranch['address']);
     $modelContactData = new AdditionalContactData();
     $contactSmsNumber = $modelContactData->getMainSmsNumber($id);
     $contactSmsNumber = $contactSmsNumber->toArray();
     $modelContactData = new AdditionalContactData();
     $contactMainPhoneNumber = $modelContactData->getMainCellPhone($id);
     $contactMainPhoneNumber = $contactMainPhoneNumber->toArray();
     if (isset($contactSmsNumber[0]['data'])) {
         $values['recipient_number'] = '+48' . $contactSmsNumber[0]['data'];
     } elseif (isset($contactMainPhoneNumber[0]['data'])) {
         $values['recipient_number'] = '+48' . $contactMainPhoneNumber[0]['data'];
     } else {
         $values['recipient_number'] = '+48' . $dataContact['cell_phone'];
     }
     $produkty[677] = "zalozenie dzialalnosci";
     $produkty[678] = "ksiegowosc";
     $produkty[679] = "ksiegowosc";
     $produkty[680] = "dotacje";
     $produkty[681] = "kredyt";
     $produkty[682] = "leasing";
     $produkty[683] = "program do faktur";
     $produkty[686] = "emeryture";
     $produkty[687] = "ksiegowosc";
     $produkty[688] = "ZUS";
     $sexWords[1][1] = "Chcialbym";
     $sexWords[1][2] = "probowalem";
     $sexWords[1][3] = "Chcialem";
     $sexWords[2][1] = "Chcialabym";
     $sexWords[2][2] = "probowalam";
     $sexWords[2][3] = "Chcialam";
     $translate = new Zend_View_Helper_Translate();
     $dataSpotkania = array();
     $dataSpotkania['dzienSlownie'] = $translate->translate(date('l', strtotime($values['meeting_at'])));
     $daysLong = array('poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota', 'niedziela');
     $daysShort = array('pon.', 'wto.', 'srod.', 'czwa.', 'pia.', 'sob.', 'niedz.');
     $dataSpotkania['dzienSlownie'] = str_replace($daysLong, $daysShort, $dataSpotkania['dzienSlownie']);
     $dataSpotkania['dzien'] = date('d.m.y', strtotime($values['meeting_at']));
     $dataSpotkania['godzina'] = date('G:i', strtotime($values['meeting_at']));
     $dataSpotkaniaText = $dataSpotkania['dzien'] . ' (' . $dataSpotkania['dzienSlownie'] . '), godz. ' . $dataSpotkania['godzina'];
     if ($dataContact['sex'] == 1) {
         /**
          * Wiadomosci generowane po umowieniu spotkania oraz zmianie we wczesniejszym umowieniu spotkania.
          */
         if ($contentType == 1) {
             $values['sms_content'] = "Witam, zapraszam Pana na spotkanie z Doradca Tax Care: " . $dataSpotkaniaText . ", " . $smsData['branch'] . ", " . $smsData['user'] . " tel. 222620000";
         } elseif ($contentType == 2) {
             if (array_key_exists($dataContact['id_product_type'], $produkty)) {
                 $values['sms_content'] = "Witam! " . $sexWords[$dataUser['sex']][3] . " sie z Panem skontaktowac w zwiazku z wyslanym zapytaniem o " . $produkty[$dataContact['id_product_type']] . ". Zapraszam do kontaktu. " . $smsData['user'] . " tel. 222620000";
             } else {
                 $values['sms_content'] = "Witam! " . $sexWords[$dataUser['sex']][3] . " sie z Panem skontaktowac w zwiazku z wyslanym zapytaniem. Zapraszam do kontaktu. " . $smsData['user'] . " tel. 222620000";
             }
         } elseif ($contentType == 3) {
             if (array_key_exists($dataContact['id_product_type'], $produkty)) {
                 $values['sms_content'] = "Witamy! W zwiazku z wyslanym zapytaniem o " . $produkty[$dataContact['id_product_type']] . " zapraszamy do kontaktu. Czekamy na telefon od Pana pod nr 222620000. Do uslyszenia. Tax Care.";
             } else {
//.........这里部分代码省略.........
开发者ID:knatorski,项目名称:SMS,代码行数:101,代码来源:Event.php

示例4: getBranch

 /**
  * Pobranie oddziału dla profilu
  *
  * @return Row_Branch
  */
 public function getBranch()
 {
     $model = new Branch();
     return $model->findOne($this->id_branch);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:10,代码来源:Profile.php

示例5: updateFromTeta

 public function updateFromTeta($id, $symbol, $code, $address = null)
 {
     $branch = new Branch();
     $data = $branch->findOne($id);
     $data->setFromArray(array('id_status' => 1, 'branch_name' => $code, 'symbol' => $symbol, 'address' => $address))->save();
 }
开发者ID:knatorski,项目名称:SMS,代码行数:6,代码来源:Branch.php

示例6: defined

    echo "\n\n" . $e->getMessage() . "\n\n" . $e->getUsageMessage() . "\n\n";
    exit;
}
if (isset($opts->h)) {
    echo "\n\n" . $opts->getUsageMessage() . "\n\n";
    exit;
}
if (isset($opts->app_env)) {
    defined('APPLICATION_ENV') || define('APPLICATION_ENV', $opts->app_env);
} else {
    echo "\n\nParametr app_env jest wymagany!";
    echo "\n\n" . $opts->getUsageMessage() . "\n\n";
    exit;
}
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap();
$u = new User();
$u_data = $u->findOne(1)->toArray();
$storageRow = new stdClass();
foreach ($u_data as $key => $value) {
    $storageRow->{$key} = $value;
}
$auth = Zend_Auth::getInstance();
$storage = $auth->getStorage();
$o = new Branch();
$data = $o->findOne(1)->toArray();
$storageRow->jednostka = $data;
$storage->write($storageRow);
开发者ID:knatorski,项目名称:SMS,代码行数:31,代码来源:init2.php


注:本文中的Branch::findOne方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。