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


PHP is_Object函数代码示例

本文整理汇总了PHP中is_Object函数的典型用法代码示例。如果您正苦于以下问题:PHP is_Object函数的具体用法?PHP is_Object怎么用?PHP is_Object使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: hSet

 public static function hSet($key, $field, $value)
 {
     if (is_array($value) || is_Object($value)) {
         $value = json_encode($value);
     }
     return self::connection()->hset($key, $field, $value);
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:7,代码来源:RedisHelper.php

示例2: hSet

 public function hSet($key, $field, $value)
 {
     if (is_array($value) || is_Object($value)) {
         $value = json_encode($value);
     }
     return $this->connection->hset($key, $field, $value);
 }
开发者ID:huycao,项目名称:yodelivery,代码行数:7,代码来源:RedisBaseModel.php

示例3: print_ro

function print_ro($object, $alsoIgnore = array(), $tab = 0)
{
    // prints an object/array, but removes the $parent, and anything inside alsoIgnore
    $pad = "";
    if (!in_array('parent', $alsoIgnore)) {
        $alsoIgnore[] = "parent";
    }
    for ($c = 0; $c < $tab; $c++) {
        $pad .= "\t";
    }
    foreach ($object as $key => $value) {
        if (!is_numeric($key) && in_array($key, $alsoIgnore)) {
            echo $pad . $key . " => *HIDDEN*\n";
        } else {
            if (is_Array($value) || is_Object($value)) {
                if (is_Array($value)) {
                    echo "{$pad}{$key} => Array (\n";
                } else {
                    echo "{$pad}{$key} => Object (\n";
                }
                print_ro($value, $alsoIgnore, $tab + 1);
                echo $pad . ")\n";
            } else {
                echo $pad . $key . " => " . $value . "\n";
            }
        }
    }
}
开发者ID:Prescia,项目名称:Prescia,代码行数:28,代码来源:basic.php

示例4: getUserId

 public function getUserId($username = '')
 {
     if ($username == '') {
         $userRecord = UserRecord::finder()->find('user_username = ?', $this->Name);
     } else {
         $userRecord = UserRecord::finder()->find('user_username = ?', $username);
     }
     if (is_Object($userRecord)) {
         return $userRecord->idtm_user;
     } else {
         return 0;
     }
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:13,代码来源:GSProcUser.php

示例5: setValue

 public function setValue($request, $response)
 {
     $id = $request->id;
     $vars['type'] = $request->type;
     $vars['status'] = $request->status;
     $vars['comment'] = $request->getRequest('comment');
     $admin = UserClient::getInstance()->getCurrentUser();
     $id = UserClient::getInstance()->modifyUserAdvice($id, $vars, $admin);
     $userAdvice = DAL::get()->find('UserAdvice', $id);
     if (is_Object($userAdvice) && $userAdvice->source == '管理员发起的认证任务' && $vars['status'] == -1) {
         $predoctor = DAL::get()->find_by_userid('predoctor', $userAdvice->user->id);
         $inspector = DAL::get()->find_by_userid('inspector', $admin->id);
         if (false == $predoctor->isNull() && false == $inspector->isNull()) {
             PreDoctorClient::getInstance()->setResultNo($predoctor->id, $inspector->id);
         }
     }
     return self::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:18,代码来源:useradvicecontroller.php

示例6: debugObject

 function debugObject($obj, $indent = 0)
 {
     if (is_Array($obj) || is_Object($obj)) {
         $return = '';
         while (list($k, $v) = each($obj)) {
             for ($i = 0; $i < $indent; $i++) {
                 $return .= '&nbsp;';
             }
             $return .= $k . "->{$v}\n";
             $return .= $this->debugObject($v, $indent + 1);
         }
         return $return;
     }
 }
开发者ID:BGCX067,项目名称:faireconnaitre-svn-to-git,代码行数:14,代码来源:whois.utils.php

示例7: register

 public static function register($ClassName)
 {
     $Obj = self::singleton();
     $ClassName = strtolower($ClassName);
     if ($Obj->getObject($ClassName) != NULL) {
         return $Obj->getObject($ClassName);
     }
     $Class = $ClassName;
     $Obj->setObject($ClassName, new $Class());
     $Object = $Obj->getObject($ClassName);
     if (is_Object($Object)) {
         return $Object;
     }
 }
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:14,代码来源:common.php

示例8: onInit

 /**
  * Populates the datagrid with user lists.
  * This method is invoked by the framework when initializing the page
  * @param mixed event parameter
  */
 public function onInit($param)
 {
     parent::onInit($param);
     if (!$this->IsPostBack) {
         // get the total number of posts available
         $criteria = new TActiveRecordCriteria();
         $criteria->Condition = 'idtm_user = :idtm_user';
         $criteria->Parameters[':idtm_user'] = $this->User->getUserId($this->User->Name);
         if (is_Object(ParteiRecord::finder()->find($criteria))) {
             $this->Repeater->VirtualItemCount = ParteiRecord::finder()->find($criteria)->count();
         }
         // populates post data into the repeater
         $this->populateData();
     }
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:20,代码来源:partei.php

示例9: onKernelRequest

 public function onKernelRequest(GetResponseEvent $event)
 {
     $route = $event->getRequest()->attributes->get('_route');
     if ($route == 'livraison' || $route == 'validation') {
         if ($this->session->has('panier')) {
             if (count($this->session->get('panier')) == 0) {
                 $event->setResponse(new RedirectResponse($this->router->generate('panier')));
             }
         }
         if (!is_Object($this->securityContext->getToken()->getUser())) {
             $this->session->getFlashBag()->add('notification', 'Vous devez vous identifier');
             $event->setResponse(new RedirectResponse($this->router->generate('fos_user_security_login')));
         }
     }
 }
开发者ID:nassafou,项目名称:Ecommerce,代码行数:15,代码来源:RedirectionListener.php

示例10: saveStrukturBericht

 public function saveStrukturBericht($sender, $param)
 {
     $mySession = "";
     $mySession = UserFelderRecord::finder()->findAllBy_user_id($this->User->getUserId($this->User->Name));
     foreach ($mySession as $myFieldRecord) {
         $arr_newValues = array();
         //very important!!! otherwise we have values which dont exist
         $arr_MyFields = array();
         $uniqueID = $myFieldRecord->tuf_feldname;
         //lets start the saving
         //$UniqueID = 'xxx'.$inp_per_year.'xxx'.$inp_per_month.'xxx'.$inp_idta_struktur_type.'xxx'.$inp_idta_feldfunktion.'xxx'.$inp_idtm_struktur.'xxx'.$inp_idta_variante.'xxx';
         //$SaveString = $jahr."xxx".$monat."xxx".$local_ff."xxx".$local_id; definition of the string to pass
         $arr_MyFields = preg_split("/xxx/", $uniqueID);
         $tt_per_year = $arr_MyFields[1];
         $tt_per_month = $arr_MyFields[2];
         $tt_idta_struktur_type = $arr_MyFields[3];
         $tt_idta_feldfunktion = $arr_MyFields[4];
         $tt_idtm_struktur = $arr_MyFields[5];
         $tt_idta_variante = $arr_MyFields[6];
         //abrufen des aktuellen DB-Wertes
         $ExistingValue = WerteRecord::finder()->findBySql("SELECT w_wert FROM tt_werte WHERE idtm_struktur = '" . $tt_idtm_struktur . "' AND idta_feldfunktion = '" . $tt_idta_feldfunktion . "' AND w_jahr = '" . $tt_per_year . "' AND w_monat = '" . $tt_per_month . "' AND w_id_variante = '" . $tt_idta_variante . "' LIMIT 1");
         //formatieren, damit es mit dem inhalt aus der zelle vergleichbar wird
         //CHECKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
         if (is_Object($ExistingValue)) {
             $CompareValue = number_format($ExistingValue->w_wert, 2, '.', '');
         } else {
             $CompareValue = "0.00";
         }
         //here I start the magic server calculation;)
         if ($CompareValue === $this->page->ACTPanel->FindControl($uniqueID)->Text) {
         } else {
             $ObjSaver = new PFBackCalculator();
             $ObjSaver->setVariante($tt_idta_variante);
             $ObjSaver->setStartPeriod($tt_per_month);
             $ObjSaver->setStartNode($tt_idtm_struktur);
             //$SaveString = $tt_per_year."xxx".$tt_per_month."xxx".$tt_idta_feldfunktion."xxx".$tt_idtm_struktur;
             //$NEWWerteRecord = WerteRecord::finder()->findBySql("SELECT * FROM tt_werte WHERE idtm_struktur = '".$tt_idtm_struktur."' AND idta_feldfunktion = '".$tt_idta_feldfunktion."' AND w_jahr = '".$tt_per_year."' AND w_monat = '".$tt_per_month."' AND w_id_variante = '".$tt_idta_variante."' LIMIT 1");
             $arr_newValues[$tt_idta_feldfunktion] = $this->page->ACTPanel->FindControl($uniqueID)->Text;
             $ObjSaver->setNewValues($arr_newValues);
             $ObjSaver->run();
             unset($ObjSaver);
         }
     }
     $sender->Text = "Saved";
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:45,代码来源:StrukturBerichtViewer_WORKING201010.php

示例11: loadArticles

 /**
  * Load article list of this product and store in private class variable
  *
  * @return array Article uids
  */
 public function loadArticles()
 {
     if ($this->articlesLoaded == FALSE) {
         $uidToLoadFrom = $this->uid;
         if ($this->getT3verOid() > 0 && $this->getT3verOid() != $this->uid && (is_Object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->beUserLogin)) {
             $uidToLoadFrom = $this->getT3verOid();
         }
         if ($this->articles_uids = $this->databaseConnection->getArticles($uidToLoadFrom)) {
             foreach ($this->articles_uids as $articleUid) {
                 /**
                  * Article
                  *
                  * @var Tx_Commerce_Domain_Model_Article $article
                  */
                 $article = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_Article', $articleUid, $this->lang_uid);
                 $article->loadData();
                 $this->articles[$articleUid] = $article;
             }
             $this->articlesLoaded = TRUE;
             return $this->articles_uids;
         } else {
             return FALSE;
         }
     }
     return $this->articles_uids;
 }
开发者ID:AndreasA,项目名称:commerce,代码行数:31,代码来源:Product.php

示例12: getBacktrace

/**
 * 获取当前堆栈.
 */
function getBacktrace() {
	$traces = debug_backTrace ();
	$str = "\n\nback trace:";
	for($i = 1; $i < count ( $traces ); $i ++) {
		$trace = $traces [$i];
		$class = @$trace ['class'] ? @$trace ['class'] . @$trace ['type'] : '';
		$str .= "\n##$i " . @$trace ['file'] . " (" . @$trace ['line'] . "), call function $class" . @$trace ['function'] . "(";
		if ($i > 1) {
			foreach ( @$trace ['args'] as $arg ) {
				if (is_array ( $arg )) {
					$str .= "Array, ";
				} else if (is_Object ( $arg )) {
					$str .= "Object, ";
				} else if (is_bool ( $arg )) {
					$str .= $arg ? 'true, ' : 'false, ';
				} else {
					$str .= "$arg, ";
				}
			}
		}
		$str .= ");";
	}
	return $str;
}
开发者ID:neil-chen,项目名称:NeilChen,代码行数:27,代码来源:FunctionsBase.php

示例13: loadArticles

 /**
  * Load article list of this product and store in private class variable.
  *
  * @return array Article uids
  */
 public function loadArticles()
 {
     if (!is_array($this->articles)) {
         $uidToLoadFrom = $this->uid;
         if ($this->getT3verOid() > 0 && $this->getT3verOid() != $this->uid && (is_Object($this->getFrontendController()) && $this->getFrontendController()->beUserLogin)) {
             $uidToLoadFrom = $this->getT3verOid();
         }
         $this->articles = array();
         if ($this->articles_uids = $this->databaseConnection->getArticles($uidToLoadFrom)) {
             foreach ($this->articles_uids as $articleUid) {
                 /**
                  * Article.
                  *
                  * @var \CommerceTeam\Commerce\Domain\Model\Article $article
                  */
                 $article = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Article', $articleUid, $this->lang_uid);
                 $article->loadData();
                 $this->articles[$articleUid] = $article;
             }
             return $this->articles_uids;
         } else {
             return false;
         }
     }
     return $this->articles_uids;
 }
开发者ID:BenjaminBeck,项目名称:commerce,代码行数:31,代码来源:Product.php

示例14: convertCurrencyTo

 /**
  *
  * @author Max Milbers
  * @param unknown_type $currency
  * @param unknown_type $price
  * @param unknown_type $shop
  */
 function convertCurrencyTo($currency, $price, $shop = true)
 {
     if (empty($currency)) {
         // 			vmdebug('empty  $currency ',$price);
         return $price;
     }
     // If both currency codes match, do nothing
     if (is_Object($currency) and $currency->_currency_id == $this->_vendorCurrency or !is_Object($currency) and $currency == $this->_vendorCurrency) {
         // 			vmdebug('  $currency == $this->_vendorCurrency ',$price);
         return $price;
     }
     /*		if($shop){
     			// TODO optimize this... the exchangeRate cant be cached, there are more than one currency possible
     		//			$exchangeRate = &$this->exchangeRateVendor;
     		$exchangeRate = 0;
     		} else {
     		//caches the exchangeRate between shopper and vendor
     		$exchangeRate = &$this->exchangeRateShopper;
     		}
     		*/
     //		if(empty($exchangeRate)){
     if (is_Object($currency)) {
         $exchangeRate = $currency->exchangeRateShopper;
         vmdebug('convertCurrencyTo OBJECT ' . $exchangeRate);
     } else {
         //				$this->_db = JFactory::getDBO();
         $q = 'SELECT `currency_exchange_rate` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id` ="' . (int) $currency . '" ';
         $this->_db->setQuery($q);
         $exch = $this->_db->loadResult();
         // 				vmdebug('begin convertCurrencyTo '.$exch);
         if (!empty($exch) and $exch !== '0.00000') {
             $exchangeRate = $exch;
         } else {
             $exchangeRate = FALSE;
         }
     }
     //	}
     $this->exchangeRateShopper = $exchangeRate;
     // 		vmdebug('convertCurrencyTo my currency ',$exchangeRate,$currency);
     if (!empty($exchangeRate) && $exchangeRate != FALSE) {
         //vmdebug('convertCurrencyTo Use custom rate');
         if ($shop) {
             $price = $price / $exchangeRate;
         } else {
             $price = $price * $exchangeRate;
         }
         // 			vmdebug('!empty($exchangeRate) && $exchangeRate!=FALSE '.$price.' '.$exchangeRate);
     } else {
         $currencyCode = self::ensureUsingCurrencyCode($currency);
         $vendorCurrencyCode = self::ensureUsingCurrencyCode($this->_vendorCurrency);
         $globalCurrencyConverter = JRequest::getVar('globalCurrencyConverter');
         if ($shop) {
             //$oldprice = $price;
             $price = $this->_currencyConverter->convert($price, $currencyCode, $vendorCurrencyCode);
             //vmdebug('convertCurrencyTo Use dynamic rate in shop '.$oldprice .' => '.$price);
         } else {
             //vmdebug('convertCurrencyTo Use dynamic rate to shopper currency '.$price);
             $price = $this->_currencyConverter->convert($price, $vendorCurrencyCode, $currencyCode);
         }
         // 			vmdebug('convertCurrencyTo my currency ',$this->exchangeRateShopper);
     }
     return $price;
 }
开发者ID:Gskflute,项目名称:joomla25,代码行数:70,代码来源:currencydisplay.php

示例15: CRM_Core_DAO_UFMatch

 /**
  * Synchronize the object with the UF Match entry. Can be called stand-alone from
  * the drupalUsers script
  *
  * @param Object  $user    the drupal user object
  * @param string  $userKey the id of the user from the uf object
  * @param string  $uniqId    the OpenID of the user
  * @param string  $uf      the name of the user framework
  * @param integer $status  returns the status if user created or already exits (used for CMS sync)
  *
  * @return the ufmatch object that was found or created
  * @access public
  * @static
  */
 static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = null, $ctype = null)
 {
     // validate that uniqId is a valid url. it will either be
     // an OpenID (which should always be a valid url) or a
     // http://uf_username/ construction (so that it can
     // be used as an OpenID in the future)
     require_once 'CRM/Utils/Rule.php';
     if ($uf == 'Standalone') {
         if (!CRM_Utils_Rule::url($uniqId)) {
             return $status ? null : false;
         }
     } else {
         if (!CRM_Utils_Rule::email($uniqId)) {
             return $status ? null : false;
         }
     }
     $newContact = false;
     // make sure that a contact id exists for this user id
     $ufmatch =& new CRM_Core_DAO_UFMatch();
     if (CRM_Core_DAO::checkFieldExists('civicrm_uf_match', 'domain_id')) {
         // FIXME: if() condition check was required especially for upgrade cases (2.2.x -> 3.0.x),
         // where folks if happen to logout, would encounter a column not found fatal error
         $ufmatch->domain_id = CRM_Core_Config::domainID();
     }
     $ufmatch->uf_id = $userKey;
     if (!$ufmatch->find(true)) {
         require_once 'CRM/Core/Transaction.php';
         $transaction = new CRM_Core_Transaction();
         if (!empty($_POST)) {
             $params = $_POST;
             $params['email'] = $uniqId;
             require_once 'CRM/Dedupe/Finder.php';
             $dedupeParams = CRM_Dedupe_Finder::formatParams($params, 'Individual');
             $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
             if (!empty($ids)) {
                 $dao = new CRM_Core_DAO();
                 $dao->contact_id = $ids[0];
             }
         } else {
             require_once 'CRM/Contact/BAO/Contact.php';
             if ($uf == 'Standalone') {
                 $dao =& CRM_Contact_BAO_Contact::matchContactOnOpenId($uniqId, $ctype);
             } else {
                 $dao =& CRM_Contact_BAO_Contact::matchContactOnEmail($uniqId, $ctype);
             }
         }
         if ($dao) {
             //print "Found contact with uniqId $uniqId<br/>";
             $ufmatch->contact_id = $dao->contact_id;
             $ufmatch->uf_name = $uniqId;
         } else {
             if ($uf == 'Drupal') {
                 $mail = 'mail';
             } else {
                 $mail = 'email';
             }
             if (is_Object($user)) {
                 $params = array('email-Primary' => $user->{$mail});
             }
             if ($ctype == 'Organization') {
                 $params['organization_name'] = $uniqId;
             } else {
                 if ($ctype == 'Household') {
                     $params['household_name'] = $uniqId;
                 }
             }
             if (!$ctype) {
                 $ctype = "Individual";
             }
             $params['contact_type'] = $ctype;
             // extract first / middle / last name
             // for joomla
             if ($uf == 'Joomla' && $user->name) {
                 require_once 'CRM/Utils/String.php';
                 CRM_Utils_String::extractName($user->name, $params);
             }
             if ($uf == 'Standalone') {
                 $params['openid-Primary'] = $uniqId;
                 //need to delete below code once profile is
                 //exposed on signup page
                 if (!empty($user->first_name) || !empty($user->last_name)) {
                     $params['first_name'] = $user->first_name;
                     $params['last_name'] = $user->last_name;
                 } elseif (!empty($user->name)) {
                     require_once 'CRM/Utils/String.php';
                     CRM_Utils_String::extractName($user->name, $params);
//.........这里部分代码省略.........
开发者ID:bhirsch,项目名称:civicrm,代码行数:101,代码来源:UFMatch.php


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