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


PHP self::setKey方法代码示例

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


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

示例1: createFromArray

 public static function createFromArray(array $getUserInfoResponse)
 {
     $user = new self();
     $user->setEmail($getUserInfoResponse['Login']);
     $user->setKey($getUserInfoResponse['Key']);
     return $user;
 }
开发者ID:capsidea,项目名称:capsidea-sdk-php,代码行数:7,代码来源:User.php

示例2: getByKey

 /**
  * @param string $key
  * @return Property_Predefined
  */
 public static function getByKey($key)
 {
     $property = new self();
     $property->setKey($key);
     $property->getResource()->getByKey();
     return $property;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:11,代码来源:Predefined.php

示例3: getByKey

 /**
  * @static
  * @param $id - translation key
  * @param bool $create - creates an empty translation entry if the key doesn't exists
  * @param bool $returnIdIfEmpty - returns $id if no translation is available
  * @return Translation_Website
  */
 public static function getByKey($id, $create = false, $returnIdIfEmpty = false)
 {
     $translation = new self();
     try {
         $translation->getResource()->getByKey($id);
     } catch (Exception $e) {
         if (!$create) {
             throw new Exception($e->getMessage());
         } else {
             $translation->setKey($id);
             $translation->setDate(time());
             $translations = array();
             foreach (Pimcore_Tool::getValidLanguages() as $lang) {
                 $translations[$lang] = "";
             }
             $translation->setTranslations($translations);
             $translation->save();
         }
     }
     if ($returnIdIfEmpty) {
         $translations = $translation->getTranslations();
         foreach ($translations as $key => $value) {
             $translations[$key] = $value ?: $id;
         }
         $translation->setTranslations($translations);
     }
     return $translation;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:35,代码来源:Website.php

示例4: setForScope

 public static function setForScope($scope, array $settings)
 {
     /** @var \Octo\System\Store\SettingStore $settingStore */
     $settingStore = Store::get('Setting');
     foreach ($settings as $key => $value) {
         $setting = new self();
         $setting->setKey($key);
         $setting->setValue($value);
         $setting->setScope($scope);
         $settingStore->saveByReplace($setting);
     }
 }
开发者ID:dw250100785,项目名称:Octo,代码行数:12,代码来源:Setting.php

示例5: parseFromXml

 /**
  * @param \SimpleXMLElement $xmlElement
  * @return Consumer
  */
 public static function parseFromXml(\SimpleXMLElement $xmlElement)
 {
     $consumer = new self();
     if (!empty($xmlElement->key)) {
         $consumer->setKey((string) $xmlElement->key);
     }
     if (!empty($xmlElement->secret)) {
         $consumer->setSecret((string) $xmlElement->secret);
     }
     if (!empty($xmlElement->name)) {
         $consumer->setName((string) $xmlElement->name);
     }
     return $consumer;
 }
开发者ID:cultuurnet,项目名称:uitid-credentials,代码行数:18,代码来源:Consumer.php

示例6: set

 public static function set($_key, $_value, $_lifetime = 60, $_options = null)
 {
     if ($_lifetime < 0) {
         $_lifetime = 0;
     }
     $cache = new self();
     $cache->setKey($_key);
     $cache->setValue($_value);
     $cache->setLifetime($_lifetime);
     if ($_options != null) {
         $cache->options = json_encode($_options, JSON_UNESCAPED_UNICODE);
     }
     return $cache->save();
 }
开发者ID:GaelGRIFFON,项目名称:core,代码行数:14,代码来源:cache.class.php

示例7: getByKey

 /**
  * @param string $key
  * @return self
  */
 public static function getByKey($key)
 {
     $cacheKey = "property_predefined_" . $key;
     try {
         $property = \Zend_Registry::get($cacheKey);
         if (!$property) {
             throw new \Exception("Predefined property in registry is null");
         }
     } catch (\Exception $e) {
         $property = new self();
         $property->setKey($key);
         $property->getDao()->getByKey();
         \Zend_Registry::set($cacheKey, $property);
     }
     return $property;
 }
开发者ID:ChristophWurst,项目名称:pimcore,代码行数:20,代码来源:Predefined.php

示例8: fetch

 public function fetch($rows)
 {
     $return = array();
     foreach ($rows as $row) {
         $obj = new self($this->_className);
         if (!empty($this->_key)) {
             $obj->setKey($this->_key);
         }
         foreach ($row as $field => $value) {
             if (!is_integer($field)) {
                 $obj->{$field} = $value;
             }
         }
         $return[] = clone $obj;
     }
     return $return;
 }
开发者ID:phpon,项目名称:on,代码行数:17,代码来源:DB.php

示例9: set

 /**
  * set data for key
  *
  * @param $key
  * @param $data
  */
 public static function set($key, $data)
 {
     $configEntry = self::get($key, TRUE);
     if (!$configEntry) {
         $configEntry = new self();
         $configEntry->setKey($key);
     }
     $configEntry->setData($data);
     $configEntry->save();
 }
开发者ID:dachcom-digital,项目名称:pimcore-lucene-search,代码行数:16,代码来源:Configuration.php

示例10: fromArray

 /**
  * {@inheritdoc}
  */
 public static function fromArray(array $values)
 {
     $message = new self();
     $values = array_merge(['asset_id' => null, 'bundle_name' => null, 'version' => null, 'checksum' => null, 'size' => null, 'key' => null], $values);
     $message->setAssetId($values['asset_id']);
     $message->setBundleName($values['bundle_name']);
     $message->setVersion($values['version']);
     $message->setChecksum($values['checksum']);
     $message->setSize($values['size']);
     $message->setKey($values['key']);
     return $message;
 }
开发者ID:jaspervdm,项目名称:pogoprotos-php,代码行数:15,代码来源:AssetDigestEntry.php

示例11: fromArray

 /**
  * {@inheritdoc}
  */
 public static function fromArray(array $values)
 {
     $message = new self();
     $values = array_merge(['key' => null, 'value' => null], $values);
     $message->setKey($values['key']);
     $message->setValue($values['value']);
     return $message;
 }
开发者ID:jaspervdm,项目名称:pogoprotos-php,代码行数:11,代码来源:TagsEntry.php

示例12: fromArray

 /**
  * {@inheritdoc}
  */
 public static function fromArray(array $values)
 {
     $message = new self();
     $values = array_merge(['festival_type' => null, 'key' => null, 'vector' => null], $values);
     $message->setFestivalType($values['festival_type']);
     $message->setKey($values['key']);
     $message->setVector($values['vector']);
     return $message;
 }
开发者ID:jaspervdm,项目名称:pogoprotos-php,代码行数:12,代码来源:FestivalSettings.php

示例13: createFromArray

 /**
  * @param array $issueData
  * @return JiraIssue
  */
 public static function createFromArray(array $issueData)
 {
     $issue = new self();
     if (isset($issueData['id'])) {
         $issue->setId($issueData['id']);
     }
     if (isset($issueData['key'])) {
         $issue->setKey($issueData['key']);
     }
     if (isset($issueData['exand'])) {
         $issue->setExpand(explode(',', $issueData['expand']));
     }
     if (!empty($issueData['fields'])) {
         $issue->setFields($issueData['fields']);
     }
     return $issue;
 }
开发者ID:tobeno,项目名称:jira-client,代码行数:21,代码来源:JiraIssue.php


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