本文整理匯總了PHP中type::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::get方法的具體用法?PHP type::get怎麽用?PHP type::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getContent
public function getContent()
{
$content = '';
foreach ($this->blocks as $block) {
$content .= $this->blockProvider->get($block->getProviderName())->getBlockDisplayContent($block);
}
return $content;
}
示例2: getSource
/**
* Get source object class
* @staticvar className $sources
* @param type $params
* @return \className
*/
public static function getSource($params)
{
static $sources;
if (!isset($sources[$params->get('source')])) {
$className = 'ZtNewsSource' . ucfirst($params->get('source'));
$sources[$params->get('source')] = new $className($params);
}
return $sources[$params->get('source')];
}
示例3: get
/**
* Get cached values
* @param type $key
* @param type $default allows for a default value to be supplied
* @return type returned in the event no cached value is found at the corresponding key
* @throws Exception\Service
*/
public function get($key, $default = null)
{
if (!$this->_isValidService()) {
throw new Exception\Service("Not connected to a valid service");
}
$value = $this->_service->get($key, MEMCACHE_COMPRESSED);
if ($value) {
return $value;
}
return $default;
}
示例4: isNotificationValid
/**
* Validates the requested refund
*
* @param array $notification
* @return boolean
*/
private function isNotificationValid($notification)
{
if ($this->isStructureValid($notification) && $notification['event']['event_type'] == 'refund.succeeded') {
$id = $notification['event']['event_resource']['transaction']['id'];
$privateKey = trim($this->config->get('privateKey'));
$transactionObject = new Services_Paymill_Transactions($privateKey, 'https://api.paymill.com/v2/');
$result = $transactionObject->getOne($id);
$this->logging->log('validate transaction-id for refund', var_export($result['id'] === $id, true));
return $result['id'] === $id;
}
return false;
}
示例5: getLocation
/**
* get the location for the record based on the module type
* @param type $request
* @return type
*/
static function getLocation($request) {
$recordId = $request->get('recordid');
$module = $request->get('source_module');
$locationFields = self::getLocationFields($module);
$address = array();
if (!empty($locationFields)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $module);
foreach ($locationFields as $key => $value) {
$address[$key] = Vtiger_Util_Helper::getDecodedValue($recordModel->get($value));
}
}
return $address;
}
示例6: addListPrice
/**
* Function adds Products/Services-PriceBooks Relation
* @param type $request
*/
function addListPrice($request)
{
$sourceModule = $request->getModule();
$sourceRecordId = $request->get('src_record');
$relatedModule = $request->get('related_module');
$relInfos = $request->get('relinfo');
$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);
foreach ($relInfos as $relInfo) {
$price = CurrencyField::convertToDBFormat($relInfo['price'], null, true);
$relationModel->addListPrice($sourceRecordId, $relInfo['id'], $price);
}
}
示例7: onAfterRoute
/**
* Determine if this is an edit form for content and set the return value
*
*/
public function onAfterRoute()
{
// don't run in admin
if ($this->app->isAdmin()) {
return;
}
// check that this is an edit form
if (!('com_content' == $this->input->get('option') && 'form' == $this->input->get('view'))) {
return;
}
// check if id is empty
$isNew = !(bool) (int) $this->input->get('a_id');
// set the return
return $this->processReturn($this->input->get('Itemid', 0), $isNew);
}
示例8: renderModuleHtml
/**
* Render default html
* @param type $module
* @param type $params
* @param type $width
*/
function renderModuleHtml($module, $params, $width = '')
{
// html values
$tag = $params->get('module_tag', 'div');
$class = htmlspecialchars($params->get('moduleclass_sfx'));
$header = $params->get('header_tag', 'h3');
$header_class = htmlspecialchars($params->get('header_class', ''));
// render html
echo "<{$tag} class=\"{$width} {$class}\">\n";
if ($module->showtitle != 0) {
echo "<{$header} class=\"{$header_class}\">{$module->title}</{$header}>\n";
}
echo $module->content . "\n";
echo "</{$tag}>\n";
}
示例9: processValidator
/**
* Process a single validator
* Only used if a given inputFilter was from an xmlFile or array
* @param type $v
*/
protected function processValidator($key, $v)
{
if (!isset($v['name'])) {
$v['name'] = $key;
}
switch ($key) {
case 'record_exists':
$mapper = $v['options']['mapper'];
if (FALSE !== strpos($mapper, 'getServiceManager')) {
$smOptions = explode('|', $mapper);
$mapper = $this->serviceManager->get('dxService')->get(trim($smOptions[1]));
$v['options']['mapper'] = $mapper;
return new \ZfcUser\Validator\RecordExists(array('mapper' => $mapper, 'key' => $v['options']['key']));
}
break;
case 'no_record_exists':
$mapper = $v['options']['mapper'];
if (FALSE !== strpos($mapper, 'getServiceManager')) {
$smOptions = explode('|', $mapper);
$mapper = $this->serviceManager->get('dxService')->get(trim($smOptions[1]));
$v['options']['mapper'] = $mapper;
return new \ZfcUser\Validator\NoRecordExists(array('mapper' => $mapper, 'key' => $v['options']['key']));
}
break;
default:
}
return $v;
}
示例10: modChrome_missishop
/**
* render module
* @param object $module
* @param type $params
* @param type $attribs
*/
function modChrome_missishop($module, &$params, &$attribs)
{
?>
<div class="nissi_module module<?php
echo $params->get('moduleclass_sfx');
?>
" id="module_<?php
echo $module->id;
?>
">
<div class="module_header">
<?php
if ($module->showtitle != 0) {
?>
<h3 class="module_title"><span><?php
echo $module->title;
?>
</span></h3>
<?php
}
?>
</div>
<div class="module_content clearfix">
<?php
echo $module->content;
?>
</div>
<div class="module_footer"><span></span></div>
</div>
<?php
}
示例11: mpp_taxonomy_filter_clauses
/**
* Sortable taxonomy columns
* Credit: http://scribu.net/wordpress/sortable-taxonomy-columns.html
* Modified to suit our purpose
* Allows us to sort the gallery listing by
* Slightly modified to fit our purpose
*
* @global type $wpdb
* @param type $clauses
* @param type $wp_query
* @return type
*/
function mpp_taxonomy_filter_clauses($clauses, $wp_query)
{
//only apply if we are on the mpp gallery list screen
if (!mpp_admin_is_gallery_list()) {
return $clauses;
}
if (!isset($wp_query->query['orderby'])) {
return $clauses;
}
$order_by = $wp_query->query['orderby'];
$order_by_tax = mpp_translate_to_taxonomy($order_by);
if (!$order_by_tax || !in_array($order_by, array('component', 'status', 'type'))) {
return $clauses;
}
global $wpdb;
//if we are here, It is for one of our taxonomy
$clauses['join'] .= <<<SQL
LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id
LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id)
LEFT OUTER JOIN {$wpdb->terms} USING (term_id)
SQL;
$clauses['where'] .= $wpdb->prepare(" AND (taxonomy = %s OR taxonomy IS NULL)", $order_by_tax);
$clauses['groupby'] = "object_id";
$clauses['orderby'] = "GROUP_CONCAT({$wpdb->terms}.name ORDER BY name ASC) ";
$clauses['orderby'] .= 'ASC' == strtoupper($wp_query->get('order')) ? 'ASC' : 'DESC';
return $clauses;
}
示例12: initRouters
/**
*
* @param type $application
*/
protected function initRouters($application)
{
$router = $this->_di->get('router');
$router->add('/', ['namespace' => 'Intranet\\Controllers', 'module' => 'intranet', 'controller' => 'index', 'action' => 'index']);
$router->notFound(['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'errors', 'action' => 'show404']);
$router->add('/forbidden', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'errors', 'action' => 'show401']);
$router->add('/not-found', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'errors', 'action' => 'show404']);
$router->add('/internal-error', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'errors', 'action' => 'show500']);
$router->add('/confirm/{code}/{email}', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'users', 'action' => 'confirmEmail']);
$router->add('/reset-password/{code}/{email}', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'session', 'action' => 'resetPassword']);
$router->add('/change-password', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'session', 'action' => 'changePassword']);
$router->add('/login', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'session', 'action' => 'index']);
$router->add('/login/:action', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'session', 'action' => 1]);
$router->add('/produtos', ['namespace' => 'Intranet\\Controllers', 'module' => 'intranet', 'controller' => 'consultas', 'action' => 'produtosServicos']);
$router->add('/fornecedores', ['namespace' => 'Intranet\\Controllers', 'module' => 'intranet', 'controller' => 'consultas', 'action' => 'fornecedores']);
$router->add('/profile', ['namespace' => 'Nucleo\\Controllers', 'module' => 'nucleo', 'controller' => 'users', 'action' => 'profile']);
foreach ($application->getModules() as $key => $module) {
$namespace = str_replace('Module', 'Controllers', $module['className']);
$router->add('/' . $key . '/:params', ['namespace' => $namespace, 'module' => $key, 'controller' => 'index', 'action' => 'index', 'params' => 1])->setName($key);
$router->add('/' . $key . '/:controller/:params', ['namespace' => $namespace, 'module' => $key, 'controller' => 1, 'action' => 'index', 'params' => 2]);
$router->add('/' . $key . '/:controller/:action/:params', ['namespace' => $namespace, 'module' => $key, 'controller' => 1, 'action' => 2, 'params' => 3]);
}
$router->handle();
$this->_di->setShared("router", $router);
}
示例13: route
/**
* 重繞外部路徑
* @param type $f3
* @return \PFH_Ext_app_route
*/
public function route($f3)
{
$uri = $f3->get("URI");
$uri = substr($uri, strrpos($uri, "/") + 1);
$uri = "/ext_apps/" . $uri;
$f3->reroute($uri);
return $this;
}
示例14: setGetVar
public function setGetVar($var)
{
$this->getVar = $var;
$this->currentSite = type::get($this->getVar, 'int', 1);
$this->start = $this->currentSite * $this->proSite - $this->proSite;
$this->maxSites = ceil($this->maxEntrys / $this->proSite);
return $this;
}
示例15: createObject
/**
*
* @param type $class
* @param type $params
* @return object
*/
public static function createObject($class, $params = [])
{
if (is_string($class)) {
$object = Application::$container->get($class, $params);
} elseif (is_array($class)) {
$object = call_user_func([self::createObject($class[0]), $class[1]], $params);
}
return $object;
}