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


PHP Branch::fetchRow方法代码示例

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


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

示例1: getCurrentProfile

 /**
  *
  * @TODO cach profilu
  */
 protected function getCurrentProfile()
 {
     if (defined('CMD')) {
         $config = Zend_Registry::get('config');
         if ($config['bin']['user'] === null || $config['bin']['branch'] === null) {
             throw new Exception('Brak ustawień w application.ini bin.user lub bin.branch');
         }
         $u = new User();
         $u_data = $u->fetchRow("login = '" . $config['bin']['user'] . "'", "id DESC")->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->fetchRow("branch_name = '" . $config['bin']['branch'] . "'", "id DESC")->toArray();
         $storageRow->jednostka = $data;
         $profile = new Profile();
         $profiles = $profile->fetchAll(array('id_user = ' . $u_data['id'], 'id_branch = ' . $data['id'], 'ghost = false'));
         if (count($profiles)) {
             $storageRow->profile_id = $profiles[0]['id'];
         }
         $storage->write($storageRow);
     }
     if (defined('CMD') && defined('EXPORT_ID_USER')) {
         $identity['id'] = EXPORT_ID_USER;
         $where_id = $identity['id'];
     } else {
         $where_id = Zend_Auth::getInstance()->getIdentity() ? Zend_Auth::getInstance()->getIdentity()->id : '';
     }
     if (!$this->currentProfile and $where_id) {
         $cm = $this->getBootstrap()->getResource('cachemanager');
         $cache = $cm->getCache('rolecache');
         $cache_id = str_replace("-", "", 'OUcache' . ODDZIAL_ID . '_' . $where_id);
         if (!($this->currentProfile = $cache->load($cache_id))) {
             $profilModel = new Profile();
             $this->currentProfile = $profilModel->fetchRow(array("id_user = {$where_id}", "id_branch = " . ODDZIAL_ID, 'ghost = false'));
             $cache->save($this->currentProfile, $cache_id);
         }
     }
     return $this->currentProfile;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:47,代码来源:Abstract.php

示例2: prepareData

 public function prepareData($data)
 {
     foreach ($this->checkfield as $cos) {
         if (array_search($cos, $this->headers) === false) {
             throw new Exception('There is no data to check duplicates');
         }
     }
     $invalid = array();
     foreach ($data as $value) {
         if ($this->checkDuplicates($value) == true) {
             $value['valid_until'] = date('c', time() + 2 * 365 * 24 * 60 * 60);
             $branch = new Branch();
             $bdata = $branch->fetchRow("branch_name = '{$value['id_branch']}'");
             $value['id_branch'] = $bdata['id'];
             $this->add($value, $invalid);
         } else {
             $invalid[] = $value;
         }
     }
     return $ile = count($invalid);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:21,代码来源:User.php

示例3: Exception

/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
Base_Controller_Action_Helper_Currentip::$_unitTestEnabled = true;
$application->bootstrap();
Zend_Controller_Front::getInstance()->setParam('bootstrap', $application->getBootstrap());
$user = $application->getOption('bin');
if ($user['user'] === null || $user['branch'] === null) {
    throw new Exception('Brak ustawień w application.ini bin.user lub bin.branch');
}
$u = new User();
$u_data = $u->fetchRow("login = '" . $user['user'] . "'", "id DESC");
if (null == $u_data) {
    throw new Exception('Brak użytkownika o podanym loginie ' . $user['user']);
}
$u_data->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->fetchRow("branch_name = '" . $user['branch'] . "'", "id DESC");
if (null == $u_data) {
    throw new Exception('Brak Branch\'a ' . $user['branch']);
}
$data->toArray();
$storageRow->jednostka = $data;
$storage->write($storageRow);
开发者ID:knatorski,项目名称:SMS,代码行数:31,代码来源:init.php

示例4: syncProducts

 public static function syncProducts($type, $brand)
 {
     $db = new DEFProduct();
     $auth = Zend_Auth::getInstance();
     $user_id = $auth->getIdentity()->id;
     $model = new Branch();
     $row = $model->fetchRow(array('branch_name ilike \'' . $brand . '\''));
     if ($row === null) {
         throw new Logic_Exception('Cannot detect branch id');
     }
     $idBranch = $row->id;
     foreach (self::getDefProductsArray($type, $brand) as $product) {
         $where = $db->select()->where('product_type = ?', $type)->where('id_branch = ?', $idBranch)->where('symbol = ?', $product['symbol'])->where('ghost = ?', 'f');
         $same = $db->fetchRow($where);
         $active = false;
         if ($same) {
             $db->update(array('ghost' => 't'), array('product_type = ?' => $type, 'symbol = ?' => $product['symbol'], 'ghost = ?' => 'f', 'id_branch = ?' => $idBranch));
             $active = $same->active;
         }
         if ($active) {
             $active = 't';
         } else {
             $active = 'f';
         }
         $key = $db->insert(array('def_id' => $product['id_prod'], 'symbol' => $product['symbol'], 'short_desc' => $product['short_desc'], 'desc' => $product['desc'], 'min_amount' => (double) $product['min_amnt'], 'min_amount_currency' => (int) $product['min_amnt_currency'], 'currency' => (int) $product['currency'], 'active' => $active, 'ghost' => 'f', 'product_type' => $type, 'id_branch' => $idBranch, 'id_user' => $user_id));
     }
 }
开发者ID:knatorski,项目名称:SMS,代码行数:27,代码来源:Inputdata.php


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