本文整理汇总了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);
}
示例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);
}
示例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";
}
}
}
}
示例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;
}
}
示例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;
}
示例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 .= ' ';
}
$return .= $k . "->{$v}\n";
$return .= $this->debugObject($v, $indent + 1);
}
return $return;
}
}
示例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;
}
}
示例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();
}
}
示例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')));
}
}
}
示例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";
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
//.........这里部分代码省略.........