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


PHP obj::get方法代码示例

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


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

示例1: mdjm_quote_post_order

/**
 * Order posts.
 *
 * @since	1.3
 * @param	obj		$query		The WP_Query object
 * @return	void
 */
function mdjm_quote_post_order($query)
{
    if (!is_admin() || 'mdjm-quotes' != $query->get('post_type')) {
        return;
    }
    switch ($query->get('orderby')) {
        case 'quote_view_date':
            $query->set('meta_key', '_mdjm_quote_viewed_date');
            $query->set('orderby', 'meta_value');
            break;
        case 'quote_value':
            // TO DO
            break;
    }
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:22,代码来源:quotes.php

示例2: mdjm_venue_post_order

/**
 * Order posts.
 *
 * @since	1.3
 * @param	obj		$query		The WP_Query object
 * @return	void
 */
function mdjm_venue_post_order($query)
{
    if (!is_admin() || 'mdjm-venue' != $query->get('post_type')) {
        return;
    }
    switch ($query->get('orderby')) {
        case 'town':
            $query->set('meta_key', '_venue_town');
            $query->set('orderby', 'meta_value');
            break;
        case 'county':
            $query->set('meta_key', '_venue_county');
            $query->set('orderby', 'meta_value');
            break;
    }
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:23,代码来源:venues.php

示例3: isValidCaptcha

 /**
  * Validate captcha
  *
  * @return  bool
  */
 public function isValidCaptcha()
 {
     if ($this->params->get('captcha_verify') && (!$this->session('saola_captcha') || $this->session('saola_captcha') !== $this->post('saola-captcha'))) {
         $this->errors[] = JText::_('SAOLA_ERROR_CAPTCHA_VERIFICATION');
     }
     return !$this->errors;
 }
开发者ID:krishnan57474,项目名称:saola,代码行数:12,代码来源:Saola.php

示例4: getdata

 /**
  * Retorna todos os dados de um registro pelo id
  * @param  string $id  id do registro
  * @return array
  */
 private static function getdata($id)
 {
     return self::$psy->get(function ($data) use($id) {
         if ($data['id'] == $id) {
             return $data;
         }
     });
 }
开发者ID:EduhAzvdo,项目名称:psyDuck-examples,代码行数:13,代码来源:DataClass.php

示例5: addToQueue

 private function addToQueue()
 {
     // CREATE TXT MAIL MIME
     if ($this->messageTxt && $this->sendTxt) {
         $mimeparams = array();
         //$mimeparams['eol'] = "\n\n\t";
         $mimeparams['head_encoding'] = "quoted-printable";
         // "8bit";
         $mimeparams['text_encoding'] = "quoted-printable";
         // "8bit";
         $mimeparams['html_encoding'] = "quoted-printable";
         // "8bit";
         $mimeparams['head_charset'] = "UTF-8";
         // "iso-8859-1";
         $mimeparams['text_charset'] = "UTF-8";
         // "iso-8859-1";
         $mimeparams['html_charset'] = "UTF-8";
         // "iso-8859-1";
         $this->Mail_mime = new Mail_mime($mimeparams);
         $this->Mail_mime->setTXTBody($this->messageTxt);
         // PUT IN QUEUE HTML MAIL
         if (!$this->debug) {
             $this->newMailQueueId[] = $this->Mail_Queue->put($this->from, $this->recipient, $this->Mail_mime->headers($this->headers, true), $this->Mail_mime->get(), $this->mail_options['seconds_to_send'], $this->mail_options['delete_after_send'], $this->emailId);
             if ($this->debug) {
                 $this->ErrorManager->addError('ID OF TXT MAIL PUT IN QUEUE', $this->newMailQueueId);
             }
         }
     }
     // CREATE HTML MAIL MIME
     if ($this->messageHtml && $this->sendHtml) {
         $mimeparams = array();
         //$mimeparams['eol'] = "\n\n\t";
         $mimeparams['head_encoding'] = "quoted-printable";
         // "8bit";
         $mimeparams['text_encoding'] = "quoted-printable";
         // "8bit";
         $mimeparams['html_encoding'] = "quoted-printable";
         // "8bit";
         $mimeparams['head_charset'] = "UTF-8";
         // "iso-8859-1";
         $mimeparams['text_charset'] = "UTF-8";
         // "iso-8859-1";
         $mimeparams['html_charset'] = "UTF-8";
         // "iso-8859-1";
         $this->Mail_mime = new Mail_mime($mimeparams);
         $this->Mail_mime->setHTMLBody($this->messageHtml);
         // PUT IN QUEUE HTML MAIL
         if (!$this->debug) {
             $this->newMailQueueId[] = $this->Mail_Queue->put($this->from, $this->recipient, $this->Mail_mime->headers($this->headers, true), $this->Mail_mime->getHTMLBody(), $this->mail_options['seconds_to_send'], $this->mail_options['delete_after_send'], $this->emailId);
             if ($this->debug) {
                 $this->ErrorManager->addError('ID OF HTML MAIL PUT IN QUEUE', $this->newMailQueueId);
             }
         }
     }
     if ($this->debug) {
         $this->ErrorManager->addError('MAIL MIME', $this->Mail_mime);
     }
 }
开发者ID:santikrass,项目名称:poliversal,代码行数:58,代码来源:class.ManageMailQueue.php

示例6: return_data

 public function return_data()
 {
     global $add_res;
     if (!empty($this->message)) {
         $add_res = array('text' => $this->message, 'error' => !$this->success);
         $cookie = obj::get('dynamic__cookie');
         $cookie->inner_set('add_res.text', $this->message);
         $cookie->inner_set('add_res.error', !$this->success);
     }
 }
开发者ID:4otaku,项目名称:4otaku,代码行数:10,代码来源:user.php

示例7: mdjm_transaction_post_order

/**
 * Order posts.
 *
 * @since	1.3
 * @param	obj		$query		The WP_Query object
 * @return	void
 */
function mdjm_transaction_post_order($query)
{
    if (!is_admin() || 'mdjm-transaction' != $query->get('post_type')) {
        return;
    }
    switch ($query->get('orderby')) {
        case 'txn_date':
        default:
            $query->set('orderby', 'post_date');
            break;
        case 'txn_status':
            $query->set('orderby', '_mdjm_txn_status');
            break;
        case 'event':
            $query->set('orderby', 'post_parent');
            break;
        case 'txn_value':
            $query->set('meta_key', '_mdjm_txn_total');
            $query->set('orderby', 'meta_value_num');
            break;
    }
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:29,代码来源:txns.php

示例8: get_dirs

 /**
  * 获得一级子目录
  * @param int $dir_id
  * @return array
  * @author weizhifeng
  **/
 protected function get_dirs($dir_id)
 {
     $folder = $this->kc_folder->get($dir_id);
     $sub_folders = array();
     if (isset($folder['sub_folder_ids']) && $folder['sub_folder_ids'] != NULL) {
         $sub_folder_ids = explode(',', $folder['sub_folder_ids']);
         foreach ($sub_folder_ids as $_sub_folder_id) {
             $sub_folder = $this->kc_folder->get($_sub_folder_id);
             $sub_folders[] = array('id' => $sub_folder['id'], 'name' => $sub_folder['name'], 'readable' => $sub_folder['readable'], 'writable' => $sub_folder['writable'], 'removable' => $sub_folder['removable'], 'has_dirs' => $sub_folder['sub_folder_ids'] != NULL ? TRUE : FALSE);
         }
     }
     return $sub_folders;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:19,代码来源:kc_browser.php

示例9: searchtip

	function searchtip () {

		$search = obj::get('search');

		$data = urldecode(query::$get['data']);
		$query = $search->prepare_string($data, true);

		if (empty($query)) {
			return;
		}

		$area = $this->parse_area(query::$get['area']);

		$order = implode('+', $area);
		$where = 'and ('.implode('>0 or ',$area).'> 0)';

		$queries = Database::get_vector('search_queries',
			'id, query',
			'(Left(query, ?) = ? '.$where.') order by '.$order.' desc limit 10',
			array(mb_strlen($query), $query));

		$return = array();
		foreach ($queries as $one) {
			$return[] = array('query' => $one,
				'alias' => $one,
				'type' => 'search');
		}

		if (count($area) == 1) {
			$single = reset($area);
			if (in_array($single, $this->_meta_tips)) {

				$meta = array();

				$field = $single.'_main';
				$params = array(mb_strlen($query), $query,
					mb_strlen($query), $query, '|'.$query);
				$meta['tag'] = Database::get_vector('tag',
					'`id`, `alias`, `name` as query',
						'(Left(alias , ?) = ? or Left(name, ?) = ? or
						locate(?, tag.variants)) and '.$field.' > 0
						order by '.$field.' desc limit 2',
					$params
				);

				$params = array(mb_strlen($query), $query,
					mb_strlen($query), $query, '|'.$single.'|');
				$meta['category'] = Database::get_vector('category',
					'`id`, `alias`, `name` as query',
						'(Left(alias , ?) = ? or Left(name, ?) = ?)
						 and locate(?, category.area) limit 2',
					$params
				);

				$params = array(mb_strlen($query), $query,
					mb_strlen($query), $query);
				$meta['language'] = Database::get_vector('language',
					'`id`, `alias`, `name` as query',
					'Left(alias , ?) = ? or Left(name, ?) = ? limit 2',
					$params
				);

				foreach ($meta as $key => $one) {
					foreach ((array) $one as $variant) {
						$variant['type'] = $key;
						$return[] = $variant;
					}
				}
			}
		}

		shuffle($return);
		$return = array_slice($return,0,10);

		foreach ($return as &$one) {

			switch ($one['type']) {
				case 'tag':
					$one['query'] = "Тег: ".$one['query'];
					break;
				case 'category':
					$one['query'] = "Категория: ".$one['query'];
					break;
				case 'language':
					$one['query'] = "Язык: ".$one['query'];
					break;
				default: break;
			}

			if ($one['type'] != 'search') {
				$one['alias'] = '/'.$single.'/'.$one['type'].'/'.$one['alias'].'/';
			}
		}

		return $return;
	}
开发者ID:4otaku,项目名称:4otaku,代码行数:96,代码来源:search.php

示例10: role_may_view

 /**
  * Does the current role have permission to even see this region?
  * @param  obj $User     User object
  * @param  obj $Settings Settings object
  * @return bool           View or not
  */
 public function role_may_view($User, $Settings)
 {
     if ($this->role_may_edit($User)) {
         return true;
     }
     if ($Settings->get('content_hideNonEditableRegions')->val()) {
         return false;
     }
     return true;
 }
开发者ID:Bloom-web,项目名称:bloom-web,代码行数:16,代码来源:PerchContent_Region.class.php

示例11: syncGrades

 /**
  * Query to sync form scores with gradebook
  *
  * @param      obj   $course
  * @param      array $member_id
  * @return     void
  */
 public function syncGrades($course, $member_id = null)
 {
     if (!is_null($member_id) && !empty($member_id)) {
         if (!is_array($member_id)) {
             $member_id = (array) $member_id;
         }
     } else {
         // Pull all section members
         $members = $course->offering()->section()->members(array('student' => 1));
         $member_id = array();
         // Get member id's for refresh filter
         foreach ($members as $member) {
             $member_id[] = $member->get('id');
         }
     }
     if (count($member_id) == 0) {
         return;
     }
     // Get the assets
     $asset = new Asset($this->_db);
     $assets = $asset->find(array('w' => array('course_id' => $course->get('id'), 'section_id' => $course->offering()->section()->get('id'), 'offering_id' => $course->offering()->get('id'), 'asset_type' => 'form')));
     // Query for existing data
     $query = "SELECT * FROM `#__courses_grade_book` WHERE `member_id` IN (" . implode(',', $member_id) . ") AND `scope` IN ('asset')";
     $this->_db->setQuery($query);
     $results = $this->_db->loadObjectList();
     $existing_grades = array();
     foreach ($results as $r) {
         $existing_grades[$r->member_id . '.' . $r->scope_id] = array('id' => $r->id, 'score' => $r->score);
     }
     $inserts = array();
     $updates = array();
     $deletes = array();
     if (count($assets) > 0) {
         foreach ($assets as $asset) {
             // Add null values for unpublished forms that may have already been taken
             if ($asset->state != 1) {
                 $deletes[] = $asset->id;
                 continue;
             }
             $crumb = false;
             // Check for result for given student on form
             $crumb = $asset->url;
             if (!$crumb || strlen($crumb) != 20 || $asset->state != 1) {
                 // Break foreach, this is not a valid form!
                 continue;
             }
             include_once dirname(__DIR__) . DS . 'models' . DS . 'formDeployment.php';
             $dep = \Components\Courses\Models\PdfFormDeployment::fromCrumb($crumb, $course->offering()->section()->get('id'));
             $results = $dep->getResults('member_id', $member_id);
             switch ($dep->getState()) {
                 // Form isn't available yet
                 case 'pending':
                     // Null value
                     foreach ($member_id as $u) {
                         $key = $u . '.' . $asset->id;
                         if (!array_key_exists($key, $existing_grades)) {
                             $inserts[] = "('{$u}', NULL, 'asset', '{$asset->id}', NULL)";
                         } else {
                             if (!is_null($existing_grades[$key]['score'])) {
                                 $updates[] = "UPDATE `#__courses_grade_book` SET `score` = NULL WHERE `id` = '" . $existing_grades[$key]['id'] . "'";
                             }
                         }
                     }
                     break;
                     // Form availability has expired - students either get a 0, or their score (no nulls)
                 // Form availability has expired - students either get a 0, or their score (no nulls)
                 case 'expired':
                     foreach ($member_id as $u) {
                         $score = isset($results[$u]['score']) ? $results[$u]['score'] : '0.00';
                         $finished = isset($results[$u]['finished']) ? '\'' . $results[$u]['finished'] . '\'' : 'NULL';
                         $key = $u . '.' . $asset->id;
                         if (!array_key_exists($key, $existing_grades)) {
                             $inserts[] = "('{$u}', '{$score}', 'asset', '{$asset->id}', {$finished})";
                         } else {
                             if ($existing_grades[$key]['score'] != $score) {
                                 $updates[] = "UPDATE `#__courses_grade_book` SET `score` = '{$score}', `score_recorded` = {$finished} WHERE `id` = '" . $existing_grades[$key]['id'] . "'";
                             }
                         }
                     }
                     break;
                     // Form is still active - students either get their score, or a null
                 // Form is still active - students either get their score, or a null
                 case 'active':
                     foreach ($member_id as $u) {
                         $resp = $dep->getRespondent($u);
                         // Form is active and they have completed it!
                         if ($resp->getEndTime() && $resp->getEndTime() != '') {
                             $score = isset($results[$u]['score']) ? '\'' . $results[$u]['score'] . '\'' : 'NULL';
                             $key = $u . '.' . $asset->id;
                             if (!array_key_exists($key, $existing_grades)) {
                                 $inserts[] = "('{$u}', {$score}, 'asset', '{$asset->id}', '" . $results[$u]['finished'] . "')";
                             } else {
                                 if ($existing_grades[$key]['score'] != $score) {
//.........这里部分代码省略.........
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:101,代码来源:grade.book.php

示例12: mdjm_addon_post_order

/**
 * Order addon posts.
 *
 * @since	1.4
 * @param	obj		$query		The WP_Query object
 * @return	void
 */
function mdjm_addon_post_order($query)
{
    if (!is_admin() || 'mdjm-addon' != $query->get('post_type')) {
        return;
    }
    $orderby = $query->get('orderby');
    $order = $query->get('order');
    switch ($orderby) {
        case 'ID':
            $query->set('orderby', 'ID');
            $query->set('order', $order);
            break;
        case 'price':
            $query->set('meta_key', '_addon_price');
            $query->set('orderby', 'meta_value_num');
            $query->set('order', $order);
            break;
    }
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:26,代码来源:equipment.php

示例13: mdjm_hide_inactive_events

/**
 * Hide inactive events from the 'all' events list.
 *
 * @since	1.0
 * @param	obj		$query	The WP_Query.
 * @return	void
 */
function mdjm_hide_inactive_events($query)
{
    if (!is_admin() || !$query->is_main_query() || 'mdjm-event' != $query->get('post_type')) {
        return;
    }
    $active_statuses = mdjm_active_event_statuses();
    if (isset($_GET['post_status']) && in_array($_GET['post_status'], $active_statuses)) {
        return;
    }
    if (!mdjm_get_option('show_active_only', false)) {
        return;
    }
    $active_ids = mdjm_get_events(array('post_status' => $active_statuses, 'fields' => 'ids'));
    if ($active_ids) {
        $query->set('post__in', $active_ids);
    }
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:24,代码来源:events.php


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