當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。