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


PHP self::get方法代码示例

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


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

示例1: getById

 /**
  * Get user by id
  *
  * @param integer $userId User id
  *
  * @return User
  */
 public static function getById($userId = null)
 {
     if ($userId) {
         $user = new self();
         if ($user->get()->where('id', '=', $userId)->count() > 0) {
             return $user->get()->where('id', '=', $userId)->current();
         }
     }
     return null;
 }
开发者ID:localgod,项目名称:php-tick,代码行数:17,代码来源:User.php

示例2: active

 static function active()
 {
     $Model = new self();
     $Model->active = true;
     $Model->related('image');
     return $Model->get();
 }
开发者ID:Swift-Jr,项目名称:thmdhc,代码行数:7,代码来源:mCarouselImage.php

示例3: check

 /**
  * Check that the current user has the requested capability.
  *
  * @param array $all_capabilities The full list of capabilities granted (to add to).
  * @param array $caps The capabilities being checked.
  * @param array $args Values being passed in by `current_user_can()`.
  *
  * @return array
  */
 public static function check($all_capabilities, $caps, $args)
 {
     // See if it's one of our capabilities being checked.
     $cap_full_name = array_shift($caps);
     if (stripos($cap_full_name, TABULATE_SLUG) === false) {
         return $all_capabilities;
     }
     // Strip the leading 'tabulate_' from the capability name.
     $cap = substr($cap_full_name, strlen(TABULATE_SLUG) + 1);
     // Set up basic data.
     $table_name = $args[2] ? $args[2] : false;
     $grants = new self();
     // Users with 'promote_users' capability can do everything.
     if (isset($all_capabilities['promote_users'])) {
         $all_capabilities[$cap_full_name] = true;
     }
     // Table has no grants, or doesn't have this one.
     $table_grants = $grants->get($table_name);
     if (!$table_grants || !isset($table_grants[$cap])) {
         return $all_capabilities;
     }
     // Table has grants of this capability; check whether the user has one
     // of the roles with this capability.
     $user = wp_get_current_user();
     $intersect = array_intersect($table_grants[$cap], $user->roles);
     if (count($intersect) > 0) {
         $all_capabilities[$cap_full_name] = true;
     }
     return $all_capabilities;
 }
开发者ID:kcdipesh,项目名称:tabulate,代码行数:39,代码来源:Grants.php

示例4: get

 public function get()
 {
     $parsedMessage = array();
     $message = $this->splitMessage($this->message);
     $message["header"] = $this->parseHeader($message["header"]);
     $message["contentType"] = $this->parseContentType($message["header"]["content-type"], $message["header"]["content-transfer-encoding"], $message["header"]["content-disposition"], $message["header"]["content-description"]);
     $message["charset"] = $this->getCharset($message["header"]["content-type"]);
     $partId = md5(uniqid("", true));
     $parsedMessage[$partId] = array("parentPartId" => $this->parentPartId, "header" => $message["header"], "contentType" => $message["contentType"], "charset" => $message["charset"]);
     if ($this->isCompositeMessage($message["contentType"])) {
         $parsedMessage[$partId]["body"] = false;
         if ($this->isMultipartMessage($message["contentType"]["type"])) {
             $message["bodyParts"] = $this->splitBodyParts($message["body"], $message["contentType"]["boundary"]);
         } else {
             $message["bodyParts"][] = $message["body"];
         }
         foreach ($message["bodyParts"] as $bodyPart) {
             $childParts = new self($bodyPart, $partId);
             $parsedMessage = array_merge($parsedMessage, $childParts->get());
         }
     } else {
         $parsedMessage[$partId]["body"] = $this->decodeBody($message["body"], $message["contentType"]);
     }
     return $parsedMessage;
 }
开发者ID:schpill,项目名称:thin,代码行数:25,代码来源:Parser.php

示例5: fast

 /**
  * @param $key
  * @param null $default
  * @return mixed
  * @throws \Exception
  */
 public static function fast($key, $default = null)
 {
     $keyPath = explode('.', $key, 2);
     if (count($keyPath) != 2) {
         throw new \Exception('incorrect setting $key');
     }
     $config = new self($keyPath[0]);
     return $config->get($keyPath[1], $default);
 }
开发者ID:pldin601,项目名称:SlungFramework,代码行数:15,代码来源:Config.php

示例6: deleteAll

 static function deleteAll($parentId)
 {
     $l10n = new self($parentId);
     $materialPath = Registry::getInstance()->get('material_path');
     foreach (array_keys($l10n->getLocales()) as $localeId) {
         @unlink($materialPath . $l10n->get('fileName', $localeId));
     }
     parent::deleteAll($parentId);
 }
开发者ID:jne21,项目名称:WBT,代码行数:9,代码来源:MaterialL10n.php

示例7: allToOptionsArray

 /**
  * All options to array
  *
  * @return array
  */
 public static function allToOptionsArray()
 {
     $object = new self();
     $conditions = $object->get();
     $optionsArray = array();
     foreach ($conditions as $condition) {
         $optionsArray[$condition->option] = $condition->value;
     }
     return $optionsArray;
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:15,代码来源:influencers_condition.php

示例8: getList

 public static function getList()
 {
     $list = new self();
     $list->sortBy('formName');
     $formTypes = $list->get(0);
     $result = [];
     foreach ($formTypes as $formType) {
         $result[$formType->getID()] = $formType->getFormName();
     }
     return $result;
 }
开发者ID:ExchangeCore,项目名称:concrete5-attribute-forms,代码行数:11,代码来源:AttributeFormTypeList.php

示例9: getById

 /**
  * Get user by id
  *
  * @param integer $userId User id
  *
  * @return User
  */
 public static function getById($userId = null)
 {
     if ($userId) {
         $user = new self();
         $criteria = $user->createCriteria('id', '=', $userId);
         $result = $user->get(array($criteria));
         if (!empty($result)) {
             return $result[0];
         }
     }
     return null;
 }
开发者ID:localgod,项目名称:php-tick,代码行数:19,代码来源:MUser.php

示例10: getById

 public static function getById($id)
 {
     $key = 'f' . $id;
     if ($c = Cache::get($key)) {
         return $c;
     }
     $ret = new self();
     $ret->id = $id;
     $ret->path = self::path($id);
     $ret->get();
     Cache::set($key, $ret);
     return $ret;
 }
开发者ID:rezaprima,项目名称:icms,代码行数:13,代码来源:folder.php

示例11: groupBy

 /**
  * {@inheritDoc}
  */
 public function groupBy(callable $groupKeyFunction)
 {
     $groupedMap = new self();
     foreach ($this->keyIdentityPositionMap as $identityHash => $position) {
         $keyCopy = $key = $this->keys[$position];
         $valueCopy = $value =& $this->values[$position];
         $groupKey = $groupKeyFunction($valueCopy, $keyCopy);
         if ($groupedMap->contains($groupKey)) {
             $groupMap = $groupedMap->get($groupKey);
         } else {
             $groupMap = new self();
             $groupedMap->set($groupKey, $groupMap);
         }
         $groupMap->setInternal($key, $value, $identityHash, true);
     }
     return $groupedMap;
 }
开发者ID:timetoogo,项目名称:pinq,代码行数:20,代码来源:OrderedMap.php

示例12: getInstanceById

 public static function getInstanceById($recordId, $qualifiedModuleName)
 {
     $db = PearDatabase::getInstance();
     $result = $db->pquery('SELECT * FROM ' . self::tableName . ' WHERE id = ?', array($recordId));
     if ($db->num_rows($result)) {
         $moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
         $rowData = $db->query_result_rowdata($result, 0);
         $recordModel = new self();
         $recordModel->setData($rowData);
         $parameters = Zend_Json::decode(decode_html($recordModel->get('parameters')));
         foreach ($parameters as $fieldName => $fieldValue) {
             $recordModel->set($fieldName, $fieldValue);
         }
         return $recordModel;
     }
     return false;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:17,代码来源:Record.php

示例13: retrieve

 public static function retrieve($endpoint, $params = null, $method = 'get')
 {
     $fs = new self();
     $method = strtolower($method);
     switch ($method) {
         case 'get':
             return $fs->get($endpoint, $params);
             break;
         case 'post':
             return $fs->post($endpoint, $params);
             break;
         case 'delete':
             return $fs->delete($endpoint, $params);
             break;
         default:
             throw new ddFoursquareBadRequestException('The given method is invalid.');
     }
 }
开发者ID:ner0tic,项目名称:ddFoursquare,代码行数:18,代码来源:ddFoursquare.class.php

示例14: get_value

 private function get_value($v)
 {
     if ($v instanceof self) {
         $v = $v->get();
     } else {
         if (is_bool($v)) {
             $v = $v ? 'true' : 'false';
         } else {
             if ($v === '') {
                 $v = null;
             } else {
                 if (is_array($v) || is_object($v)) {
                     $r = '';
                     foreach ($v as $k => $c) {
                         if (is_numeric($k) && is_object($c)) {
                             $e = explode('\\', get_class($c));
                             $k = array_pop($e);
                         }
                         if (is_numeric($k)) {
                             $k = 'data';
                         }
                         $x = new self($k, $c);
                         $x->escape($this->esc);
                         $r .= $x->get();
                     }
                     $v = $r;
                 } else {
                     if ($this->esc && strpos($v, '<![CDATA[') === false && preg_match("/&|<|>|\\&[^#\\da-zA-Z]/", $v)) {
                         $v = '<![CDATA[' . $v . ']]>';
                     }
                 }
             }
         }
     }
     return $v;
 }
开发者ID:tokushima,项目名称:rhaco3,代码行数:36,代码来源:Xml.php

示例15: getInstanceById

 /**
  * Function to get record instance by using id and moduleName
  * @param <Integer> $recordId
  * @param <String> $qualifiedModuleName
  * @return <Rss_Record_Model> RecordModel
  */
 public static function getInstanceById($recordId, $qualifiedModuleName)
 {
     $db = PearDatabase::getInstance();
     $result = $db->pquery('SELECT * FROM vtiger_rss WHERE rssid = ?', array($recordId));
     if ($db->num_rows($result)) {
         $rowData = $db->query_result_rowdata($result, 0);
         $recordModel = new self();
         $recordModel->setData($rowData);
         $recordModel->setModule($qualifiedModuleName);
         $rss = fetch_rss($recordModel->get('rssurl'));
         $rss->items = $recordModel->setSenderInfo($rss->items);
         $recordModel->setRssValues($rss);
         $recordModel->setRssObject($rss);
         return $recordModel;
     }
     return false;
 }
开发者ID:xrstf,项目名称:vtiger-mirror,代码行数:23,代码来源:Record.php


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